Using Custom Font in "text"

Yes, any font with some italic-like letters or which requires junctions between letters will not be rendered correctly in G’MIC. But as @snibgo wrote, this is real hard stuff to implement if we don’t want to rely on external libraries.

Even though some people here seem to be hungry for new text features, I’ll stop here for my part when it comes to text rendering in G’MIC :slight_smile:

I’m pretty sure you could actually create your own text rendering algorithm in the G’MIC scripting language, so do not hesitate to implement things if you think some are missing.

You are right, David.
Still there were often surprising and convincing solutions from your side. gmic wouldn’t be gmic if not.

I think the current solution is fine. I even published a G’MIC script to a (RC Revolt) game modding community which use the recent text feature. While it does feel very limited, it’ll do for now.

Even though yes, this is a old topic, I want to bring a Python code for any one that still thinks about making new features related to text or so:

utf_code=[32,32,8853,8854,8855,8856,8857,8747,8711,32,32,8800,8730,32,9824,9827,9829,9830,8745,8746,8743,8744,8712,32,32,32,32,32,32,32,32,8364,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,32,8734,945,946,8706,948,949,951,947,955,956,969,966,960,968,961,963,964,952,916,931,915,937,934,928,936,920,8592,8593,8594,8595,8596,8597,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]
bs=b''.join(x.to_bytes(2, 'little') for x in utf_code)
text=bs.decode('utf-16')
ind=0
for char in text:
    print(f'{ind}:{char}')
    ind += 1

This will print out all the available text in G’MIC.


Seems like there’s some empty spaces. Any plans to fill up the unused spaces?

Here where they are:

[0, 1, 9, 10, 13, 23, 24, 25, 26, 27, 28, 29, 30, 127]

Maybe more of ligatures? - The Latin alphabet
Maybe more of greeks? - Greek language, alphabets and pronunciation

Other ideas is to extend the numbers of characters beyond 256. To enable even more languages.

Without reading too deeply in the conversation, I would note that certain fonts have actual characters in the character set or type family for oblique/italic letters and ligatures. It would take some work, such as referencing multiple font variants, but one could assign input to those addresses. Then one would not need to simulate them.