This just does not make sense. I removed sortName (because you have yet to actual clarify how it affects sorting), they all have same script, same category, but different subCategory.
Suspiciously dvKa, with the lowest unicode, comes as the first of all Foobar glyphs, not dvBa as one might expect looking at the GlyphData. And then dvK coming after dvKa and not dvKha just…
It might be that the internal glyph data is interfering. Because for some attributes, the local one is just amending the existing entries. So you should run this script to know what is actually used:
for l in Font.selectedLayers:
g = l.parent
print(g.name, g.sortName(), g.subCategory)
Could you send me your .glyphs and GlyphData file? And what sorting are you trying to achieve (Ka K Kha Kh or Ka Kha K Kh)
So sortName > Category? What about subCategory, name, script?!
Also note that the GlyphData.xml I sent you and used here does not have sortNames… so it seems GlyphApp uses sortName from the App folder, and if glyphs are sorted and their subcategory varies they break to new lines? So I cannot actually use the subCategory to sort like I want, but need to explicitly overwrite each sortName?!
Can you PLEASE just state what is the full sorting logic.
I had a look last night and the sorting is strange. Need to look into this more. I don’t think it is the fault of the GlyphData. Because it did sort correct when I removed all other glyphs.
I use a custom glyphData as well. If that can help:
custom categories can be sorted by appending a number in front of their name, eg: 01 Caps
each glyph in the glyphData has a sortName that is a number. To avoid large reordering when updating the glyphData, the number is like xx_xxx where the first two are the category number and the last three the number inside that category.
I haven’t had weird results with glyph sorting since I’ve been using this system. Of course you should make a script to help with actually writing the xml file because that is tedious by hand.