.ss0x and print()

Hello!
I have a var like this characters_2nd = 'AÁĂÂÄÀĀ' and print() it into a new tab in Glyphs.
I can’t find how to insert several custom glyphname.something into my sequence to get them correctly displayed.

Any help from code masters please? :confused:

How do you print() into the edit view?

text = "A"
glyph = Font.glyphs["A.ss01"]
text += chr(Font.characterForGlyph(glyph))
Font.currentTab.text = text

thank you,
but if I have tens of them to add?

I need to run this

characters_1st = '◆■‣•'
characters_2nd = 'AÁĂÂÄÀĀĄÅÃÆCĆČÇĈDĎĐÐJ/J.ss02 J́/Jacute.ss02 Ĵ/Jcircumflex.ss02 KĶLĹĽĻŁOÓŎÔÖỌÒŐŌǪØǾÕTŤȚWẂŴẀYÝŶŸỲZŹŽŻkķŕřŗtŧťţțvwẃŵẅẁxy/y.ss04 ý/yacute.ss04 ŷ/ycircumflex.ss04 ÿ/ydieresis.ss04 ỳ/ygrave.ss04 ȳ/ymacron.ss04 ỹ/ytilde.ss04 zźžż'
string = '\n'.join([c1 + c2+ c1 for c1 in characters_1st for c2 in characters_2nd])
print(string)
Glyphs.font.currentTab.text = string

in brief I have 2 groups and need to obtain all the combinations of them

What issue are you having? the code you posted should work as long as you have a tab open and the relevant glyphs in your font. you can use newTab instead of currentTab if you would prefer a new tab

You need to split the character string a bit more carefully. The easiest would be to use a list of Glyph names instead of a string.

font = Glyphs.font
names_1st = ["blackDiamond", "blackSquare", "triangularbullet", "bullet"]
names_2nd = ["A", "Aacute", "Abreve", "Acircumflex", "Adieresis", "Agrave", "Amacron", "Aogonek", "Aring", "Atilde", "AE", "C", "Cacute", "Ccaron", "Ccedilla", "Ccircumflex", "D", "Dcaron", "Dcroat", "Eth", "J", "J.ss02 ", "J", "acutecomb", "Jacute.ss02 Ĵ", "Jcircumflex.ss02 ", "K", "Kcommaaccent", "L", "Lacute", "Lcaron", "Lcommaaccent", "Lslash", "O", "Oacute", "Obreve", "Ocircumflex", "Odieresis", "Odotbelow", "Ograve", "Ohungarumlaut", "Omacron", "Oogonek", "Oslash", "Oslashacute", "Otilde", "T", "Tcaron", "Tcommaaccent", "W", "Wacute", "Wcircumflex", "Wgrave", "Y", "Yacute", "Ycircumflex", "Ydieresis", "Ygrave", "Z", "Zacute", "Zcaron", "Zdotaccent", "k", "kcommaaccent", "racute", "rcaron", "rcommaaccent", "t", "tbar", "tcaron", "tcedilla", "tcommaaccent", "v", "w", "wacute", "wcircumflex", "wdieresis", "wgrave", "x", "y", "y.ss04 ", "yacute", "yacute.ss04 ", "ycircumflex", "ycircumflex.ss04 ", "ydieresis", "ydieresis.ss04 ", "ygrave", "ygrave.ss04 ", "ymacron", "ymacron.ss04 ", "ytilde", "ytilde.ss04 ", "z", "zacute", "zcaron", "zdotaccent"]
pairs = []
for name1 in names_1st:
    glyph1 = font.glyphs[name1]
    if not glyph1:
        continue
    char1 = font.characterForGlyph(glyph1)
    for name2 in names_2nd:
        glyph2 = font.glyphs[name2]
        if not glyph2:
            continue
        char2 = font.characterForGlyph(glyph2)
        pairs.append(chr(char1) + chr(char2) + chr(char1))
string = '\n'.join(pairs)
print(string)
font.currentTab.text = string