[truetype] Fix thinko related to PS name of default named instance.
* src/truetype/ttgxvar.c (TT_Get_MM_Var): `strid' and `psid' are name ID values, not indices into the array of name entries.
This commit is contained in:
parent
4c1b5dc152
commit
1ede3674cb
|
@ -1,3 +1,10 @@
|
||||||
|
2017-03-29 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[truetype] Fix thinko related to PS name of default named instance.
|
||||||
|
|
||||||
|
* src/truetype/ttgxvar.c (TT_Get_MM_Var): `strid' and `psid' are
|
||||||
|
name ID values, not indices into the array of name entries.
|
||||||
|
|
||||||
2017-03-27 Werner Lemberg <wl@gnu.org>
|
2017-03-27 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[cid, truetype] Don't use `index' as a variable name.
|
[cid, truetype] Don't use `index' as a variable name.
|
||||||
|
|
|
@ -2171,42 +2171,43 @@
|
||||||
{
|
{
|
||||||
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
|
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
|
||||||
|
|
||||||
FT_Int found, win, apple;
|
FT_Int found, dummy1, dummy2;
|
||||||
|
FT_UInt strid = 0xFFFFFFFFUL;
|
||||||
|
|
||||||
|
|
||||||
/* the default instance is missing in array the */
|
/* the default instance is missing in array the */
|
||||||
/* of named instances; try to synthesize an entry */
|
/* of named instances; try to synthesize an entry */
|
||||||
found = sfnt->get_name_id( face,
|
found = sfnt->get_name_id( face,
|
||||||
TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY,
|
TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY,
|
||||||
&win,
|
&dummy1,
|
||||||
&apple );
|
&dummy2 );
|
||||||
if ( !found )
|
if ( found )
|
||||||
|
strid = TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY;
|
||||||
|
else
|
||||||
|
{
|
||||||
found = sfnt->get_name_id( face,
|
found = sfnt->get_name_id( face,
|
||||||
TT_NAME_ID_FONT_SUBFAMILY,
|
TT_NAME_ID_FONT_SUBFAMILY,
|
||||||
&win,
|
&dummy1,
|
||||||
&apple );
|
&dummy2 );
|
||||||
|
if ( found )
|
||||||
|
strid = TT_NAME_ID_FONT_SUBFAMILY;
|
||||||
|
}
|
||||||
|
|
||||||
if ( found )
|
if ( found )
|
||||||
{
|
{
|
||||||
FT_Int strid = win >= 0 ? win : apple;
|
|
||||||
|
|
||||||
|
|
||||||
found = sfnt->get_name_id( face,
|
found = sfnt->get_name_id( face,
|
||||||
TT_NAME_ID_PS_NAME,
|
TT_NAME_ID_PS_NAME,
|
||||||
&win,
|
&dummy1,
|
||||||
&apple );
|
&dummy2 );
|
||||||
if ( found )
|
if ( found )
|
||||||
{
|
{
|
||||||
FT_Int psid = win >= 0 ? win : apple;
|
|
||||||
|
|
||||||
|
|
||||||
FT_TRACE5(( "TT_Get_MM_Var:"
|
FT_TRACE5(( "TT_Get_MM_Var:"
|
||||||
" Adding default instance to named instances\n" ));
|
" Adding default instance to named instances\n" ));
|
||||||
|
|
||||||
ns = &mmvar->namedstyle[fvar_head.instanceCount];
|
ns = &mmvar->namedstyle[fvar_head.instanceCount];
|
||||||
|
|
||||||
ns->strid = (FT_UInt)strid;
|
ns->strid = strid;
|
||||||
ns->psid = (FT_UInt)psid;
|
ns->psid = TT_NAME_ID_PS_NAME;
|
||||||
|
|
||||||
a = mmvar->axis;
|
a = mmvar->axis;
|
||||||
c = ns->coords;
|
c = ns->coords;
|
||||||
|
|
Loading…
Reference in New Issue