Circled numerals feature

So, from my old FL files, I have:
zero.closecirc_init
zero.closecirc_medi
zero.closecirc_fina

plus

zero.opencirc_init
zero.opencirc_medi
zero.opencirc_fina

dlig:
(1) becomes number one in open circle
(12) becomes twelve in open circle
and
[1] become number one on black circle

  1. is naming right?
  2. will Glyphs recognize those features
    or I have to copy paste them from my old FL files?
  1. Personally I would avoid the underscore, because I like to reserve it for ligatures (and thus avoid triggering an auto-generated feature). So, I’d go with something like .circleOpenInit, but in this case, I suppose it will not be a problem, unless you have a glyph called medi or init.

  2. In this case, there is no way Glyphs can guess what you want. So you will have to add the feature code manually, I am afraid. Raise your hand if you need help.

  1. will rename it

  2. \o

1 Like

Assuming OT class @num contains your figures zero through nine, and @numCircleXXXX contains zero.xxx through nine.xxx, in its different forms, put this in your dlig:

sub parenleft @num parenright by @numCircleIsol; # (1) sub parenleft' @num' @num by @numCircleInit; # (1… sub [@numCircleInit @numCircleMedi] @num' by @numCircleMedi; #…1… sub @numCircleMedi parenright by @numCircleFina; # …1)

Edit: The code is wrong. see below for explanation.

I didn’t test it now, but it should work without putting it in different lookups, but perhaps the last line still needs to go between something like this: lookup CIRCLEFINA { … } CIRCLEFINA;

Do the same for bracketleft and bracketright, this time with the other numerals.

1 Like

Thnx, but it is slightly more complex, I’ll contact you directly.

Hello,
I found this thread very useful as I am attempting something similar.
I want to create a feature with numerals inside a circle, 0—99 only.
Since I only need two digits, should I still be using the Init, Medi, Fina logic?
Any help is appreciated!

I’ve already got my classes set up as follows:

num (numerals, zero to nine)
numCircleIsol (zero.isol, ecc.)
numCircleInit (zero.circle, ecc.)
numCircleMedi (zero.medi, ecc.)
numCircleFina (zero.fina, ecc.)

Since they can be either single or double digit, you will not need medi. But you will need init, fina and isol.

Hi,
I tried this feature but it doesn’t work, I have an MakeOTF error saying “invalid ligature” on each line.
I attached a screenshot: I have 5 classes ( @num, @OpenCircleIsol , @OpenCircleInit, @OpenCircleMedi and @OpenCircleFina) of 10 digits each.
Did I missed something somewhere?
Cheers,
T

  1. You cannot ligate a group with something else to another group. My code above was wrong. You will have to split up the group ligatures to lines for individual glyphs, or use contextual one-to-one subs for groups.
  2. Watch our for the contextual tick mark, should be ' and not the smart quote

Hi Rainer,
Oh yes, the smart quotes!
Anyway, with dumb quotes I still can’t figure how to make it work. Will try again tomorrow and keep you posted.

Ok, now it works with a lookup.
I prefered to keep the parenleft and parenright to activate the circled numerals, then replace it with zeroWidthNoBreakSpace.

sub parenleft @num' parenright by @Isolated;

sub parenleft @num' by @Initial;

lookup MEDIAL {

    sub @num by @Medial;

} MEDIAL;

sub @Medial' parenright by @Final;

sub parenleft by zeroWidthNoBreakSpace;

sub parenright by zeroWidthNoBreakSpace;
1 Like

Did you find any other solution that does not replace parenleft/parenright with zeroWidthNoBreakSpace?

For example like this:

@figures = [one two three four five six seven eight nine zero]
@figuresINIT = [one.circled.init two.circled.init three.circled.init four.circled.init five.circled.init six.circled.init seven.circled.init eight.circled.init nine.circled.init zero.circled.init];
@figuresMEDI = [one.circled.medi two.circled.medi three.circled.medi four.circled.medi five.circled.medi six.circled.medi seven.circled.medi eight.circled.medi nine.circled.medi zero.circled.medi];

lookup init {
	sub parenleft' one' @figures by one.circled.init;
	sub parenleft' two' @figures by two.circled.init;
	sub parenleft' three' @figures by three.circled.init;
	sub parenleft' four' @figures by four.circled.init;
	sub parenleft' five' @figures by five.circled.init;
	sub parenleft' six' @figures by six.circled.init;
	sub parenleft' seven' @figures by seven.circled.init;
	sub parenleft' eight' @figures by eight.circled.init;
	sub parenleft' nine' @figures by nine.circled.init;
	sub parenleft' zero' @figures by zero.circled.init;
} init;

lookup medi1 {
	sub @figuresINIT @figures' by @figuresMEDI;
} medi1;

lookup medi2 {
	sub @figuresMEDI @figures' by @figuresMEDI;
} medi2;

lookup fina {
	sub one.circled.medi parenright by one.circled.fina;
	sub two.circled.medi parenright by two.circled.fina;
	sub three.circled.medi parenright by three.circled.fina;
	sub four.circled.medi parenright by four.circled.fina;
	sub five.circled.medi parenright by five.circled.fina;
	sub six.circled.medi parenright by six.circled.fina;
	sub seven.circled.medi parenright by seven.circled.fina;
	sub eight.circled.medi parenright by eight.circled.fina;
	sub nine.circled.medi parenright by nine.circled.fina;
	sub zero.circled.medi parenright by zero.circled.fina;
} fina;

You probably do not need to differentiate between medi1 and medi2, and can probably merge them into a single lookup.

3 Likes

That’s amazing, thanks a lot!

1 Like