Questions about GlyphData.xml

Hi,

I’m editing my own GlyphData.xml, and I need some help.

1. ‘predicate’ in GlyphData.xml
I can not find any help about ‘predicate’.
a. I want to mix ‘AND’ and ‘OR’.
b. is it possible to set predicate to a group with subgroups’ names?

2. multiple code mapping
I want to set multiple code mapping to a glyph. Isn’t it impossible in GlyphData.xml?
if it’s not impossible how can I do it? do I have to map it manually?

please let me know about it.
Thanks in advance!

What do you mean by predicate in GlyphData? Maybe you mean CustomFilter.plist?

You can add a unicode2 entry. It works for GlyphData files next to the .glyphs file. I fixed the import for files that are in the “Info” folder.

I really appreciate your reply.

Yes, it was my mistake! I’m sorry about it. It is custom Groups.plist.

1. ‘predicate’ in Groups.plist
I found ‘predicate’ in defaultCategories.plist and defaultLanguages.plist in /Applications/Glyphs.app/Contents/Frameworks/GlyphsCore.framework/Versions/A/Resources.

In the files, I found these phrases and I adopted it to my Groups.plist.

predicate = “subCategory == “Uppercase” AND category == “Letter””;
predicate = “script in {“bengali”, “devanagari”, “gujarati”, “gurmukhi”, “kannada”, “malayalam”, “oriya”, “tamil”}”;

my adoption is like below.

predicate = “script == “hangul” AND category in {“Letter”, “Mark”}”;

It really works.

  • But I don’t know how to mix ‘AND’, ‘OR’, etc.
  • And is it possible to define predicate with subgroups’ names? If so, how can I do it?

2. multiple code mapping

  • if there are more codes than two, is it possible to define unicode2, unicode3, unicode4…?
  • does it also work with custom GlyphData.xml in Library/Application Support/Glyphs/Info (not with .glyphs file)?

Thanks!

You might find some help on this page: https://nshipster.com/nspredicate/

And there is only unicode2 right now. What glyphs need more then that?

It will be so helpful!

ksHanja.xls.zip (11.6 KB)

attached is the multi-mapping codes for Korean Han Ideograph(or Chinese characters used in Korea). I don’t know whether the codes are the same in Japanese or in Chinese. It can be different in Japanese or Chinese.
I’m making template Groups.plist for Korean standard code set and there are more codes multiple mapped.

Thanks,

I just had a look at some of the triple codes. But the fonts I have, have quite different shapes. So double encoding them might lead to confusion, doesn’t it?

But I see the point and will add more possible unicodes to GlyphData.

That’s a good news and I appreciate your support!

The mappings in the ksHanja file are for code points in the CJK Compatibility Ideographs block of the Unicode Standard. These are characters that are encoded multiple times in Unicode to enable round-trip conversion to older character encodings. The Unicode Standard treats them as canonically equivalent to the corresponding code points in the Unified Ideographs blocks – see the UnicodeData.txt file. Different shapes for these code points therefore would be wrong. Which fonts were you looking at?

Since the equivalences are part of the Unicode Standard, Glyphs might actually offer to include them automatically.

This is the font I’m looking at.

https://github.com/adobe-type-tools/Adobe-KR/releases/download/20180719/SourceHanSerifAKR9-Bold.otf

Thanks,

Sorry for being unclear, by “you” I meant Georg, who said “the fonts I have, have quite different shapes”.

SourceHanSerifAKR9-Bold.otf maps, for example, 0x6a02, 0xf914, 0xf95c, 0xf9bf all to the same glyph, cid16117, which is what I’d expect.

I was checking the code points in Unicode checker. I might have seen a fallback font but for some I saw three different shapes.

I checked for the largest set, 0x6a02, 0xf914, 0xf95c, and 0xf9bf, and indeed Apple Gothic and MingLiu use slightly different styles for the four code points. They still clearly show the same character though.