How to change the default sorting so that characters are sorted by unicode?

How to change the default sorting so that characters are sorted by unicode?

I think you’ll need to use a glyphOrder parameter (or a list filter).

Go to the font view, view as a list, sort by unicode, copy all glyph names and use them in a glyphOrder parameter or a list filter.

What do you need this for?

Compare two fonts in the window.

G3 prioritizes sorting by glyph name.

I know.

Click here:
image

Then you get a list view of all glyphs. Sort by Unicode like this:
image

1 Like

This makes it impossible to compare shapes.

Did you even read my first suggestion?

I need to sort by unicode under the big picture.

Can you please read my first response?

If this was a task I wanted to do I would copy the second font into the background of the first font. Then I would not have to worry about sorting. Mekkablue’s script “Copy Layer to Layer” is what I would use to do the copying.

If you have other stuff already in the background you don’t want to lose, duplicate the layer so you have a backup of it.

What character ranges you are looking at?

I want to compare the Chinese character outlines of a certain Unicode block in two font files, but the character names in the two files are different and the ordering is also different, so it is very time-consuming to find the same character for comparison.

Is it possible to add a right-click selection sorting method in the font window?

Unicode’s Chinese character blocks often have thousands of Chinese characters, and sorting is very important for the processing of Chinese character fonts.

Name of CJK Ideographs should be start with uniXXXX or uXXXXX (for CJK ext. B~I block).

If not (CID?), try to converts glyph name to nice, human-readable glyph name before comparison.

for this_layer in Glyphs.font.selectedLayers:
	glyph_name = this_layer.parent.name
	if Glyphs.niceGlyphName(glyph_name):
		print(f"{this_layer.parent.name} -> {Glyphs.niceGlyphName(glyph_name)}")
		this_layer.parent.name = Glyphs.niceGlyphName(glyph_name)

Excuse me, where should this code be placed?

You have to first select the glyphs you want to rename and then run this code in your Macro Panel.

1 Like

This really is the last time I’m going to try.

Have you tried the method I described above? Sort by Unicode in both documents and copy that list as a list filter or glyphOrder parameter?

1 Like

You don’t need a script to update the glyph names. First, check Font Info > Other > “Use custom naming” is unchecked. Then select all glyphs in Font View and run Glyph > Update Glyph Info. Do that in both fonts and the names and sorting should be the same in both fonts.

1 Like

… which is also by Unicode in the case of the Chinese ranges.

What exactly do you want to compare? Glyph set? Shapes?