Drawing Korean glyphs

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anyone has experience in this please?

 

The Unicode Hangul character math seems straightforward and there is enough code space to bitmap the 43 glyph's.  Getting the 3 parts into a full word symbol, with the needed scaling might be more difficult.

 

Windows uses codepage 949 (double byte chars), but I can't seem to find a map of the full charset, so I suspect it builds the displayed symbols on the fly as needed.

 

It would be nice to find some existing code to start with?   any suggestions please?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What has this got to do with AVR micros? Are you talking about driving a GLCD from an AVR? At the end of the day any character is just about lighting the right set of dots in a grid.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, general programming on a AVR.  Drawing to an LCD, with the limited NVRAM of any mcu.  Of course we do it with English and that's easy with (26 + 26 + 10 + 10) glyphs.  It's a lot harder with (13 * 20 * 19) combinations in Korean.

 

I wondering if others have tackled this problem?   thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Despite being a fully paid-up member of the "Everyone should speak English" brigade, this does look an interesting question; AVR or not.

 

How is a character composed ? Do you draw one glyph over another and then another over that ?

I just had a look in Wikipedia  and cross referenced to Windows Character Map. It does seem to tie up with the Wikipedia formula.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just googled "Graphic LCD Korean font" and one of the first hits was:

 

https://github.com/xyz37/U8G2_Korean_Font

 

as you may know "U8" is a rather well known GLCD library that can be used with AVR and that supports most of the common GLCD display types that might typically be used with AVR

Last Edited: Tue. Mar 3, 2020 - 02:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most graphics libraries have a specific glyph for each character in a Font.

 

U8g2 can render Unicode for Simplified Chinese, Arabic, Greek, ...

 

Life would be incredibly simple if you could just create 100000 characters by overwriting from a set of 43 primitive glyphs.

External Chinese Font ROM chips make Chinese text possible but with the complication of the "extra chip".

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:

Despite being a fully paid-up member of the "Everyone should speak English" brigade, this does look an interesting question; AVR or not.

 

How is a character composed ? Do you draw one glyph over another and then another over that ?

I just had a look in Wikipedia  and cross referenced to Windows Character Map. It does seem to tie up with the Wikipedia formula.

 

Looking further, there are 56 unique glyphs, and 4 possible layouts of 2 or 3 glyphs each.  So with sizing and position considerations, I should be able to cover the full unicode set with 116 glyphs (which is not much worse than 8 bit Latin).

Last Edited: Wed. Mar 4, 2020 - 08:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Woo-Hoo.   Could you produce a Chinese or Japanese Font with this approach?   Or are there too many different strokes?

 

Are Korean characters more "logical" ?

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A problem I see is resolution.  On a typical cheap'n'cheerful LCD (designed for ASCII in English) the individual character arrays (8x8, if you're lucky, 5x8 if you're not) don't have enough pixels to make distinct Hangul characters (unless you use an array of four in a square).  Given a graphic display with individually accessible pixels, not a problem.

 

The same problem would certainly apply to Chinese.  Dunno about Japanese, but probably.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Typical Chinese glyphs are 16x16.   But since Chinese text seems to use about a quarter of the number of characters,   it makes little difference to "amount of information" on small TFT or OLED.

 

The big problem is that a Chinese font takes up much more ROM than a Latin font.

 

Nothing to worry about nowadays.    ARM chips with 2MB Flash are cheap.   Flash ROMs are cheap.  

 

But in the early days of Home PCs e.g. Z80, 6502, ... how did the Japanese and Chinese cope with 32kB memory and a cassette tape?

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Typical Chinese glyphs are 16x16.   But since Chinese text seems to use about a quarter of the number of characters,   it makes little difference to "amount of information" on small TFT or OLED

But the increased character height really does bugger up your UI layout. I inherited a project that supports Chinese but I've moved stuff around so much now that the Chinese is well & truly broken. Of course, not even being able to recognise the characters (and they are just '\x42' type numbers in the source)  I can't fix it.

 

david.prentice wrote:
But in the early days of Home PCs e.g. Z80, 6502, ... how did the Japanese and Chinese cope with 32kB memory and a cassette tape?

I think they just went with my "Everyone should speak English" comment in #4.  And even in 2020, I really don't know how the multitude of characters are actually entered, I'm sure they don't actually type in the Unicode hex. In any case in the 80's extended Character Input Methods or even code pages probably didn't exist at that time. At least neither my ZX81 nor my Spectrum did.

 

PS: Actually yes - my ZX81 did: If I changed the refresh register on the Z80 the screen would display characters that looked somewhat Chinese.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

N.Winterbottom wrote:

I think they just went with my "Everyone should speak English" comment in #4.  And even in 2020, I really don't know how the multitude of characters are actually entered, I'm sure they don't actually type in the Unicode hex.

 

What they did was use graphics tablets and a pen, and on the tablet was a 'stroke library' of various pen gestures.  Every Chinese character is constructed out of brushstrokes and they would tap around and select which they wanted.  Those who were good at it were quite quick!

 

Then they ran them off on a 300dpi laser printer, so resolution wasn't really a problem.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


david.prentice wrote:
But in the early days of Home PCs e.g. Z80, 6502, ... how did the Japanese and Chinese cope with 32kB memory and a cassette tape?
Can't comment on Chinese but have you ever looked at the upper half of the character sets in an HD44780 manual? There's your Japanese answer! (remember Hitachi are a Japanese company)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So the Japanese managed with a tiny subset e.g. the LCD ROM in the HD44780.

 

The Chinese were probably later to the "Home PC" market.   By which time,  Font ROMs were not prohibitive.

Of course a Hard Disk meant "unlimited storage"

Later LCD controllers like ST7920 come with a built-in Simplified Chinese Font.  (and others)

 

My first dot-matrix printer produced horrible 7x5 text.   Humans accept it on a tiny LCD screen but not on paper.

Later dot-matrix printers still used an 8-pin print head but could print higher resolution characters with multiple passes.

It still looked a bit horrible.

 

David.

Last Edited: Thu. Mar 5, 2020 - 09:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This:

 

https://webdesign.tutsplus.com/articles/the-complete-beginners-guide-to-chinese-fonts--cms-23444

 

leading to this:

 

https://en.wikipedia.org/wiki/Simplified_Chinese_characters

 

are very interesting., So it seems that Chairman Mao, to increase literacy in the 50's and 60's switched from a 20,000 character system to a simplified system using about 350 characters which sounds "do-able" on a computer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The link was very interesting.    Chinese characters are certainly attractive.   (even if I have no idea what they say)

 

I often wonder about which masochist invented Times Roman.   Surely the most horrible font of all time.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
invented Times Roman
The "Times" in that relates to The Times newspaper doesn't it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the link - it was an excellent read.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

I often wonder about which masochist invented Times Roman.   Surely the most horrible font of all time.

 

Arial's worse.  The absolute muttonhead who decided than an upper-case I should be indistinguishable - pixel for pixel identical - from a lower-case L deserves to rot in whatever hell there is for people with improper kerning.  And then it became a default...  Grrr!!

 

Anyhow, my HS English teacher accepted 5x7 dot-matrix printing!  He insisted that we type all our work, and after corrections (and grading!), type them out again.  My poor fellow classmates spent hours tapping away rewriting what they had written before, while I on my Apple ][ (not a + (!)) just edited and ran it off the printer once more!

 

Didn't have a daisywheel handy.  wink  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scroungre wrote:

improper kerning

 

Don't you mean "keming"? laugh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

david.prentice wrote:
invented Times Roman
The "Times" in that relates to The Times newspaper doesn't it?

 

Yep; the smallest font they could get away with that was readable, so they could get more text on a sheet of paper.

 

Christop, go and stand in the corner and think about your sins! :)

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

christop wrote:
Don't you mean "keming"? 

OMG It took me over 30s to get that joke.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

barnacle wrote:
Christop, go and stand in the corner and think about your sins! :)

laugh  In Christop's defense I've seen Cliff referred to as 'dawson' more than once here at freaks.

Letting the smoke out since 1978