Font Question, non-ASCII characters

I have read the threads on fonts in layout, that there is no native support for custom fonts. I’m trying to place some Korean text on my PCB, and it appears that the built-in font only supports ASCII (e.g., no Unicode support)?. Can someone confirm this, before I try the work-arounds that others have suggested.

Native font supports some Unicode, but far from all of it. For example Greek, Cyrillic glyphs are there.
But Hangul block is not implemented, see:

1 Like

Thanks. Yeah, support for ALL Unicode points would be a whopper of an effort! If this was a bitmapped system, I would offer my help in implementing Hangul. I have quite a bit of experience doing so for video overlay systems. But for vector-drawn fonts, I’d be starting from scratch, I’m afraid.

In case you are contemplating contributing, this font is edited directly in eeschema, no complicated vector/font drawing tools are necessary.

Hmmmmm… I’ll PM you later on.

It’s not as difficult as normal vector fonts (postscript, opentype etc.). If you look closely to letters in KiCad you can see they are straight segments. See Custom Fonts in Kicad?.

I’ll have a look at it. I solved my immediate issue by just hand drawing the few Korean letters that I needed (while grumbling that PcbNew wouldn’t let me place graphic elements on copper).

So with modern Korean text, there’s 11K+ glyphs to draw. But there’s a trick I learned from the world of bitmapped OSD fonts, where you can reduce that to a couple of hundred basic elements. And those hundreds are themselves just variants of 25-some core elements. You then join them programmatically to make the 11K glyphs.

I have all those algorithms, code and font samples from previous projects. So that’s something I could potentially handle. I’d need to manually make a couple hundred core glyphs (variations of 25 basic letters), then run a program to combine them into the 11K different Korean glyphs, which are basically syllables.

This is characteristic which is unique to Korean amongst the CJK fonts. Chinese and Japanese don’t lend themselves to this algorithmic approach so easily. Adding those fonts to KiCad would require a different approach.

2 Likes

So, I’ve looked into this further and it doesn’t seem too difficult. The “standard” process is that glyphs are created in a Schematic library, and then converted into a simplified Hershey font format and stored in the source code.

The process that I’m considering for making the Korean glyphs, it would probably be simpler to generate the Hershey formatted data directly. Is that acceptable? Putting it in .lib format isn’t that much extra work, but I have to sort out all the .lib format details that are unique to the font-conversion awk script.

Thinking aloud, maybe the .lib is better because it is much easier to inspect and tweak without needing extra tools.

Also, just to note, the original Hershey font includes a bunch of Japanese (and Chinese?) characters. They’re already in the correct format, so they could be added as-is to KiCAD with very little effort. Or so it seems at first blush.

I’m not core KiCad dev so it’s not my decision, but if I were to guess they would like to keep the scripts that generate font data from lib files functional. So it’s best to modify lib files.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.