Erich Heinzle
2014-09-14 15:29:50 UTC
I have batch processed the gnu unifont bdf
http://unifoundry.com/pub/unifont-7.0.03/font-builds/unifont-7.0.03.bdf.gz
available from
http://unifoundry.com/unifont.html
to produce around 20,000 chinese, japanese and korean (CJK) symbols that
can be used in gEDA PCB.
the uncompressed text file weighs in at around 20MB, but compressed is only
1.5MB
http://users.on.net/~esh/geda/pcb/src/fonts/fireflyR16-CJK-glyphs.pcb.gz
Users requiring a few glyphs can now include them and map them to spare
ascii symbols until there is a way to more easily include unicode symbols,
i.e.
Symbol['6' 1200]
#gEDA PCB compatible symbol with drawn elements depicting uni9ED6
#Symbol['uni9ED6' 1200]
( etc...
)
The symbols are based on the open 16x16 bitmapped firefly CJK font set and
have had contiguous pixels vertically, horizontally and diagonally
converted into SymbolLine[] strokes, and orphan pixels if any, are rendered
as a dot. A default stroke width of 800 has been used.
The smaller 11x11, 12x12 13x13, 14x14, 15x15 bitmapped CJK glyphs also
could be easily converted if necessary, but they may lack the fidelity of
the 16x16 glyphs which can be scaled anyway within PCB, so I have not
bothered to convert the lower resolution bitmaps at this stage.
I will release the the conversion utility shortly once I finish tidying it
up as GPL2+/-3.
I expected to walk away from the computer for at least a few minutes to
convert the 20,000+ CJK bdf archive but it was done in seconds, meaning
that on the fly importing of single CJK glyph bdf definitions from the
freely downloadable gnu unifont bdf could in theory be done from within PCB
if a suitable menu option were available.
I hope this is useful to anyone desperately in need of some functional CJK
glyphs before gEDA PCB supports either an integrated conversion process
like this or TTF support.
I cannot vouch for the rendering of all of the glyphs, as I do not read
Chinese, haven't had the chance to review them all, and the heuristics may
have joined the occasional diagonally adjacent pixels which should remain
unjoined.
The symbol archive is released under GPL2 or at your option, a later
version, and can be freely distributed.
I would make the observation that this approach to glyph rendering makes
for quite a compact symbol definition. My initial efforts involving
conversion of curved paths produced symbol definitions 3-4 times the
overall size, with implications for final PCB file size. It would be
interesting to see how much bigger or smaller gerbers might end up being if
text is rendered as polygons derived from TTF fonts.
If/when unicode support is implemented, I think it would be a useful
feature if users could retain the ability to use a traditional default_font
style font for the ASCII character code page, and a separate unicode font
for the other code pages, since available CJK containing fonts may not have
ASCII code page fonts ideally suited to rendering with strokes, whereas the
existing gEDA PCB ASCII fonts are pretty optimal, compact and gerber
friendly.
Cheers,
Erich.
http://unifoundry.com/pub/unifont-7.0.03/font-builds/unifont-7.0.03.bdf.gz
available from
http://unifoundry.com/unifont.html
to produce around 20,000 chinese, japanese and korean (CJK) symbols that
can be used in gEDA PCB.
the uncompressed text file weighs in at around 20MB, but compressed is only
1.5MB
http://users.on.net/~esh/geda/pcb/src/fonts/fireflyR16-CJK-glyphs.pcb.gz
Users requiring a few glyphs can now include them and map them to spare
ascii symbols until there is a way to more easily include unicode symbols,
i.e.
Symbol['6' 1200]
#gEDA PCB compatible symbol with drawn elements depicting uni9ED6
#Symbol['uni9ED6' 1200]
( etc...
)
The symbols are based on the open 16x16 bitmapped firefly CJK font set and
have had contiguous pixels vertically, horizontally and diagonally
converted into SymbolLine[] strokes, and orphan pixels if any, are rendered
as a dot. A default stroke width of 800 has been used.
The smaller 11x11, 12x12 13x13, 14x14, 15x15 bitmapped CJK glyphs also
could be easily converted if necessary, but they may lack the fidelity of
the 16x16 glyphs which can be scaled anyway within PCB, so I have not
bothered to convert the lower resolution bitmaps at this stage.
I will release the the conversion utility shortly once I finish tidying it
up as GPL2+/-3.
I expected to walk away from the computer for at least a few minutes to
convert the 20,000+ CJK bdf archive but it was done in seconds, meaning
that on the fly importing of single CJK glyph bdf definitions from the
freely downloadable gnu unifont bdf could in theory be done from within PCB
if a suitable menu option were available.
I hope this is useful to anyone desperately in need of some functional CJK
glyphs before gEDA PCB supports either an integrated conversion process
like this or TTF support.
I cannot vouch for the rendering of all of the glyphs, as I do not read
Chinese, haven't had the chance to review them all, and the heuristics may
have joined the occasional diagonally adjacent pixels which should remain
unjoined.
The symbol archive is released under GPL2 or at your option, a later
version, and can be freely distributed.
I would make the observation that this approach to glyph rendering makes
for quite a compact symbol definition. My initial efforts involving
conversion of curved paths produced symbol definitions 3-4 times the
overall size, with implications for final PCB file size. It would be
interesting to see how much bigger or smaller gerbers might end up being if
text is rendered as polygons derived from TTF fonts.
If/when unicode support is implemented, I think it would be a useful
feature if users could retain the ability to use a traditional default_font
style font for the ASCII character code page, and a separate unicode font
for the other code pages, since available CJK containing fonts may not have
ASCII code page fonts ideally suited to rendering with strokes, whereas the
existing gEDA PCB ASCII fonts are pretty optimal, compact and gerber
friendly.
Cheers,
Erich.