aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ports/SkFontConfigTypeface.h
Commit message (Collapse)AuthorAge
* Implement SkTypeface_FreeType::onMakeClone which overrides ↵Gravatar Bruce Wang2018-06-19
| | | | | | | | | | | | | | SkTypeface::onMakeClone. Overrides of onMakeClone are implemented in: src/ports/SkFontConfigTypeface.h src/ports/SkFontMgr_android.cpp src/ports/SkFontMgr_fontconfig.cpp Change-Id: I557082ecd105742a899c66b8de7101d5045ebf73 Reviewed-on: https://skia-review.googlesource.com/135324 Commit-Queue: Bruce Wang <brucewang@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Implement getFamilyName for stream fonts on Linux.Gravatar Ben Wagner2017-01-26
| | | | | | | | | | | | | | When SkFontMgr_fontconfig and SkFontMgr_FontConfigInterface create a typeface from data they do not store the default font name and getFamilyName will return the empty string. All of the code to handle this properly now exists, it just needs to be hooked up. BUG=skia:1508 Change-Id: I75f2a598a5451babb4a9ceb5e9a9e9d3daa41d60 Reviewed-on: https://skia-review.googlesource.com/7506 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Split SkFontConfigInterface globals and factory.Gravatar bungeman2016-09-19
| | | | | | | | | | Chromium needs to be able to set up their build such that the globals continue existing but the SkFontMgr::Factory can be defined separately. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2346333002 CQ_INCLUDE_TRYBOTS=master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review-Url: https://codereview.chromium.org/2346333002
* SkFontData to use smart pointers.Gravatar bungeman2016-09-16
| | | | | | | | | | | | | | | | | The SkFontData type is not exposed externally, so any method which uses it can be updated to use smart pointers without affecting external users. Updating this first will make updating the public API much easier. This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It appears that no one outside Skia is currently using SkStream::NewfromFile so this is a good time to update it as well. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c Review-Url: https://codereview.chromium.org/2339273002
* Revert of SkFontData to use smart pointers. (patchset #3 id:40001 of ↵Gravatar bungeman2016-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2339273002/ ) Reason for revert: Killing Mac Original issue's description: > SkFontData to use smart pointers. > > The SkFontData type is not exposed externally, so any method which uses > it can be updated to use smart pointers without affecting external > users. Updating this first will make updating the public API much > easier. > > This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to > std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It > appears that no one outside Skia is currently using SkStream::NewfromFile > so this is a good time to update it as well. > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 > > Committed: https://skia.googlesource.com/skia/+/d8c2476a8b1e1e1a1771b17e8dd4db8645914f8c TBR=mtklein@chromium.org,halcanary@google.com,mtklein@google.com,reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2343933002
* SkFontData to use smart pointers.Gravatar bungeman2016-09-15
| | | | | | | | | | | | | | | | The SkFontData type is not exposed externally, so any method which uses it can be updated to use smart pointers without affecting external users. Updating this first will make updating the public API much easier. This also updates SkStreamAsset* SkStream::NewFromFile(const char*) to std::unique_ptr<SkStreamAsset> SkStream::MakeFromFile(const char*). It appears that no one outside Skia is currently using SkStream::NewfromFile so this is a good time to update it as well. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339273002 Review-Url: https://codereview.chromium.org/2339273002
* SkFontMgr_FontConfigInterface create typeface from FontParameters.Gravatar bungeman2016-09-01
| | | | | | | | | | | | This implements SkFontMgr_FontConfigInterface::onCreateFromStream(SkStreamAsset*, const FontParameters&) and makes the changes needed to support it. This will allow Chromium to create variation fonts from data. BUG=skia:5697 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2296843002 Review-Url: https://codereview.chromium.org/2296843002
* Remove user specified typeface id.Gravatar bungeman2016-07-13
| | | | | | | | | | | | Now that there may be multiple font managers in a process the typeface ids must be unique across all typefaces, not just unique within a font manager. If two typefaces have the same id there will be issues in the glyph cache. All existing font managers were already doing this by calling SkFontCache::NewFontID, so centralize this in SkTypeface. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147733002 Review-Url: https://codereview.chromium.org/2147733002
* Clean up SkFontConfigInterface implementation.Gravatar bungeman2016-05-02
| | | | | | | | | | | | | | | | | | Renames some classes to avoid confusion with FontConfig. Removed direct calls to FontConfig instead of calling FCI. Moves the globals and factory to one (optional) file. Moves font management code from typeface to font manager. Adds index to fonts created from streams. Associates FCI typefaces with the FCI instance which provides its identity. Simplifies the singleton initialization. Review-Url: https://codereview.chromium.org/1936213002
* Remove SK_VERY_LEGACY_CREATE_TYPEFACE.Gravatar bungeman2016-04-13
| | | | | | | | | The flag and code it guards are no longer used. TBR=reed This just removes dead code. Review URL: https://codereview.chromium.org/1882803002
* Begin switch to SkFontStyle for legacy calls.Gravatar bungeman2016-04-12
| | | | | | | | | | | | | | | | | | | This adds SK_VERY_LEGACY_CREATE_TYPEFACE which, when defined, provides only the old interface. Ideally, everyone would switch directly to SkFontMgr and use one of the newer calls, but there is currently no path for current users to get there. This updates all the internals to use SkFontStyle, after switching these over the higher level APIs can be switched. The Chromium follow on patch can be seen at https://crrev.com/1877673002 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1873923002 TBR=reed This doesn't really change API, just modernizes it. Review URL: https://codereview.chromium.org/1873923002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Remove SkFontHost includes and friends.Gravatar bungeman2015-02-23
| | | | | | | SkFontHost no longer exists as a class, so remove the includes and stop making it a friend. Review URL: https://codereview.chromium.org/943333004
* Clarify desired behavior of FontConfigTypeface::LegacyCreateTypeface.Gravatar bungeman2015-02-19
| | | | | | | | This should have no real effect on behavior, but cleans up some names and removes an unused parameter. This is a step toward separating the SkTypeface cache from the request cache. Review URL: https://codereview.chromium.org/936893002
* Remove FontConfigTypeface::getFamilyName().Gravatar bungeman2015-02-18
| | | | | | | This method is hiding a method of the same name from the superclass. This is confusing and error prone, and doesn't really add anything. Review URL: https://codereview.chromium.org/924333003
* SkTypeface to use SkStreamAsset.Gravatar bungeman2015-01-27
| | | | | | | SkTypeface already requires typeface streams to support SkStreamAsset in practice, and in practice all users are already supplying them. Review URL: https://codereview.chromium.org/869763002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Replace SkTypeface::Style with SkFontStyle.Gravatar bungeman2014-10-20
| | | | | | Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20 Review URL: https://codereview.chromium.org/488143002
* Revert of Replace SkTypeface::Style with SkFontStyle. (patchset #9 id:160001 ↵Gravatar mtklein2014-10-20
| | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/488143002/) Reason for revert: CrOS GM failures: [*] 2 ExpectationsMismatch: fontmgr_iter_565.png fontmgr_iter_8888.png Original issue's description: > Replace SkTypeface::Style with SkFontStyle. > > Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20 TBR=reed@google.com,bungeman@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/667023002
* Replace SkTypeface::Style with SkFontStyle.Gravatar bungeman2014-10-20
| | | | Review URL: https://codereview.chromium.org/488143002
* Add onGetFamilyName to SkTypeface.Gravatar bungeman2014-09-17
| | | | | | | | | | | This speeds up and documents this particular feature of SkTypeface and also frees up SkFontDescriptor to be used only in serialization. R=reed@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/574873002
* Factory methods for heap-allocated SkTypeface objects.Gravatar commit-bot@chromium.org2014-04-07
| | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkTypeface and its subclasses non-public and instead provides factory methods for creating these objects on the heap. BUG=skia:2187 R=scroggo@google.com, bungeman@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/227693003 git-svn-id: http://skia.googlecode.com/svn/trunk@14080 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_FONTHOST_USES_FONTMGR.Gravatar bungeman@google.com2013-11-11
| | | | | | Review URL: https://codereview.chromium.org/66783003 git-svn-id: http://skia.googlecode.com/svn/trunk@12217 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update the freetype backed fonthost to keep the style and fixed width ↵Gravatar djsollen@google.com2013-09-06
| | | | | | | | | | | | attributes for a font stream. This fixes a regression in Android when switching from FontHost_android R=reed@google.com Review URL: https://codereview.chromium.org/23966003 git-svn-id: http://skia.googlecode.com/svn/trunk@11134 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement onGetTableTags and onGetTableData on Windows.Gravatar bungeman@google.com2013-08-01
| | | | | | | | | Implements these and removes default implementation, making the declaration in SkTypeface pure virtual. Review URL: https://codereview.chromium.org/20672004 git-svn-id: http://skia.googlecode.com/svn/trunk@10500 2bbb7eff-a529-9590-31e7-b0007b416f81
* adapt FontConfig to use SK_FONTHOST_USES_FONTMGRGravatar reed@google.com2013-07-31
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/21331003 git-svn-id: http://skia.googlecode.com/svn/trunk@10463 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-05-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9159 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move the FontConfigTypeface class into private header.Gravatar djsollen@google.com2013-05-15
R=reed@google.com Review URL: https://codereview.chromium.org/15111004 git-svn-id: http://skia.googlecode.com/svn/trunk@9154 2bbb7eff-a529-9590-31e7-b0007b416f81