Circled numerals from 10 to 99: how to sort them? Do they have a unicode?

Hello everyone!

I’m working on a font and one of the requirement for it is to have circled numerals from 1 to 99. From one to nine, things are fine. But It’s getting messy from 10 to 99 since they don’t sort themselves automatically and they don’t have any unicode.

Anyone has an idea how to fix that?

Thanks a lot,

Arthur

How exactly did you name those numbers?

eighty-eight.circled
eighty-five.circled
eighty-four.circled
eighty-nine.circled
eighty-one.circled
eighty-seven.circled
eighty-six.circled
eighty-three.circled
eighty-two.circled
eighty.circled
and so on…

Consider using two glyph sets for opening and closing circle parts:

That way you need 10 single, 10 left half and 10 right half = 30 glyphs instead of 100 glyphs.

2 Likes

Oh that sounds smart ! And what about the unicode and the naming of the glyphs?

Here is a demo font with the digits 1–4 (sorry for the wonky glyphs, drawn quickly without much attention on aesthetics): Circled Numbers.glyphs (7.4 KB)

The setup is as follows:

  • Create normal digits, encircled digits, left and right half digits. I also made _part components for the smaller digits since they get reused three times each:
  • Add a Prefix in FileFont InfoFeatures with the digit classes and two lookups that replace normal digits by the left and right half digits:
  • Lastly, add a feature. I used ss01:

Now, when the ss01 feature is active, typing numbers looks like this:

Demo

6 Likes

That looks amazing, thanks a lot! I’ll try this way :slight_smile:

Use underscored instead of hyphens. Then the sortName will be set properly.

1 Like

Thanks again @FlorianPircher , it works great unfortunately, my client does not want them like that. He prefers to have individuals glyphs for each of them.
@GeorgSeifert I used underscores instead of hyphens but still they don’t get sorted. Anything else I need to do in order to order them?

You can build the combined glyphs from the half-glyphs:

Go to Font View (the first tab), choose GlyphAdd Glyphs… (⇧⌘G) and enter the following list of glyph recipes:

zero.left+zero.right=zero_zero.circled
zero.left+one.right=zero_one.circled
zero.left+two.right=zero_two.circled
zero.left+three.right=zero_three.circled
zero.left+four.right=zero_four.circled
zero.left+five.right=zero_five.circled
zero.left+six.right=zero_six.circled
zero.left+seven.right=zero_seven.circled
zero.left+eight.right=zero_eight.circled
zero.left+nine.right=zero_nine.circled
one.left+zero.right=one_zero.circled
one.left+one.right=one_one.circled
one.left+two.right=one_two.circled
one.left+three.right=one_three.circled
one.left+four.right=one_four.circled
one.left+five.right=one_five.circled
one.left+six.right=one_six.circled
one.left+seven.right=one_seven.circled
one.left+eight.right=one_eight.circled
one.left+nine.right=one_nine.circled
two.left+zero.right=two_zero.circled
two.left+one.right=two_one.circled
two.left+two.right=two_two.circled
two.left+three.right=two_three.circled
two.left+four.right=two_four.circled
two.left+five.right=two_five.circled
two.left+six.right=two_six.circled
two.left+seven.right=two_seven.circled
two.left+eight.right=two_eight.circled
two.left+nine.right=two_nine.circled
three.left+zero.right=three_zero.circled
three.left+one.right=three_one.circled
three.left+two.right=three_two.circled
three.left+three.right=three_three.circled
three.left+four.right=three_four.circled
three.left+five.right=three_five.circled
three.left+six.right=three_six.circled
three.left+seven.right=three_seven.circled
three.left+eight.right=three_eight.circled
three.left+nine.right=three_nine.circled
four.left+zero.right=four_zero.circled
four.left+one.right=four_one.circled
four.left+two.right=four_two.circled
four.left+three.right=four_three.circled
four.left+four.right=four_four.circled
four.left+five.right=four_five.circled
four.left+six.right=four_six.circled
four.left+seven.right=four_seven.circled
four.left+eight.right=four_eight.circled
four.left+nine.right=four_nine.circled
five.left+zero.right=five_zero.circled
five.left+one.right=five_one.circled
five.left+two.right=five_two.circled
five.left+three.right=five_three.circled
five.left+four.right=five_four.circled
five.left+five.right=five_five.circled
five.left+six.right=five_six.circled
five.left+seven.right=five_seven.circled
five.left+eight.right=five_eight.circled
five.left+nine.right=five_nine.circled
six.left+zero.right=six_zero.circled
six.left+one.right=six_one.circled
six.left+two.right=six_two.circled
six.left+three.right=six_three.circled
six.left+four.right=six_four.circled
six.left+five.right=six_five.circled
six.left+six.right=six_six.circled
six.left+seven.right=six_seven.circled
six.left+eight.right=six_eight.circled
six.left+nine.right=six_nine.circled
seven.left+zero.right=seven_zero.circled
seven.left+one.right=seven_one.circled
seven.left+two.right=seven_two.circled
seven.left+three.right=seven_three.circled
seven.left+four.right=seven_four.circled
seven.left+five.right=seven_five.circled
seven.left+six.right=seven_six.circled
seven.left+seven.right=seven_seven.circled
seven.left+eight.right=seven_eight.circled
seven.left+nine.right=seven_nine.circled
eight.left+zero.right=eight_zero.circled
eight.left+one.right=eight_one.circled
eight.left+two.right=eight_two.circled
eight.left+three.right=eight_three.circled
eight.left+four.right=eight_four.circled
eight.left+five.right=eight_five.circled
eight.left+six.right=eight_six.circled
eight.left+seven.right=eight_seven.circled
eight.left+eight.right=eight_eight.circled
eight.left+nine.right=eight_nine.circled
nine.left+zero.right=nine_zero.circled
nine.left+one.right=nine_one.circled
nine.left+two.right=nine_two.circled
nine.left+three.right=nine_three.circled
nine.left+four.right=nine_four.circled
nine.left+five.right=nine_five.circled
nine.left+six.right=nine_six.circled
nine.left+seven.right=nine_seven.circled
nine.left+eight.right=nine_eight.circled
nine.left+nine.right=nine_nine.circled

In Font View, all new glyphs should be selected. If they are not, select them. Open the Macro Panel (WindowMacro Panel, ⌥⌘M) and run the following code to active automatic alignment for all components in the selected glyphs:

for layer in Font.selectedLayers:
	for component in layer.components:
		component.automaticAlignment = True
1 Like

Unicode has code points for circled numbers 1 through 50:
1…20: U+2460…U+2473
21…35: U+3251…U+325F
36…50: U+32B1…U+32BF

Using the above method will apply the Unicode values to those glyphs that have one.

1 Like