Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a129744
Kaydet (Commit)
2a129744
authored
May 08, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Related: fdo#49271 strip charset suffixes from fontname for substitutions
Change-Id: I9d7b80ebd6d251e2ac6d16899e23584582e8f461
üst
4979a3cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
outdev3.cxx
vcl/source/gdi/outdev3.cxx
+56
-0
No files found.
vcl/source/gdi/outdev3.cxx
Dosyayı görüntüle @
2a129744
...
@@ -2421,6 +2421,44 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
...
@@ -2421,6 +2421,44 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList,
return pEntry;
return pEntry;
}
}
namespace
{
rtl::OUString stripCharSetFromName(rtl::OUString aName)
{
//I worry that someone will have a font which *does* have
//e.g. "Greek" legitimately at the end of its name :-(
const char*suffixes[] =
{
" baltic",
" ce",
" cyr",
" greek",
" tur",
" (arabic)",
" (hebrew)",
" (thai)",
" (vietnamese)"
};
//These can be crazily piled up, e.g. Times New Roman CYR Greek
bool bFinished = false;
while (!bFinished)
{
bFinished = true;
for (size_t i = 0; i < SAL_N_ELEMENTS(suffixes); ++i)
{
size_t nLen = strlen(suffixes[i]);
if (aName.endsWithIgnoreAsciiCaseAsciiL(suffixes[i], nLen))
{
bFinished = false;
aName = aName.copy(0, aName.getLength() - nLen);
}
}
}
return aName;
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
...
@@ -2505,9 +2543,27 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
...
@@ -2505,9 +2543,27 @@ ImplDevFontListData* ImplDevFontList::ImplFindByFont( FontSelectPattern& rFSD,
// use the target name to search in the prematch hook
// use the target name to search in the prematch hook
rFSD.maTargetName = aBaseFontName;
rFSD.maTargetName = aBaseFontName;
#endif
#endif
//Related: fdo#49271 RTF files often contain weird-ass
//Win 3.1/Win95 style fontnames which attempt to put the
//charset encoding into the filename
//http://www.webcenter.ru/~kazarn/eng/fonts_ttf.htm
rtl::OUString sStrippedName = stripCharSetFromName(rFSD.maTargetName);
if (!sStrippedName.equals(rFSD.maTargetName))
{
rFSD.maTargetName = sStrippedName;
aSearchName = rFSD.maTargetName;
GetEnglishSearchFontName(aSearchName);
pFoundData = ImplFindBySearchName(aSearchName);
if( pFoundData )
return pFoundData;
}
if( mpPreMatchHook )
if( mpPreMatchHook )
{
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
if( mpPreMatchHook->FindFontSubstitute( rFSD ) )
GetEnglishSearchFontName( aSearchName );
GetEnglishSearchFontName( aSearchName );
}
#ifdef ENABLE_GRAPHITE
#ifdef ENABLE_GRAPHITE
// the prematch hook uses the target name to search, but we now need
// the prematch hook uses the target name to search, but we now need
// to restore the features to make the font selection data unique
// to restore the features to make the font selection data unique
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment