freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] truetype metrics resize request question


From: Steven Chu
Subject: Re: [ft-devel] truetype metrics resize request question
Date: Wed, 13 Jul 2011 20:06:48 -0500

I've made a patch for the proposed change below.  Please let me know
if anything needs to be adjusted.

Thanks!

On Mon, Jul 11, 2011 at 8:07 PM, Steven Chu <address@hidden> wrote:
> To clarify what I've observed with the Ahem font:
>
> From ttdriver.c:
>  static FT_Error
>  tt_size_request( FT_Size          size,
>                   FT_Size_Request  req )
>  {
> /* Current value for size == previous calculated metrics */
>    TT_Size   ttsize = (TT_Size)size;
>    FT_Error  error  = TT_Err_Ok;
>
> #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
> ...
> #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
>
>    FT_Request_Metrics( size->face, req ); /* Calculates new metrics,
> incorrect for Ahem */
>
>    if ( FT_IS_SCALABLE( size->face ) ) /* Ahem is scalable */
>      error = tt_size_reset( ttsize ); /* Calculates proper metrics
> stored in ttsize */
>
> /* ttsize->metrics contains proper metrics, size->metrics contains
> incorrect metrics */
>
>    return error;
>  }
>
>
> and my proposed change:
>  tt_size_request( FT_Size          size,
>                   FT_Size_Request  req )
>  {
> ...
>    if ( FT_IS_SCALABLE( size->face ) )
>    {
>      error = tt_size_reset( ttsize );
> /* Fix: copy reset metrics from TT_Size to publically accessible
> FT_Size metrics */
>      ttsize->root.metrics = ttsize->metrics;
>    }
>
>    return error;
>  }
>

Attachment: fix_truetype_size_request.patch
Description: Text Data


reply via email to

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