Board.KolibriOS.org
http://board.kolibrios.org/

unicode rasterfont files
http://board.kolibrios.org/viewtopic.php?f=23&t=2771
Page 1 of 1

Author:  seppe [ Sun Aug 17, 2014 4:10 pm ]
Post subject:  unicode rasterfont files

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.
Attachment:
File comment: Greek, Coptic, and Cyrillic
uex1.jpg
uex1.jpg [ 43.46 KiB | Viewed 4503 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?

Author:  hidnplayr [ Sun Aug 17, 2014 8:34 pm ]
Post subject:  Re: unicode rasterfont files

There is some UTF-8 code in IRC client, see file 'encodings.inc' in svn/programs/network/ircc.

Author:  CleverMouse [ Mon Aug 18, 2014 2:20 pm ]
Post subject:  Re: unicode rasterfont files

What about licensing issues? Neither Arial nor Consolas are free fonts.

Author:  seppe [ Tue Aug 19, 2014 9:47 pm ]
Post subject:  Re: unicode rasterfont files

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? :?:

Author:  hidnplayr [ Tue Aug 19, 2014 10:03 pm ]
Post subject:  Re: unicode rasterfont files

Copyright is a strange thing http://en.wikipedia.org/wiki/Intellectu ... _typefaces

Author:  dunkaist [ Tue Aug 19, 2014 10:09 pm ]
Post subject:  Re: unicode rasterfont files

uw-ttyp0

Author:  seppe [ Sun Aug 24, 2014 3:27 pm ]
Post subject:  Re: unicode rasterfont files

dunkaist wrote:
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:
Attachment:
File comment: K1r, K1b, K1i
uwe.jpg
uwe.jpg [ 36.49 KiB | Viewed 4356 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:

Attachment:
File comment: utf-8 coded unicode (12 point)
utf8ex.jpg
utf8ex.jpg [ 38.26 KiB | Viewed 4356 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.
Attachment:
File comment: Greek, Cyrillic
Greek.jpg
Greek.jpg [ 34.65 KiB | Viewed 4356 times ]

Author:  hidnplayr [ Sun Aug 24, 2014 7:34 pm ]
Post subject:  Re: unicode rasterfont files

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 :)

Author:  linuxmaster [ Tue Feb 24, 2015 11:37 am ]
Post subject:  Re: unicode rasterfont files

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

Author:  Leency [ Tue Feb 24, 2015 12:11 pm ]
Post subject:  Re: unicode rasterfont files

Hello, seppe!

Would you mind to provide library for that fonts?

Author:  hidnplayr [ Tue Feb 24, 2015 1:16 pm ]
Post subject:  Re: unicode rasterfont files

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.

Author:  hidnplayr [ Tue Feb 24, 2015 1:32 pm ]
Post subject:  Re: unicode rasterfont files

This is how the URF2 fonts look like: http://ftp.kolibrios.org/users/hidnplayr/urf2/

Page 1 of 1 All times are UTC+03:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/