Here is my version for the holidays..
* every function accepts UTF-8 now instead of archaic codepages.
* added 'height' dword after 'width' in text_out_mem function.
(So people can use existing blitting procedures / don't have to store 'height' somewhere else)
* Fixed 'get_width' function (problem was related to signed/unsigned datatypes).
TrueType
-
Last edited by hidnplayr on Thu Mar 12, 2015 8:01 pm, edited 1 time in total."Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
An updated version of stb_truetype.h is available with (better) subpixel rendering (a technique called ClearType in Windows).
https://github.com/nothings/stb/blob/ma ... truetype.h
https://github.com/nothings/stb/blob/ma ... truetype.h
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
I moved the glue code (our own definition of malloc etc) to a separate file, so there are no changes needed to official stb_truetype.h file to build our KolibriOS library!
Here it is, compileable with latest stb_truetype.h (1.02)
There are still memory leaks unfortunately, speed is low and lots of warnings when compiling...
Ideas:
Fix memory leak(s)
Clean up code
Make compileable with MSVC
Here it is, compileable with latest stb_truetype.h (1.02)
There are still memory leaks unfortunately, speed is low and lots of warnings when compiling...
Ideas:
Clean up code
Make compileable with MSVC
Last edited by hidnplayr on Thu Mar 12, 2015 8:02 pm, edited 1 time in total.
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
Fixed the big memory leak and some other loose ends.
(zfree was not working correctly all the time, because GCC did not know that mcall 68, 13 outputs in eax.)
(zfree was not working correctly all the time, because GCC did not know that mcall 68, 13 outputs in eax.)
- Attachments
-
-
ttf102.7z (41.14 KiB)Downloaded 312 times
-
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
Great job! Please, upload to SVN now ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Из хаоса в космос
Previous versions cut bottoms of curvy letters, the new version cuts tops. ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
- Attachments
-
-
truetype.gif (2.33 KiB)Viewed 5941 times
Who is online
Users browsing this forum: No registered users and 10 guests