aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/fontmgr.cpp
Commit message (Collapse)AuthorAge
* remove fontmgr_iter_factory GMGravatar Mike Klein2017-11-14
| | | | | | | | | | This explicit use of direct write isn't necessary when the NativeFont bots will do it for us. Change-Id: I39427992d3fa3f602e97c72c5d41dc1b057eb46b Reviewed-on: https://skia-review.googlesource.com/71040 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* add platform_font_manager()Gravatar Mike Klein2017-11-13
| | | | | | | | | | | | | This string replaces {major_}platform_os_name() and platform_extra_config() for the font-focused GMs using them. The GDI bots will report "GDI", the NativeFont bots their OS, and other bots "". Change-Id: I8f7bb1ffea3cc91601c98b4ccff7a3a234ac77d3 Reviewed-on: https://skia-review.googlesource.com/70500 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Revert "migrate to sk_sp for SkFontMgr API""Gravatar Mike Reed2017-09-26
| | | | | | | | | | This reverts commit f40ae1a4b5365620463bd63b5140bd3fc78894a1. Bug: skia: Change-Id: I752606de92ea405d6e50219c98030409b00a2841 Reviewed-on: https://skia-review.googlesource.com/51160 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "migrate to sk_sp for SkFontMgr API"Gravatar Mike Reed2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4bf296be2821d2bdd0afabae9fdfe18e7e9b59cb. Reason for revert: need guard for flutter Original change's description: > migrate to sk_sp for SkFontMgr API > > Bug: skia: > Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8 > Reviewed-on: https://skia-review.googlesource.com/48740 > Commit-Queue: Ben Wagner <bungeman@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> TBR=bungeman@google.com,reed@google.com Change-Id: Ib0b2d00fcbcdb6131444f94d1046df6dae24f551 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/50940 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* migrate to sk_sp for SkFontMgr APIGravatar Mike Reed2017-09-25
| | | | | | | | Bug: skia: Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8 Reviewed-on: https://skia-review.googlesource.com/48740 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Don't use fonts with many glyphs in fontmgr_bounds.Gravatar Ben Wagner2017-07-24
| | | | | | | | | BUG=skia:6878 Change-Id: I015dff1bafc9433ce155eb1173c42d0eed6ae005 Reviewed-on: https://skia-review.googlesource.com/26202 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* Add strikeout font metrics.Gravatar Ben Wagner2017-07-21
| | | | | | | | | | | | | | This also updates create_test_font so that it can be built, compiles, and uses SkFontStyle instead of SkTypeface::Style. BUG=b/63669723 Change-Id: I6eb0f851853f4721cf8e5052255b5b6750c3257f Reviewed-on: https://skia-review.googlesource.com/24740 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Ben Wagner <bungeman@google.com>
* add drawString helper to canvasGravatar Cary Clark2017-04-28
| | | | | | | | | | | | | | | | | | Many tests and examples use drawText with a guess of how long the text is in bytes, or a call to strlen(). Add a helper to SkCanvas to simplify these examples. Add another helper for SkString. R=reed@google.com Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2 Reviewed-on: https://skia-review.googlesource.com/13642 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
* GM: some header cleanupGravatar Mike Klein2017-03-22
| | | | | | | | | | | | | | gm.h includes sk_tool_utils.h but does not use it. The bulk of this CL makes each gm that uses sk_tool_utils include it. sk_tool_utils.h also provided SkRandom and SkTDArray, so a couple GMs add those headers too. Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1 Reviewed-on: https://skia-review.googlesource.com/10014 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Remove SK_LEGACY_FONTMGR_FACTORY.Gravatar Ben Wagner2017-01-11
| | | | | | | | | | | | | SkFontMgr factories now return sk_sp and the legacy factories are no longer used and can be removed. BUG=skia:5077 Change-Id: Ieaff8555b297d1db157f8b78cdd6e7d07a3b5490 Reviewed-on: https://skia-review.googlesource.com/6894 Commit-Queue: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Stage SkFontMgr factories to return smart pointers.Gravatar Ben Wagner2017-01-04
| | | | | | | | | | | | | All the SkFontMgr factories currently return bare pointers and sometimes even document the ownership rules. Since such factories can be implemented by external ports, the ownership rules should be explicit in order to prevent simple reference counting issues. Change-Id: I25b598ce0954cd473a3fb1f8adc0cb86331583ca Reviewed-on: https://skia-review.googlesource.com/6533 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* gm: s/SkAutoTUnref/sk_sp/Gravatar Hal Canary2016-11-07
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4434 Change-Id: Ib2bea321617a17012190b33f2c7c439a5b6b3025 Reviewed-on: https://skia-review.googlesource.com/4434 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Replace a lot of 'static const' with 'constexpr' or 'const'.Gravatar mtklein2016-09-01
| | | | | | | | | | | | | | | | | | | | | | | 'static const' means, there must be at most one of these, and initialize it at compile time if possible or runtime if necessary. This leads to unexpected code execution, and TSAN* will complain about races on the guard variables. Generally 'constexpr' or 'const' are better choices. Neither can cause races: they're either intialized at compile time (constexpr) or intialized each time independently (const). This CL prefers constexpr where possible, and uses const where not. It even prefers constexpr over const where they don't make a difference... I want to have lots of examples of constexpr for people to see and mimic. The scoped-to-class static has nothing to do with any of this, and is not changed. * Not yet on the bots, which use an older TSAN. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300623005 Review-Url: https://codereview.chromium.org/2300623005
* Move SkTypeface to sk_sp.Gravatar bungeman2016-05-12
| | | | | | | Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002 Review-Url: https://codereview.chromium.org/1933393002
* Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of ↵Gravatar scroggo2016-05-12
| | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1933393002/ ) Reason for revert: fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm Original issue's description: > Move SkTypeface to sk_sp. > > Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@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/1974783002
* Move SkTypeface to sk_sp.Gravatar bungeman2016-05-11
| | | | Review-Url: https://codereview.chromium.org/1933393002
* Add oblique as a slant.Gravatar bungeman2016-04-27
| | | | | | | | | | | | | Some fonts have italic and oblique in the same family, see http://lucidafonts.com/fonts/family/lucida-sans http://www.gust.org.pl/projects/e-foundry/latin-modern GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1921903002 Chromium side change at https://crrev.com/1921503006/ . Review-Url: https://codereview.chromium.org/1921903002
* 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 bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* 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
* Generate platform specific fontmgr gm.Gravatar caryclark2015-07-20
| | | | | | | | | | | | | | | The gm output on different font platforms is so different that comparing images in Gold has little value. Separate the images by appending platform information to the gm name to group somewhat similar images together. Note that this does not attempt to make sure that all images generated by Gold are nearly pixel identical; it only reduces the number of nonsensical comparisons. R=bungeman@google.com Review URL: https://codereview.chromium.org/1245643002
* Remove system call in DW for default font.Gravatar bungeman2015-04-29
| | | | | | | | | | | The last user of the GDI default font in DW is onMatchFamilyStyleCharacter and it doesn't appear to actually need to use it. This change removes a system call, making things a bit faster, as well as eliminating a call blocked in the sandbox. BUG=chromium:459056 Review URL: https://codereview.chromium.org/1107283003
* 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 unused GM flagsGravatar mtklein2015-01-23
| | | | | | | | | | Depends on https://codereview.chromium.org/873753002/ Thumbs up to CLion for refactoring this for me. BUG=skia: Review URL: https://codereview.chromium.org/867963004
* 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
* Cleanup: More override fixes - another round.Gravatar tfarina2015-01-05
| | | | | | | | BUG=skia:3075 TEST=ninja -C out/Debug TBR=reed@google.com Review URL: https://codereview.chromium.org/831113002
* add paint::getFontBounds()Gravatar reed2014-12-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/804903006
* Remove SK_FM_NEW_MATCH_FAMILY_STYLE_CHARACTER.Gravatar bungeman2014-11-10
| | | | | | | | | This removes the old guarded code and enables the new api introduced with "Update fontMgr to take list of bcp47 language tags." c20386e3937d3d398ac9b35f9c7d997e972ade98 . Blink on Android is already using the new code. Review URL: https://codereview.chromium.org/705843004
* Update fontMgr to take list of bcp47 language tags.Gravatar bungeman2014-10-23
| | | | | | | | | This will enable clients to pass more than one bcp47 tag to ensure that the most appropriate font is selected. BUG=chromium:422180 Review URL: https://codereview.chromium.org/670243002
* Add SkTypeface::getBounds()Gravatar reed2014-10-22
| | | | | | | | | mirrored from https://codereview.chromium.org/666303002/ BUG=skia: TBR= Review URL: https://codereview.chromium.org/676523002
* Lookup glyphs based on character code and language tag.Gravatar djsollen2014-08-27
| | | | | | | | | | | | | This is particularly important on Android where we expect the FontManager to return different glyphs for the same character code depending on language. BUG=skia:2829 R=bungeman@google.com, tomhudson@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/492763003
* Pass the IDWriteFactory instead of relying on a global creator.Gravatar bungeman@google.com2014-03-31
| | | | | | | | | | | There are different variations or implementations of IDWriteFactory with different behaviors. Allow the user to specify the factory to use. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/218833005 git-svn-id: http://skia.googlecode.com/svn/trunk@14000 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix leak detected in FontMgrMatchGM::onDraw by Valgrind.Gravatar bungeman@google.com2013-11-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12242 2bbb7eff-a529-9590-31e7-b0007b416f81
* export SkFontMgr_New_... experimental functions for testing in chromeGravatar reed@google.com2013-08-28
| | | | | | | | | BUG= R=eae@chromium.org Review URL: https://codereview.chromium.org/23555004 git-svn-id: http://skia.googlecode.com/svn/trunk@10991 2bbb7eff-a529-9590-31e7-b0007b416f81
* allow both GDI and DW fontmgrs at the same timeGravatar bungeman@google.com2013-08-21
| | | | | | | | | | | | | BUG= R=bungeman@google.com Committed: https://code.google.com/p/skia/source/detail?r=10718 Committed: https://code.google.com/p/skia/source/detail?r=10788 Review URL: https://codereview.chromium.org/23058002 git-svn-id: http://skia.googlecode.com/svn/trunk@10851 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r10788 (allow both GDI and DW fontmgrs at the same time) due to ↵Gravatar robertphillips@google.com2013-08-20
| | | | | | Chromium XP bot failures git-svn-id: http://skia.googlecode.com/svn/trunk@10813 2bbb7eff-a529-9590-31e7-b0007b416f81
* allow both GDI and DW fontmgrs at the same timeGravatar bungeman@google.com2013-08-16
| | | | | | | | | | | BUG= R=bungeman@google.com Committed: https://code.google.com/p/skia/source/detail?r=10718 Review URL: https://codereview.chromium.org/23058002 git-svn-id: http://skia.googlecode.com/svn/trunk@10788 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r10718 to unblock rollGravatar robertphillips@google.com2013-08-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10759 2bbb7eff-a529-9590-31e7-b0007b416f81
* allow both GDI and DW fontmgrs at the same timeGravatar reed@google.com2013-08-14
| | | | | | | | | BUG= R=bungeman@google.com Review URL: https://codereview.chromium.org/23058002 git-svn-id: http://skia.googlecode.com/svn/trunk@10718 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add FontMgr to DirectWrite.Gravatar bungeman@google.com2013-05-01
| | | | | | | https://codereview.chromium.org/14314008/ git-svn-id: http://skia.googlecode.com/svn/trunk@8934 2bbb7eff-a529-9590-31e7-b0007b416f81
* show fontstyle values for each styleGravatar reed@google.com2013-04-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8843 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8452 2bbb7eff-a529-9590-31e7-b0007b416f81
* add matcher to fontstylesetGravatar reed@google.com2013-03-29
| | | | | | Review URL: https://codereview.chromium.org/13312002 git-svn-id: http://skia.googlecode.com/svn/trunk@8444 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-29
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8439 2bbb7eff-a529-9590-31e7-b0007b416f81
* disable tests that exercise serialization of fonts here, since we are ↵Gravatar reed@google.com2013-03-28
| | | | | | | | | | experimentally creating typeface styles that don't know how to serialize yet. git-svn-id: http://skia.googlecode.com/svn/trunk@8433 2bbb7eff-a529-9590-31e7-b0007b416f81
* add gm for experimental fontmgr apiGravatar reed@google.com2013-03-28
git-svn-id: http://skia.googlecode.com/svn/trunk@8426 2bbb7eff-a529-9590-31e7-b0007b416f81