freetype-devel
[Top][All Lists]
Advanced

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

Re: Edge effect (Depressed) on a Pixmap buffer using freetype lib


From: Niyas k
Subject: Re: Edge effect (Depressed) on a Pixmap buffer using freetype lib
Date: Thu, 4 Jun 2020 17:18:52 +0530

Our implementation is to create edge effect (Depressed) on subtitle rendering.

So what we have in the existing implementation without any edge effect,
- We render the necessary fonts/primitives onto a pixmap and then write the text/Glyphs
- And finally we render.

Our requirement is to create depressed edge effect. As of now the plan we have is to draw the font a few times in x-i and y-i direction (x,y is the current font position) with edge color first and then drawing the font again with the font color. This logic we have done in other modules and the edge looks good.

Now here the problem what we are facing is when we load the glyph we get the data in a bounding box. The glyph which is loaded is a greyscale and it is with bounding-box. So when we draw the edges and font as per the above logic, the bounding boxes of the edges and the font gets overlapped. Note, it is a pixmap buffer.

To handle this, one solution we thought is to load the glyph without the bounding box (ie when we load the glyph only the pixels of character area will be drawn). As an alternative, we tried to make the bounding box area transparent; however what we observed is even though it is transparent it is overlapping (or rewriting/redrawing the pixels as its a pixmap) the previously drawn edge/font. So with this our understanding is that as its a pixmap, anything drawn will actually overwrite the pixels. So this seems to be ruled out.

==>> Is it possible to load glyphs without the bounding box? or Is there any other advisable solution(s) for this problem.

I am attaching a screen shot for your reference;
- Image1: With bounding box of background banner
- Image2: With bounding box made transparent


Regards,

Niyas


On Wed, Jun 3, 2020 at 5:32 PM Alexei Podtelezhnikov <apodtele@gmail.com> wrote:
On Wed, Jun 3, 2020 at 6:11 AM Niyas k <niyaskamaluddin@gmail.com> wrote:
> When loading a freetype font, it comes with a bounding-box. We are trying to create depressed edge effect by writing the font multiple times in (x-i) and (y-i) positions to create the depressed edge effect. Now with the bounding-box in picture it is covering/overwriting the edges even if we make the pixel transparent.

Please try to describe your problem better.

Attachment: Image-1.jpeg
Description: JPEG image

Attachment: Image-2.jpeg
Description: JPEG image


reply via email to

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