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
6c06dd34
Kaydet (Commit)
6c06dd34
authored
Ock 11, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: fdo#44492 look up font by FC_FILE+FC_INDEX rather than FC_FAMILY
üst
6b5eacd1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
19 deletions
+42
-19
fontconfig.cxx
vcl/generic/fontmanager/fontconfig.cxx
+39
-12
fontmanager.cxx
vcl/generic/fontmanager/fontmanager.cxx
+1
-5
fontsubst.cxx
vcl/generic/fontmanager/fontsubst.cxx
+1
-1
fontmanager.hxx
vcl/inc/vcl/fontmanager.hxx
+1
-1
No files found.
vcl/generic/fontmanager/fontconfig.cxx
Dosyayı görüntüle @
6c06dd34
...
...
@@ -746,7 +746,7 @@ static void addtopattern(FcPattern *pPattern,
}
}
bool
PrintFontManager
::
Substitute
(
FontSelectPattern
&
rPattern
,
rtl
::
OUString
&
rMissingCodes
)
const
bool
PrintFontManager
::
Substitute
(
FontSelectPattern
&
rPattern
,
rtl
::
OUString
&
rMissingCodes
)
{
bool
bRet
=
false
;
...
...
@@ -814,21 +814,48 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, rtl::OUString& r
if
(
pSet
->
nfont
>
0
)
{
//extract the closest match
FcChar8
*
family
=
NULL
;
FcResult
eFileRes
=
FcPatternGetString
(
pSet
->
fonts
[
0
],
FC_FAMILY
,
0
,
&
family
);
// get the family name
FcChar8
*
file
=
NULL
;
FcResult
eFileRes
=
FcPatternGetString
(
pSet
->
fonts
[
0
],
FC_FILE
,
0
,
&
file
);
int
nCollectionEntry
=
0
;
FcResult
eIndexRes
=
FcPatternGetInteger
(
pSet
->
fonts
[
0
],
FC_INDEX
,
0
,
&
nCollectionEntry
);
if
(
eIndexRes
!=
FcResultMatch
)
nCollectionEntry
=
0
;
if
(
eFileRes
==
FcResultMatch
)
{
bRet
=
true
;
OString
aDir
,
aBase
,
aOrgPath
(
(
sal_Char
*
)
file
);
splitPath
(
aOrgPath
,
aDir
,
aBase
);
int
nDirID
=
getDirectoryAtom
(
aDir
,
true
);
fontID
aFont
=
findFontFileID
(
nDirID
,
aBase
,
nCollectionEntry
);
if
(
aFont
>
0
)
{
FastPrintFontInfo
aInfo
;
bRet
=
getFontFastInfo
(
aFont
,
aInfo
);
rPattern
.
maSearchName
=
aInfo
.
m_aFamilyName
;
}
}
SAL_WARN_IF
(
!
bRet
,
"vcl"
,
"no FC_FILE found, falling back to name search"
);
OString
sFamily
((
sal_Char
*
)
family
);
boost
::
unordered_map
<
rtl
::
OString
,
rtl
::
OString
,
rtl
::
OStringHash
>::
const_iterator
aI
=
rWrapper
.
m_aFontNameToLocalized
.
find
(
sFamily
);
if
(
aI
!=
rWrapper
.
m_aFontNameToLocalized
.
end
())
sFamily
=
aI
->
second
;
rPattern
.
maSearchName
=
rtl
::
OStringToOUString
(
sFamily
,
RTL_TEXTENCODING_UTF8
);
if
(
!
bRet
)
{
FcChar8
*
family
=
NULL
;
FcResult
eFamilyRes
=
FcPatternGetString
(
pSet
->
fonts
[
0
],
FC_FAMILY
,
0
,
&
family
);
// get the family name
if
(
eFamilyRes
==
FcResultMatch
)
{
OString
sFamily
((
sal_Char
*
)
family
);
boost
::
unordered_map
<
rtl
::
OString
,
rtl
::
OString
,
rtl
::
OStringHash
>::
const_iterator
aI
=
rWrapper
.
m_aFontNameToLocalized
.
find
(
sFamily
);
if
(
aI
!=
rWrapper
.
m_aFontNameToLocalized
.
end
())
sFamily
=
aI
->
second
;
rPattern
.
maSearchName
=
rtl
::
OStringToOUString
(
sFamily
,
RTL_TEXTENCODING_UTF8
);
bRet
=
true
;
}
}
if
(
bRet
)
{
int
val
=
0
;
if
(
FcResultMatch
==
FcPatternGetInteger
(
pSet
->
fonts
[
0
],
FC_WEIGHT
,
0
,
&
val
))
rPattern
.
meWeight
=
convertWeight
(
val
);
...
...
vcl/generic/fontmanager/fontmanager.cxx
Dosyayı görüntüle @
6c06dd34
...
...
@@ -1483,12 +1483,8 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, i
{
TrueTypeFontFile
*
const
pFont
=
static_cast
<
TrueTypeFontFile
*
const
>
((
*
it
).
second
);
if
(
pFont
->
m_nDirectory
==
nDirID
&&
pFont
->
m_aFontFile
==
rFontFile
)
{
fprintf
(
stderr
,
"candidate %d vs %d
\n
"
,
pFont
->
m_nCollectionEntry
,
nFaceIndex
);
if
(
pFont
->
m_nCollectionEntry
==
nFaceIndex
)
pFont
->
m_aFontFile
==
rFontFile
&&
pFont
->
m_nCollectionEntry
==
nFaceIndex
)
nID
=
it
->
first
;
}
}
break
;
case
fonttype
:
:
Builtin
:
...
...
vcl/generic/fontmanager/fontsubst.cxx
Dosyayı görüntüle @
6c06dd34
...
...
@@ -117,7 +117,7 @@ void SalGenericInstance::RegisterFontSubstitutors( ImplDevFontList* pList )
static
FontSelectPattern
GetFcSubstitute
(
const
FontSelectPattern
&
rFontSelData
,
rtl
::
OUString
&
rMissingCodes
)
{
FontSelectPattern
aSubstituted
(
rFontSelData
);
const
psp
::
PrintFontManager
&
rMgr
=
psp
::
PrintFontManager
::
get
();
psp
::
PrintFontManager
&
rMgr
=
psp
::
PrintFontManager
::
get
();
rMgr
.
Substitute
(
aSubstituted
,
rMissingCodes
);
return
aSubstituted
;
}
...
...
vcl/inc/vcl/fontmanager.hxx
Dosyayı görüntüle @
6c06dd34
...
...
@@ -648,7 +648,7 @@ public:
bool
matchFont
(
FastPrintFontInfo
&
rInfo
,
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
);
ImplFontOptions
*
getFontOptions
(
const
FastPrintFontInfo
&
,
int
nSize
,
void
(
*
subcallback
)(
void
*
))
const
;
bool
Substitute
(
FontSelectPattern
&
rPattern
,
rtl
::
OUString
&
rMissingCodes
)
const
;
bool
Substitute
(
FontSelectPattern
&
rPattern
,
rtl
::
OUString
&
rMissingCodes
);
int
FreeTypeCharIndex
(
void
*
pFace
,
sal_uInt32
aChar
);
};
...
...
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