freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] How to use subpixel hinting in FreeType


From: John Found
Subject: Re: [ft] How to use subpixel hinting in FreeType
Date: Sun, 7 Jun 2015 19:23:17 +0300

Well, I can only help with my code for drawing glyphs with FreeType:

http://fresh.flatassembler.net/fossil/repo/fresh/info/c248fd488593dbc3a0282c8478d7422802c026b6?ln=256-601

It is in assembly, but I am confident, that some details are better visible in 
assembly source.

The above code handles properly (except possible bugs, of course) all possible 
pixel modes and draws
the glyph in a 32bit memory based image (bitmap).

Hope to be helpful.

-- 
http://fresh.flatassembler.net
http://asm32.info
John Found <address@hidden>


On Sun, 7 Jun 2015 09:05:37 +0200
katz - <address@hidden> wrote:

> Dear FreeType mailing list,
> 
> I am a beginner at using FreeType and new to the concept of subpixel
> hinting. I've read through most API references that seemed related, but I
> am still not sure how should I use the library to attain RGB (or RGBA?)
> bitmaps with glyphs hinted on the subpixel level. If there are any examples
> on this I did not manage to find, please direct me to it.
> 
> So here is what I tried doing so far:
> I built the library with both the FT_CONFIG_OPTION_SUBPIXEL_RENDERING and
> the TT_CONFIG_OPTION_SUBPIXEL_HINTING definitions. Here is my program, that
> runs without errors:
> http://pastebin.com/YNhgwwAN
> 
> With this method, I end up with a glyph bitmap which is three times wider
> than the intended size. If this is the right approach, then my question is
> how should I use this information to get an RGB bitmap with the right size?
> The code tries to directly map the values of the result bitmap to the RGB
> channels, but this doesn't seem right:
> http://postimg.org/image/gbfdyh0b9/
> The colors are obviously too strong.
> 
> I guess I am doing something really wrong here, because if I try different
> sizes (for example: 31) the result will be distorted:
> http://postimg.org/image/7s28scn9j/
> I am also getting distortions like that seemingly every time, if I don't
> turn on LCD filtering.
> 
> Any help on the subject is greatly appreciated!
> 
> Regards,
> - katz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]