[CLOSED] More bugs with UFO

Post your bug reports here. Include information that helps us to understand and reproduce the bug.
Post Reply
NFSL2001
Posts: 9
Joined: Sun Jul 17, 2022 3:51 pm

[CLOSED] More bugs with UFO

Post by NFSL2001 »

Were reported in viewtopic.php?p=48590#p48590 . Tested on 15.0.0.2974

1. name ID=1 and 2 are still not exported even when explicitly in Font Properties - Font - Family Name and Instances - General - Style Name.
2. Generated font files contains platformID=1 platEncID=0 while generated UFO files doesn't.
3. The features.fea file might sometimes contains glyph names that are over 63 characters long. E.g. name: `katakanasmallhu_katakanahiraganasemivoicedsoundmarkcomb-kana.ccmp.1` is 65 characters long. This is auto-generated name by FontCreator.
4. [new] Generated @BASE and @MARK class definition are written as @\BASE and @\MARK, causing parsing failure.

Also text files in UFO are still UTF-8 with BOM, but preferably should not have the BOM mark.
Erwin Denissen
Moderator
Moderator
Posts: 11472
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: More bugs with UFO

Post by Erwin Denissen »

NFSL2001 wrote: Wed May 01, 2024 2:56 pm 1. name ID=1 and 2 are still not exported even when explicitly in Font Properties - Font - Family Name and Instances - General - Style Name.
We don't see any problems here. Please send us a font project to further look into it.
NFSL2001 wrote: Wed May 01, 2024 2:56 pm 2. Generated font files contains platformID=1 platEncID=0 while generated UFO files doesn't.
Platform 1 (Macintosh) is excluded by default. Did you uncheck the Exclude legacy data setting on the Font tab?
ExcludeLegacy.png
ExcludeLegacy.png (50.05 KiB) Viewed 2493 times
NFSL2001 wrote: Wed May 01, 2024 2:56 pm3. The features.fea file might sometimes contains glyph names that are over 63 characters long. E.g. name: `katakanasmallhu_katakanahiraganasemivoicedsoundmarkcomb-kana.ccmp.1` is 65 characters long. This is auto-generated name by FontCreator.
We try to follow the syntax as described in the Adobe OpenType Feature File Specification:
https://adobe-type-tools.github.io/afdk ... ation.html

But we did not comply to one of the glyph name restrictions, being:

A glyph name may be up to 63 characters in length

Please send us a font project with this issue, so we can try to fix it.
NFSL2001 wrote: Wed May 01, 2024 2:56 pm4. [new] Generated @BASE and @MARK class definition are written as @\BASE and @\MARK, causing parsing failure.
We think we it is correct to use a backslash after the ampersand, like @/nameofglyphclass, but we feel the specification is unclear about it:
2.g.ii. Named glyph classes
A glyph class can be named by assigning it to a glyph class name, which begins with the “@” character, and then referred to later on by the glyph class name.

The part of the glyph class name after the “@” is subject to the same name restrictions that apply to a production glyph name except that hyphens are also allowed.

An initial backslash serves to differentiate a glyph name from an identical keyword in the feature file language.
NFSL2001 wrote: Wed May 01, 2024 2:56 pm Also text files in UFO are still UTF-8 with BOM, but preferably should not have the BOM mark.
We actually prefer a BOM, is there some formal statement that explains to avoid it?
Erwin Denissen
High-Logic
Proven Font Technology
NFSL2001
Posts: 9
Joined: Sun Jul 17, 2022 3:51 pm

Re: More bugs with UFO

Post by NFSL2001 »

1. name ID=1 and 2 are still not exported even when explicitly in Font Properties - Font - Family Name and Instances - General - Style Name.
Sorry I was unclear on this one: localised names in UFO are missing ID=1 and 2. In the attached UFO (zipped) file, you can see there is only name ID=16 but no ID=1, but the binary font file has ID=1 and no ID=16.

Platform 1 (Macintosh) is excluded by default. Did you uncheck the Exclude legacy data setting on the Font tab?
Sorry, this is on me.
The features.fea file might sometimes contains glyph names that are over 63 characters long
The glyphs and combined glyph which had the 65 characters name are in the FCP file for reference. I have removed all custom names in the TTF, and opening it in FontCreator still autocompletes the long name. The name is in the UFO fea file too.
We think we it is correct to use a backslash after the ampersand, like @/nameofglyphclass, but we feel the specification is unclear about it:
The specification only specified the restrictions are the same, it do not explicitly say class names after the @ can follow the glyph name specification:
The part of the glyph class name after the “@” is subject to the same name restrictions that apply to a production glyph name except that hyphens are also allowed.
which in this case I don't think the backslash is allowed in class names; the specification only allows glyph names to have backslash.

Also even if backslash is allowed, the GDEF fea is not using the backslash making it unable to be matched.

Code: Select all

@\BASE = [A Aacute Acircumflex Agrave Amacron];
@\MARK = [gravecomb acutecomb u0302 u030C u0304];

table GDEF {
    GlyphClassDef @BASE,, @MARK,;
} GDEF;
I would say to use class names without backslash (@BASE, @MARK) as AFDKO makeotf and fonttools raise errors in parsing this feature syntax.
We actually prefer a BOM, is there some formal statement that explains to avoid it?
Not in the UFO spec (file names has to be UTF-8 but not the contents). However, Unicode does not recommend using BOM in UTF-8.
https://www.unicode.org/versions/Unicode15.0.0/ch02.pdf
Use of a BOM is neither required nor recommended for UTF-8, but
may be encountered in contexts where UTF-8 data is converted from other encoding forms
that use a BOM or where the BOM is used as a UTF-8 signature. See the “Byte Order
Mark” subsection in Section 23.8, Specials, for more information.
Currently FontTools breaks when parsing features.fea file.
Attachments
MyFont-Regular.ufo.zip
(81.73 KiB) Downloaded 128 times
MyFont-Regular-customnamesremoved.ttf
(8.3 KiB) Downloaded 115 times
My Font.fcp
(7.9 KiB) Downloaded 104 times
Erwin Denissen
Moderator
Moderator
Posts: 11472
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: More bugs with UFO

Post by Erwin Denissen »

NFSL2001 wrote: Wed May 15, 2024 1:02 pm
1. name ID=1 and 2 are still not exported even when explicitly in Font Properties - Font - Family Name and Instances - General - Style Name.
Sorry I was unclear on this one: localised names in UFO are missing ID=1 and 2. In the attached UFO (zipped) file, you can see there is only name ID=16 but no ID=1, but the binary font file has ID=1 and no ID=16.
They are generated on exporting as Web or Desktop font, but they are not automatically generated on exporting as UFO. So you need to provide both StyleMapFamily and StyleMapFamily.
NFSL2001 wrote: Wed May 15, 2024 1:02 pm
The features.fea file might sometimes contains glyph names that are over 63 characters long
The glyphs and combined glyph which had the 65 characters name are in the FCP file for reference. I have removed all custom names in the TTF, and opening it in FontCreator still autocompletes the long name. The name is in the UFO fea file too.
In a next update we will shorten the glyph names that are too long.
NFSL2001 wrote: Wed May 15, 2024 1:02 pm
We think we it is correct to use a backslash after the ampersand, like @/nameofglyphclass, but we feel the specification is unclear about it:
The specification only specified the restrictions are the same, it do not explicitly say class names after the @ can follow the glyph name specification:
The part of the glyph class name after the “@” is subject to the same name restrictions that apply to a production glyph name except that hyphens are also allowed.
which in this case I don't think the backslash is allowed in class names; the specification only allows glyph names to have backslash.

Also even if backslash is allowed, the GDEF fea is not using the backslash making it unable to be matched.

Code: Select all

@\BASE = [A Aacute Acircumflex Agrave Amacron];
@\MARK = [gravecomb acutecomb u0302 u030C u0304];

table GDEF {
    GlyphClassDef @BASE,, @MARK,;
} GDEF;
I would say to use class names without backslash (@BASE, @MARK) as AFDKO makeotf and fonttools raise errors in parsing this feature syntax.
Consider it done.
NFSL2001 wrote: Wed May 15, 2024 1:02 pm
We actually prefer a BOM, is there some formal statement that explains to avoid it?
Not in the UFO spec (file names has to be UTF-8 but not the contents). However, Unicode does not recommend using BOM in UTF-8.
https://www.unicode.org/versions/Unicode15.0.0/ch02.pdf
Use of a BOM is neither required nor recommended for UTF-8, but
may be encountered in contexts where UTF-8 data is converted from other encoding forms
that use a BOM or where the BOM is used as a UTF-8 signature. See the “Byte Order
Mark” subsection in Section 23.8, Specials, for more information.
Currently FontTools breaks when parsing features.fea file.
We will stop adding a BOM.
Erwin Denissen
High-Logic
Proven Font Technology
Erwin Denissen
Moderator
Moderator
Posts: 11472
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: More bugs with UFO

Post by Erwin Denissen »

This release solves the issues.

https://www.high-logic.com/tmp/fontcrea ... 82-x64.exe

Please let us know your results.
Erwin Denissen
High-Logic
Proven Font Technology
NFSL2001
Posts: 9
Joined: Sun Jul 17, 2022 3:51 pm

Re: More bugs with UFO

Post by NFSL2001 »

Thanks, most seem to be resolved.
They are generated on exporting as Web or Desktop font, but they are not automatically generated on exporting as UFO. So you need to provide both StyleMapFamily and StyleMapFamily.
I believe you meant StyleMapFamilyName and StyleMapStyleName in Font Properties - Instances.

I would like to ask what does Font Properties - Font - Family Name does in this case if it doesn't provide the nameID=1.
Erwin Denissen
Moderator
Moderator
Posts: 11472
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Re: More bugs with UFO

Post by Erwin Denissen »

NFSL2001 wrote: Wed May 22, 2024 3:45 pm I believe you meant StyleMapFamilyName and StyleMapStyleName in Font Properties - Instances.
Yes, I meant those two names.
NFSL2001 wrote: Wed May 22, 2024 3:45 pm I would like to ask what does Font Properties - Font - Family Name does in this case if it doesn't provide the nameID=1.
Then it might be used to generate Full Font Name and Unique Font Identifier.
Erwin Denissen
High-Logic
Proven Font Technology
Post Reply