Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fontconfig
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
153
Issues
153
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fontconfig
fontconfig
Commits
2d006394
Commit
2d006394
authored
Sep 20, 2017
by
Behdad Esfahbod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[varfonts] Do not set postscriptname for varfont pattern
parent
be735d6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
42 deletions
+45
-42
src/fcfreetype.c
src/fcfreetype.c
+45
-42
No files found.
src/fcfreetype.c
View file @
2d006394
...
...
@@ -1207,8 +1207,6 @@ FcFreeTypeQueryFace (const FT_Face face,
FcChar8
*
style
=
0
;
int
st
;
char
psname
[
256
];
const
char
*
tmp
;
FcBool
symbol
=
FcFalse
;
...
...
@@ -1595,52 +1593,57 @@ FcFreeTypeQueryFace (const FT_Face face,
}
/* Add the PostScript name into the cache */
tmp
=
FT_Get_Postscript_Name
(
face
);
if
(
!
tmp
)
if
(
!
variable
)
{
unsigned
int
i
;
FcChar8
*
family
,
*
familylang
=
NULL
;
size_t
len
;
int
n
=
0
;
/* Workaround when FT_Get_Postscript_Name didn't give any name.
* try to find out the English family name and convert.
*/
while
(
FcPatternObjectGetString
(
pat
,
FC_FAMILYLANG_OBJECT
,
n
,
&
familylang
)
==
FcResultMatch
)
char
psname
[
256
];
const
char
*
tmp
;
tmp
=
FT_Get_Postscript_Name
(
face
);
if
(
!
tmp
)
{
if
(
FcStrCmp
(
familylang
,
(
const
FcChar8
*
)
"en"
)
==
0
)
break
;
n
++
;
familylang
=
NULL
;
}
if
(
!
familylang
)
n
=
0
;
unsigned
int
i
;
FcChar8
*
family
,
*
familylang
=
NULL
;
size_t
len
;
int
n
=
0
;
if
(
FcPatternObjectGetString
(
pat
,
FC_FAMILY_OBJECT
,
n
,
&
family
)
!=
FcResultMatch
)
goto
bail1
;
len
=
strlen
((
const
char
*
)
family
);
/* the literal name in PostScript Language is limited to 127 characters though,
* It is the architectural limit. so assuming 255 characters may works enough.
*/
for
(
i
=
0
;
i
<
len
&&
i
<
255
;
i
++
)
{
/* those characters are not allowed to be the literal name in PostScript */
static
const
char
exclusive_chars
[]
=
"
\x04
()/<>[]{}
\t\f\r\n
"
;
/* Workaround when FT_Get_Postscript_Name didn't give any name.
* try to find out the English family name and convert.
*/
while
(
FcPatternObjectGetString
(
pat
,
FC_FAMILYLANG_OBJECT
,
n
,
&
familylang
)
==
FcResultMatch
)
{
if
(
FcStrCmp
(
familylang
,
(
const
FcChar8
*
)
"en"
)
==
0
)
break
;
n
++
;
familylang
=
NULL
;
}
if
(
!
familylang
)
n
=
0
;
if
(
strchr
(
exclusive_chars
,
family
[
i
])
!=
NULL
)
psname
[
i
]
=
'-'
;
else
psname
[
i
]
=
family
[
i
];
if
(
FcPatternObjectGetString
(
pat
,
FC_FAMILY_OBJECT
,
n
,
&
family
)
!=
FcResultMatch
)
goto
bail1
;
len
=
strlen
((
const
char
*
)
family
);
/* the literal name in PostScript Language is limited to 127 characters though,
* It is the architectural limit. so assuming 255 characters may works enough.
*/
for
(
i
=
0
;
i
<
len
&&
i
<
255
;
i
++
)
{
/* those characters are not allowed to be the literal name in PostScript */
static
const
char
exclusive_chars
[]
=
"
\x04
()/<>[]{}
\t\f\r\n
"
;
if
(
strchr
(
exclusive_chars
,
family
[
i
])
!=
NULL
)
psname
[
i
]
=
'-'
;
else
psname
[
i
]
=
family
[
i
];
}
psname
[
i
]
=
0
;
}
psname
[
i
]
=
0
;
}
else
{
strncpy
(
psname
,
tmp
,
255
);
psname
[
255
]
=
0
;
else
{
strncpy
(
psname
,
tmp
,
255
);
psname
[
255
]
=
0
;
}
if
(
!
FcPatternAddString
(
pat
,
FC_POSTSCRIPT_NAME
,
(
const
FcChar8
*
)
psname
))
goto
bail1
;
}
if
(
!
FcPatternAddString
(
pat
,
FC_POSTSCRIPT_NAME
,
(
const
FcChar8
*
)
psname
))
goto
bail1
;
if
(
file
&&
*
file
&&
!
FcPatternAddString
(
pat
,
FC_FILE
,
file
))
goto
bail1
;
...
...
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