Re: Accented Capital letters getting clipped



Thanks Behdad, Using ink_rect solves the issue.

However, this results in clipping of the right-most glyph while rendering on FT_Bitmap. 
Hence, I am using height from ink_rect and width from logical_rect.

Do you think that this is the right approach ?


On Thu, May 23, 2013 at 9:42 PM, Behdad Esfahbod <behdad behdad org> wrote:
On 13-05-23 06:01 AM, Parth Kanungo wrote:
> Hello,
>
> I am using Pango/FT2 to render a text that contains accented characters like
> 0x00C1 (accented A )  and 0x010C (a variety of C used in Czech language).
>
> From my experiments, I figured that pango does not take into consideration the
> accent above the characters while calculating extents
> using pango_layout_iter_get_line_extents().  Correct me, if I am wrong.


        pango_layout_iter_get_line_extents(itr, NULL, &lineRect);

Instead of getting the logical rect (last arg), try the ink rect (middle one).

behdad

> Here is what I did.
>
> 1. I rendered the layout using pango_ft2_render_layout(). The accent got
> clipped from the characters in the first line, but were rendered successfully
> for the second line.
>
> 2. My application requires me to use line-by-line rendering. Thus, I rendered
> the second line of the layout using pango_ft2_render_layout_line(). The accent
> above the letters gets clipped (See output1.bmp).
>
> 3. I adjusted the baseLine by adding 5. I got output2.bmp,
>
> Hence, I have a reason to believe that extents calculated do not take into
> consideration the full height of the glyph.
> Is this a known bug? Or, am I doing something wrong here?
>
> Thanks,
> --
> Parth

--
behdad
http://behdad.org/



--
Parth 


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