Using Combining Sequences for Numbers

Fonts Unicode

Circled number fifty

Today I just happened to be looking through some of the precomposed Unicode circled numbers, numbers like ①, ②, ③, and so on. Just in case your system, doesn’t support the fonts for these characters, here’s an image that shows what I mean:

Precomp circled numbers

I wasn’t all that surprised to see these CIRCLED DIGIT ZERO, CIRCLED DIGIT ONE, CIRCLED DIGIT TWO, through CIRCLED DIGIT NINE characters. However, I was surprised to see precomposed characters for other numbers, numbers all the way up to 50:

Circled number fifty CIRCLED NUMBER FIFTY

Why stop at 50? Well, obviously Unicode can’t encode every number. Although Unicode doesn’t define a CIRCLED NUMBER FIFTY ONE, how can I create this using combining sequences? For example, for the above single digits, I have a couple options for displaying these:

  1. a precomposed character like U+2460 — ①
  2. a combining sequence like U+0031 U+20DD —   1⃝  the digit 1 followed by the COMBINING ENCLOSING CIRCLE character     ⃝

Again, if you can’t see that character sequence, here’s the image of U+0031 U+20DD:

Combining one

 

Alright, so there we have a great example of using two Unicode code points together to form a single visual glyph on-screen. But how do I get the COMBINING ENCLOSING CIRCLE character to combine over two previous digits? What if there were not a precomposed CIRCLED NUMBER FIFTY ONE? There’s isn’t one, by the way. And yet I want to enclose two or more arbitrary digits with the COMBINING ENCLOSING CIRCLE character. Hmmm….

Sigh…. I have to admit that I don’t actually know how to do this. I suspect that I can use some of Unicode’s control characters like START OF GUARDED AREA and END OF GUARDED AREA or …. I don’t really know.

When I find out, I’ll repost. If you know, please share!

1 thought on “Using Combining Sequences for Numbers

  1. I was able to create the CIRCLED DIGITS 51 – 99 with COMBINING ENCLOSING CIRCLE.

    You were on the right track with GUARDED AREA:
    START OF GUARDED AREA U+0096 and END OF GUARDED AREA U+0097
    Enclosing the characters with the start and end controls followed by the circle does the trick:
    U+0096 51 U+0097 U+20DD produces –51—⃝

    In exactly the same way SELECTED AREA seems to also work:
    START OF SELECTED AREA U+0086 and END OF SELECTED AREA U+0087
    U+0086 51 U+0087 U+20DD produces †51‡⃝

    Another way to accomplish the same is using the SINGLE SHIFT controls:
    SINGLE SHIFT TWO U+008E
    By preceding the circle with the single shift.
    51 U+0087 U+20DD produces 51Ž⃝

    Unfortunately it is not perfect, the 1st character is rather cramped, I also tried using ENCLOSING KEYCAP but it has the same effect.
    COMBINING ENCLOSING KEYCAP U+20E3
    51 U+0087 U+20E3 produces 51Ž⃣

    If using a single character with the above controls it is not centred and uses the standard font:
    0 U+0087 U+20DD produces 0Ž⃝
    0 U+0087 U+20E3 produces 0Ž⃣

    Whereas the combining characters produces something completely different, not any unicode characters either, when used without the control characters.
    0 U+20DD produces 0⃝
    0 U+20E3 produces 0⃣

    I can’t seem to understand why all the different controls produce exactly the same results.

Leave a Reply

Your email address will not be published. Required fields are marked *