More bugs with UFO

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

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: 11195
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 219 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: 7
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) Not downloaded yet
MyFont-Regular-customnamesremoved.ttf
(8.3 KiB) Not downloaded yet
My Font.fcp
(7.9 KiB) Not downloaded yet
Post Reply