freetype
[Top][All Lists]
Advanced

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

Re: [ft] How to draw FT_Bitmap to the ARGB image?


From: Wojciech Mamrak
Subject: Re: [ft] How to draw FT_Bitmap to the ARGB image?
Date: Thu, 5 Nov 2015 13:05:43 +0100

> In a result I made it first to convert the RGB glyph to grayscale and
> then to blend it to the background. This way, the transparency is always OK.

You can return grayscale bitmaps from FT directly, without the
conversion on your side.
The transparency will be OK but remember to use the alpha channel
blending formula this time :)

> But the big question is "Do I need subpixel antialiased fonts so badly?" :)

This question holds if you intend to compose and display some images
on the screen (which is always opaque). Then it depends on font size,
font itself, targeted device (e.g. resolution, pixel layout), etc. If
you intend to save images with transparency, the only versatile option
is grayscale antialiased text. Generating SVG images, which are
composed "at runtime", assuming rendering engine supports
subpixel-antialiased text, is another option.


2015-11-05 11:54 GMT+01:00 John Found <address@hidden>:
> On Thu, 5 Nov 2015 02:22:11 +0100
> Wojciech Mamrak <address@hidden> wrote:
>
>>
>> If I had not provided the equation, then you would have asked me why I
>> have not done this.
>>
>
> Not, if you provided some explanation. ;)
>
> Anyway, I realized that it is not possible to have sub-pixel antialiasing
> with the RGBA images, simply because it needs separate alpha channel for
> every color.
>
> In a result I made it first to convert the RGB glyph to grayscale and
> then to blend it to the background. This way, the transparency is always OK.
>
> Although, using separate alpha channels the problem is solvable.
> I mean 48bit RGBrgb format instead of 32bit RGBA. (r, g and b are the alpha 
> channels for
> the respective color channel).
>
> But the big question is "Do I need subpixel antialiased fonts so badly?" :)
>
> Best Regards
> --
> http://fresh.flatassembler.net
> http://asm32.info
> John Found <address@hidden>
>
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype



reply via email to

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