Commit Graph

17 Commits

Author SHA1 Message Date
vandebo@chromium.org
325cb9aa17 Improve the SkAdvancedTypefaceMetrics interface w.r.t. vertical advances.
Add a template function to type safe-combine bits of a bit field.

Review URL: http://codereview.appspot.com/4313053

git-svn-id: http://skia.googlecode.com/svn/trunk@1020 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-03-30 18:36:29 +00:00
djsollen@google.com
cd9d69b9ce Upstreaming changes from android.
- fix compile warnings in the GPU code
- upstream android specific code (ifdef protected)
- fail gracefully when a custom allocator fails



git-svn-id: http://skia.googlecode.com/svn/trunk@936 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-03-14 20:30:14 +00:00
vandebo@chromium.org
c48b2b330f Cleanup SkPDFTypfaceInfo and make it more generic.
Renamed to SkAdvancedTypefaceMetrics.
Include Em size and return all metrics in unscaled font units.
Make retrieval of advances optional.
Reorder SkAdvancedTypefaceMetrics to be somewhat logical.
Change the types of fields in SkAdvancedTypefaceMetrics to their minimum required size.

Review URL: http://codereview.appspot.com/4121049

git-svn-id: http://skia.googlecode.com/svn/trunk@752 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-02-02 02:11:22 +00:00
vandebo@chromium.org
2a22e10ab2 Add Truetype and Type 1 font embedding support
Sorry this is such a large CL.  It was very exploratory for me to make this
work.

- Add an interface to SkFontHost to retrieve font information and provide NULL implementations on all platforms except Linux.
- Segment large Type 1 fonts into fonts with shared resources with 255 glyphs each.
- Convert the various Type 1 formats to the form PDF wants.
- Update font as we draw text instead of as part of the graphical state.
- Remove built-in font support, we can't really use it.

Other changes I can pull out to a separate CL if you like.

- Add SkTScopedPtr class.
- Fix double free of resources.
- Fix bug in resource unique-ifying code.
- Don't print anything for any empty clip path.
- Fix copy paste error - MiterLimit.
- Fix sign extension bug in SkPDFString
- Fix FlateTest rename that was missed on a previous commit.

Review URL: http://codereview.appspot.com/4082042

git-svn-id: http://skia.googlecode.com/svn/trunk@728 2bbb7eff-a529-9590-31e7-b0007b416f81
2011-01-25 21:01:34 +00:00
agl@chromium.org
5f6a0762f1 Add a SkTypeface::CreateForChars() function.
This allows us to do font fallback for strange scripts.
Added empty stubs to the implementations on all platforms.

Patch-by: Evan Martin
Signed-off-by: Adam Langley

http://codereview.appspot.com/950041

git-svn-id: http://skia.googlecode.com/svn/trunk@557 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-04-20 22:06:40 +00:00
reed@android.com
3f1f06a26b add optional pref-config table to codecs
git-svn-id: http://skia.googlecode.com/svn/trunk@519 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-03-03 21:04:12 +00:00
reed@android.com
8de2e6de5b add kNONE_LCDOrder for screens with no recognizable rgb order
git-svn-id: http://skia.googlecode.com/svn/trunk@518 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-03-02 19:56:53 +00:00
reed@android.com
ac98154faa add GetFileName api to SkFontHost
git-svn-id: http://skia.googlecode.com/svn/trunk@299 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-31 16:17:01 +00:00
reed@android.com
e2ca20740b ws fixes
use enum in getHinting() function, rather than hard-coded constants



git-svn-id: http://skia.googlecode.com/svn/trunk@290 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-27 16:39:38 +00:00
reed@android.com
36a4c2aa2d Add SkFontHost::FilterRect() which allows the font host to filter our request
before we turn it into a font-cache entry, for the cases where the scaler will
ignore and/or collapse certain feature requests (e.g. doesn't support all levels
of hinting)



git-svn-id: http://skia.googlecode.com/svn/trunk@283 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-22 19:52:11 +00:00
agl@chromium.org
f03642675e Typo fix.
git-svn-id: http://skia.googlecode.com/svn/trunk@279 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-21 18:58:43 +00:00
agl@chromium.org
309485b7b5 Subpixel glyph rendering support.
This patch adds support for rendering subpixel glyphs (using
Freetype). In order to control this rendering see
SkPaint::setLCDRenderText in SkPaint.h.

To setup the LCD mode, see SkFontHost::SetSubpixelOrientation and
SkFontHost::SetSubpixelOrder in SkFontHost.h.

This patch also adds more fine grained control over hinting (again,
only for Freetype currently). One can now control the hinting with
SkPaint::setHinting.


git-svn-id: http://skia.googlecode.com/svn/trunk@275 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-07-21 17:41:32 +00:00
reed@android.com
d6638e644e add Table apis to SkFontHost
need to implement in _win backend



git-svn-id: http://skia.googlecode.com/svn/trunk@149 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-04-08 05:03:52 +00:00
reed@android.com
a14ea0e930 Simplify font-chaining (fallbacks) to have fonthost just return the next
logical fontID.
Extend ImageRef to accept an imagedecoder factory, to replace calling the std
one.



git-svn-id: http://skia.googlecode.com/svn/trunk@125 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-17 17:59:53 +00:00
reed@android.com
b1d9d2ef28 Significant cleanup in api, and more importantly in sementics, of SkFontHost
- FindTypeface is now CreateTypeface, and what it returns is always considered
    a new instance, even if it is from a cache (in which case it will have been
    ref()'d. The caller must always balance its ownership by calling unref() on
    the result when they are done.
- CloseStream is gone, since the caller can/must call stream->unref() when they
    are done using it.
- ResolveTypeface is now ValidFontID, and just returns a bool.



git-svn-id: http://skia.googlecode.com/svn/trunk@109 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-03-04 17:37:51 +00:00
reed@android.com
03ca3d19c4 move CreateTypefaceFromFile into fonthost porting layer, so we don't force a given port to have mmap access.
update core.proj as some headers have changed location



git-svn-id: http://skia.googlecode.com/svn/trunk@43 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-22 15:35:46 +00:00
reed@android.com
8a1c16ff38 grab from latest android
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81
2008-12-17 15:59:43 +00:00