|
|
|
Sync with Chromium's fork
* Add the following font metrics fields:
+ fAvgCharWidth
+ fXMin
+ fXMax
+ fXHeight
* Add \#if 0'ed includes for the Freetype headers for Xcode, scons and
other tools which chase headers.
* Correctly render 1bpp fonts (mostly Chinese fonts at small sizes)
Patch Set 1 #
Total comments: 6
Patch Set 2 : ... #
Total comments: 4
Patch Set 3 : ... #
Total messages: 6
|
agl
|
16 years, 9 months ago (2009年04月15日 21:34:13 UTC) #1 | |||||||||||||||||||||||||||||||||||||
http://codereview.appspot.com/41081/diff/1/2 File include/core/SkPaint.h (right): http://codereview.appspot.com/41081/diff/1/2#newcode627 Line 627: SkScalar fXMin; //!< The minimum bounding box x value for all glyphs I think these min/max values will be useful (assuming they're accurate). Should we just store a rect, and say its the global bbox for the font, rather than just the X values? http://codereview.appspot.com/41081/diff/1/3 File src/ports/SkFontHost_FreeType.cpp (right): http://codereview.appspot.com/41081/diff/1/3#newcode39 Line 39: #if 0 Will we leave this as #if 0 ? http://codereview.appspot.com/41081/diff/1/3#newcode768 Line 768: SkFixed myy = fMatrix22.yy; This happens to work of scalar==float, but the better approach is to call SkIntToScalar(xmin) / upen. This will work for both fixed and float builds.
http://codereview.appspot.com/41081/diff/1/2 File include/core/SkPaint.h (right): http://codereview.appspot.com/41081/diff/1/2#newcode627 Line 627: SkScalar fXMin; //!< The minimum bounding box x value for all glyphs On 2009年04月22日 14:09:59, reed wrote: > I think these min/max values will be useful (assuming they're accurate). Should > we just store a rect, and say its the global bbox for the font, rather than just > the X values? Can I get away with doing that afterwards? I'm afraid that I'm going to mess up Steven's unforking if I do this now. http://codereview.appspot.com/41081/diff/1/3 File src/ports/SkFontHost_FreeType.cpp (right): http://codereview.appspot.com/41081/diff/1/3#newcode39 Line 39: #if 0 On 2009年04月22日 14:09:59, reed wrote: > Will we leave this as #if 0 ? Yes. The compiler doesn't actually include these files, but build tools will see the includes and not break. Xcode and scons need this at least. http://codereview.appspot.com/41081/diff/1/3#newcode768 Line 768: SkFixed myy = fMatrix22.yy; On 2009年04月22日 14:09:59, reed wrote: > This happens to work of scalar==float, but the better approach is to call > SkIntToScalar(xmin) / upen. This will work for both fixed and float builds. Done.
I'm fine to keep the paint.h as is. We can explore the rect -vs- max/min later on http://codereview.appspot.com/41081/diff/1003/2003 File src/ports/SkFontHost_FreeType.cpp (right): http://codereview.appspot.com/41081/diff/1003/2003#newcode789 Line 789: if (os2 && os2->sxHeight) { another float -vs- fixed fix x_height = SkFixedToScalar(SkMulDiv(fScaleX, os2->sxHeight, upem)); http://codereview.appspot.com/41081/diff/1003/2003#newcode797 Line 797: FT_Outline_Get_CBox(&fFace->glyph->outline, &bbox); x_height = SkIntToScalar(bbox.yMax) / 64;
http://codereview.appspot.com/41081/diff/1003/2003 File src/ports/SkFontHost_FreeType.cpp (right): http://codereview.appspot.com/41081/diff/1003/2003#newcode789 Line 789: if (os2 && os2->sxHeight) { On 2009年04月22日 20:29:03, reed wrote: > another float -vs- fixed fix > > x_height = SkFixedToScalar(SkMulDiv(fScaleX, os2->sxHeight, upem)); Done. http://codereview.appspot.com/41081/diff/1003/2003#newcode797 Line 797: FT_Outline_Get_CBox(&fFace->glyph->outline, &bbox); On 2009年04月22日 20:29:03, reed wrote: > x_height = SkIntToScalar(bbox.yMax) / 64; Done.