Page 1 of 1

unicode rasterfont files

Posted: Sun Aug 17, 2014 4:10 pm
by seppe
Unicode on Kolibri is born:
To get started, I produced (on my win7 pc) 2 unicode raster font files : Arial regular and Consolas.
Both files have the data for 2211 glyphs, for the fontsizes 7,8,10,12, and 14, and take 460Kb each.
For now, I left out the Hebrew and Arabic glyphs. (I do not intent to implement RTL (right to left) typing).
Here is a screenshot of Greek and Cyrillic unicodes (0x400 to 0x520) in proportional Arial 10 on Kolibri OS.
Greek, Coptic, and Cyrillic
uex1.jpg (43.46 KiB)
Greek, Coptic, and Cyrillic Viewed 8758 times
Anti-aliasing is obtained, because the font has a 4-bit color value for each pixel.
I did not add kerning information to the fontfile. I intent to realise kerning by evaluating the pixels.
My major problem is to obtain crispy glyphs for small fonts. I still need to elaborate on this.
I will publish working results (a new Klib version) as soon as I solved these problems.

Direct screen-draw issues

The drawing routine draws the pixels directly to the framebuffer (using GS).
(The Bitblit routine has no rasterop for color blending/transparency.)
I need to add clipping logic to prevent drawing in windows in front.
Can someone point me to assembly code for this clipping logic?

Utf-8 issues

I propose utf-8 coding for strings.
This makes low-level routines more complex, but it simplifies high level routines.
It avoids having two or more versions of many OS routines (like in Win32).
I believe it becomes the favourite coding method in networking.
Are there utf8 example routines in assembly around? Is Fasm utf-8 friendly?

Re: unicode rasterfont files

Posted: Sun Aug 17, 2014 8:34 pm
by hidnplayr
There is some UTF-8 code in IRC client, see file 'encodings.inc' in svn/programs/network/ircc.

Re: unicode rasterfont files

Posted: Mon Aug 18, 2014 2:20 pm
by CleverMouse
What about licensing issues? Neither Arial nor Consolas are free fonts.

Re: unicode rasterfont files

Posted: Tue Aug 19, 2014 9:47 pm
by seppe
CleverMouse wrote:What about licensing issues? Neither Arial nor Consolas are free fonts.
Yes, you have a point. But what other font(s) shall I use for extraction? :?
There are many fonts on the net, but i need a crispy font (or set) for small font-sizes with sufficient unicodes (Latin, Greek, Cyrillic).
I assume there must be suitable fonts in the Linux world.
Can someone advice? :?:

Re: unicode rasterfont files

Posted: Tue Aug 19, 2014 10:03 pm
by hidnplayr

Re: unicode rasterfont files

Posted: Tue Aug 19, 2014 10:09 pm
by dunkaist

Re: unicode rasterfont files

Posted: Sun Aug 24, 2014 3:27 pm
by seppe
dunkaist wrote:uw-ttyp0
Thank you for this URL.
On this site, Uwe Waldmann freely offers bdf text files for 1-bit unicode rasterfonts for several font sizes and font faces: regular and bold 12,14,16,18, 20, and italic 16,18.
These fontsizes represent the em-height in pixels.
I developed a font-compiler on win7 to produce the rasterfont files to be used on KolibriOS.
I named these files K1r.urf (210k) , K1b.urf (222k) , and K1i.urf (91K).
I wrote a Klib routine to parse utf-8 strings.
On KolibriOS, the result looks like this:
K1r, K1b, K1i
uwe.jpg (36.49 KiB)
K1r, K1b, K1i Viewed 8611 times
The good, the bad, the ugly . . .

+ no license problem
+ smaller fontfiles
+ lots of unicodes (including hebrew)
+ easy editing of the bdf fontfiles
+ later, I will port the font-compiler to KolibriOS
- monospaced only

A compiled rasterfile with regular 12 only, takes less then 40K.
This opens the possibility for having a unicode systemfont.
Let me know if you are interested to implement this.
This is how it would look on KolibriOS:
utf-8 coded unicode (12 point)
utf8ex.jpg (38.26 KiB)
utf-8 coded unicode (12 point) Viewed 8611 times
Rasterfonts without anti-aliasing look ugly, but for now, I would like to continue with these.
To develop: proportional font, combining chars, diacriticals, code page conversion, fontstyles, kerning, etc. . . .

Soon I will publish the new version of Klib, so you can experiment with unicode yourself.
After that, I will start a new topic on the forum for help with direct draw.
Greek, Cyrillic
Greek.jpg (34.65 KiB)
Greek, Cyrillic Viewed 8611 times

Re: unicode rasterfont files

Posted: Sun Aug 24, 2014 7:34 pm
by hidnplayr
I'm all for a unicode system font.
Need 40 kilobyte of space? Remove 'invaders' from the games folder (It can be moved to the CD distro).
I'd like to see this inside kernel ofcourse, and original system fonts removed.

PS: have you tried compressing with KPACK? it uses LZMA compression afaik :)

Re: unicode rasterfont files

Posted: Tue Feb 24, 2015 11:37 am
by linuxmaster
Is there PosGlue in the distro?
Is there any other program for editing and viewing fonts in KolibiOS?
What kind of distribution format you would like to use? Maybe https://en.wikipedia.org/wiki/Glyph_Bit ... ion_Format ?
Here you can find links to the great open libre font world: https://en.wikipedia.org/wiki/Open-sour ... _typefaces

Re: unicode rasterfont files

Posted: Tue Feb 24, 2015 12:11 pm
by Leency
Hello, seppe!

Would you mind to provide library for that fonts?

Re: unicode rasterfont files

Posted: Tue Feb 24, 2015 1:16 pm
by hidnplayr
The K1 fonts that you see in latest screenshots can be found here: http://ftp.kolibrios.org/users/seppe/Klib/Klib_fonts/
To test Seppe's programs, download http://ftp.kolibrios.org/users/seppe/kinst.exe installer onto an USB stick and execute it, download Klib folder (http://ftp.kolibrios.org/users/seppe/Klib/) to the root of that stick as well, and boot it in a computer.

But..
Seppe has since captured other (free) TTF fonts into URF2 rasterfont files.
These fonts can be found here: http://ftp.kolibrios.org/users/seppe/UrFonts/
URF2 font format specification here: http://ftp.kolibrios.org/users/seppe/Kl ... Layout.pdf
These fonts look much nicer, but are also a lot bigger.
I believe the fonts can be compressed better by removing the "Run Length Encoding" that it uses now, and compressing with LZMA, but havent tried this yet.

Re: unicode rasterfont files

Posted: Tue Feb 24, 2015 1:32 pm
by hidnplayr
This is how the URF2 fonts look like: http://ftp.kolibrios.org/users/hidnplayr/urf2/