Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(134)

Issue 1708050: Expose some fields from the FreeType metrics out via FontMetrics....

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 6 months ago by evan
Modified:
14 years, 11 months ago
Reviewers:
reed, agl, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Expose some fields from the FreeType metrics out via FontMetrics. This is needed by the text shaper used in Chrome.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -0 lines) Patch
M include/core/SkPaint.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/ports/SkFontHost_FreeType.cpp View 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 6
evan
This is ugly, but a cleaner way of doing this isn't apparent to me.
15 years, 6 months ago (2010-06-29 21:42:55 UTC) #1
reed
On 2010/06/29 21:42:55, evan wrote: > This is ugly, but a cleaner way of doing ...
15 years, 6 months ago (2010-06-29 22:13:02 UTC) #2
evan
On 2010/06/29 22:13:02, reed wrote: > On 2010/06/29 21:42:55, evan wrote: > > This is ...
15 years, 6 months ago (2010-06-29 22:16:47 UTC) #3
reed
You're right that these are matrix independent, since they come from a call purely on ...
15 years, 6 months ago (2010-07-01 14:42:44 UTC) #4
evan
On 2010/07/01 14:42:44, reed wrote: > xppem = paint.getTextSize() > > We don't echo other ...
14 years, 11 months ago (2011-01-19 23:51:20 UTC) #5
reed1
14 years, 11 months ago (2011-01-23 02:19:40 UTC) #6
I still don't clearly see what is needed that isn't already present, except
perhaps units-per-em. If that is what is needed, the right place to return that
is (I think) the SkTypeface (since it is independent of matrix and pointsize).

That said, I certainly don't know the complex shaper, so perhaps a phone call is
due, so we can exchange more info.

On 2011/01/19 23:51:20, evan wrote:
> On 2010/07/01 14:42:44, reed wrote:
> > xppem = paint.getTextSize()
> > 
> > We don't echo other inputs in this struct (e.g. typeface), so I'm not sure
we
> > need to add these fields... unless these are *not* obviously deducible from
> the
> > paint. Maybe I'm wrong.
> 
> Remember this old change?  I'm returning to it now!
> Some background to jog your memory: deep inside the complex text shaper, in
its
> implementation of GPOS table attributes, it uses a few numbers -- the ones I
> naively exposed by this patch.
> 
> I still don't think it's correct, but I seek your advice on how to make it
> correct.
> 
> 
> It appears these numbers vary per font, independent of the paint settings.  I
> wrote a simple dumper that dumps some fields out of FreeType, given a
character
> size and font file.  To make things simpler, I provided a size of 1 so that we
> can see numbers without additional scaling.
> 
> $ ~/ttf/dump 1 /usr/share/fonts/truetype/ttf-devanagari-fonts/nakula.ttf 
> units_per_EM 2048
> x_ppem 1
> y_ppem 1
> x_scale 0x800 0.031250
> 
> $ ~/ttf/dump 1 /usr/share/fonts/truetype/ttf-devanagari-fonts/lohit_kok.ttf 
> units_per_EM 1024
> x_ppem 1
> y_ppem 1
> x_scale 0x1000 0.062500
> 
> For easy clicking, here are the FreeType docs on the relevant fields:
>
http://freetype.sourceforge.net/freetype2/docs/reference/ft2-base_interface.h...
> 
> With different font sizes, I can see that x_ppem = the input size, and x_scale
=
> a function of units_per_EM and the input size.  The former I can get directly
> from the SkPaint.  But it seems for the latter I still need some way of
getting
> at font-specific conversion factor for font units.
> 
> I'm still not certain how to get that number out of Skia.  Any advice?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b