summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Move coverage bitmap from FontCollection to FontFamily"stable/cm-12.0-YNG4Nstable/cm-12.0-YNG3Cstable/cm-12.0-YNG1TAstable/cm-12.0-YNG1Tstable/cm-12.0-YNG1Icm-12.0Steve Kondik2015-02-264-63/+60
| | | | | | | | * Seeing sporadic crashes with this patch. Reverting for now. This reverts commit 4e4ab1a6c8347e977245d1126d10e48a3412d35d. Change-Id: Ibcda62e8268e9a5559c0517695fa61f36f0d34d0
* Move coverage bitmap from FontCollection to FontFamilyRaph Levien2015-02-134-60/+63
| | | | | | | | | | This will significantly reduce memory usage and also speed the creation of new font families. In particular, the coverage bitmaps for the fonts in the fallback stack will be computed once in the Zygote, rather than separately in each app process. Bug: 17756900 Change-Id: I66f5706bddd4658d78fe5b709f7251ca9d2ff4f8
* Fine-tune fake-bolding conditionstaging/cm-12.0-cafRaph Levien2014-09-221-4/+4
| | | | | | | | | | The old logic for fake bolding results in no fake bolding for a bold span on a light weight (300) because the target weight (600 in this case) didn't meet the condition. This patch fine-tunes the threshold to enable fake bolding for this. Bug: 17587185 Change-Id: I04abd00a74240cbed79c417f81486aa2158b2806
* Snap advance widths to integersRaph Levien2014-09-032-8/+24
| | | | | | | | | | | | | Fractional advance widths were causing subtle problems with text positioning when the same text was drawn with different spans in the hwui renderer. Quantizing the coordinates on layout (as opposed to waiting until the renderer draws the glyphs) solves the problem. This patch also fixes a discrepancy between x position and advance widths when letterspacing. Bug: 17347779 Change-Id: Ia705944047408c2839d5ad078eefd6bbec446872
* Try Unicode decomposition for selecting fallback fontRaph Levien2014-08-261-1/+15
| | | | | | | | | | | This patch finds an appropriate fallback font in the case where no font directly maps the requested character, but a font does exist for the character's canonical decomposition. This yields correct rendering of compatibility characters such as U+FA70. Bug: 15816880 Bug: 16856221 Change-Id: Idff8ed6b942fec992a0815a32028b95af091d0ee
* Allocate font vector on stackBehdad Esfahbod2014-08-211-3/+12
| | | | | | | | This reduces another allocation (last one?) we were doing when fulfilling shaping requests from the cache. Bug: 17111260 Change-Id: Ieb8ae1ccfcaacedb257e1e9263777f10623aaf98
* Fix Layout initialization in the skipCache pathBehdad Esfahbod2014-08-212-8/+20
| | | | | | | | | | | | | | C++ local var initialization always tricks me. Previously, Layout didn't have a constructor, which meant that defining it on the stack left mAdvance uninitialized. This was not an issue when we were doing "new Layout()", since that invokes zero-initialization, but was an issue for the skipCache path that was allocating layout on stack by just "Layout l" instead of "Layout l = Layout()". To avoid surprises, add a constructors that clears everything. Also adds reset() method to reset the layout for reuse. Change-Id: I3e02f00da9dd7d360abe13f63c310f6882292d0a
* Speed up cache lookupBehdad Esfahbod2014-08-212-35/+66
| | | | | | | Avoid copying the string for cache lookup. Bug: 17111260 Change-Id: Ic220bfc991fc6b3dada197304aabdf72a8941bd7
* Choose same font for Emoji keycap and its base characterBehdad Esfahbod2014-08-081-2/+17
| | | | | | | | | | | | | The U+20E3 COMBINING KEYCAP is used in our fonts to generate an emoji rendering of ASCII numbers and letters through GSUB. For that to work we need to choose the same (Emoji) font for the character coming *before* the COMBINING KEYCAP character. This is a special-case of a broader need to choose fonts per grapheme cluster as opposed to per character, but for now, special-case U+20E3. Bug: 7557244 Change-Id: I958e5a01068df8495bbb9bc3b9ed871cea1838b6
* Support fontFeatureSettingsBehdad Esfahbod2014-07-302-14/+33
| | | | | Bug: 15246510 Change-Id: I544915d29b2be4fb9f82f1989188a3a918c50fbc
* Fix examples buildBehdad Esfahbod2014-07-292-3/+10
| | | | | | Was broken after recent CSS removal. Change-Id: I160fbc73286b21336d6f3943ff92d7d150dff74b
* Merge "Remove CSS string doLayout entrypoint and supporting code" into lmp-devBehdad Esfahbod2014-07-275-369/+0
|\
| * Remove CSS string doLayout entrypoint and supporting codeBehdad Esfahbod2014-07-295-369/+0
| | | | | | | | | | | | | | All usage is ported to the new doLayout() API now. Bug: 16651112 Change-Id: I2c959138a69853b5e30098889d771fe5f4cfaa66
* | Initialize MinikinPaint membersBehdad Esfahbod2014-07-291-0/+2
|/ | | | | | | | We are stack-allocating MinikinPaint objects in Minikin clients, and without a constructor adding new members to the struct cannot be done without updating all clients (only one right now!). Change-Id: I4170f16498bb6b07cb795495011aca58087ed0bd
* Add doLayout variant that does NOT take css stringBehdad Esfahbod2014-07-292-8/+24
| | | | | | | New API removes CSS string and directly takes needed objects. Bug: 16651112 Change-Id: Ie5f7c2ab05be6cbd77cae0a5fd6bb453771ada59
* Merge "Don't get stuck on invalid UTF-16" into lmp-devBehdad Esfahbod2014-07-241-4/+3
|\
| * Don't get stuck on invalid UTF-16Behdad Esfahbod2014-07-251-4/+3
| | | | | | | | | | | | | | | | Replaces invalid unicode with replacement character U+FFFD and always makes forward progress. Bug: 15849380 Change-Id: Ic59ef6c64b0f5c4450bcae61597adcc269d6e7c5
* | Towards CSS removalBehdad Esfahbod2014-07-243-17/+45
|/ | | | | | | Extract language from FontStyle during shaping. Don't attach CSS to LayoutContext. Change-Id: Ie621d3415410178d0d15fa7b810eb8e412342ab6
* Remove deprecated APIBehdad Esfahbod2014-07-244-23/+5
| | | | | | It has been unused outside minikin. Change-Id: Iaa2237767d81c77f90d0264e633375e601dd72f1
* Add letter-spacing supportBehdad Esfahbod2014-07-224-4/+45
| | | | | Bug: 15594400 Change-Id: Ied94d7674be4097b0f44c9b0770d3294dc6433c1
* Don't pass invalid Unicode codepoint to SkiaBehdad Esfahbod2014-07-111-0/+6
| | | | | Bug: 15849380 Change-Id: Ib5285e57c5806bd399600fadd56e8bc809da323f
* Merge "Use __builtin_clzl if element is long"Behdad Esfahbod2014-07-101-2/+2
|\
| * Use __builtin_clzl if element is longBehdad Esfahbod2014-07-101-2/+2
| | | | | | | | Change-Id: I50a112739847fa826088854f6d172a188ff4cfb3
* | Switch minikin to the new icu.Elliott Hughes2014-07-102-3/+3
| | | | | | | | Change-Id: I29a59edfe6102257c9f308aac1b4348ef7a18db7
* | Assign non-coverage font runs to base fontRaph Levien2014-07-091-3/+5
|/ | | | | | | | | | | | When a run has no cmap coverage in any font, use the base font. Most of the time, this will cause rendering of the .notdef glyph, which is preferable to displaying nothing. In some cases, Harfbuzz may be able to decompose the characters (not in the cmap) to ones that are, in which case we'll render those, as long as they're in the base font. Bug: 6629748 Bug: 15816880 Change-Id: Ibb1b9242c83626e0c7db363ad65ce44a967a005e
* setConfig is deprecatedMike Reed2014-07-071-4/+3
| | | | Change-Id: Iffad3ef724b565d5d8fed17722630fd74cda9234
* Disable "palt" OpenType featureRaph Levien2014-06-261-0/+6
| | | | | | | | Proper Japanese layout requires sophisticated rules for spacing punctuation, not just turning on the "palt" (proportional alternate) feature. Until we can support the whole set, roll back palt. Change-Id: If2359c529b70b1dd45dddc00e5f4aa1c91f8b0e9
* Add purgeCaches() methodRaph Levien2014-06-252-0/+11
| | | | | | | Expose a method to purge caches used for TextLayout, useful for low memory conditions. Change-Id: I92f41afe987b7be4af5ca0a0c50fb51be35a2758
* Implement grapheme cluster breakingRaph Levien2014-06-193-0/+180
| | | | | | | | | | | | This patch includes an implementation of grapheme cluster breaking, which is especially useful for repositioning the cursor for left and right arrow key presses. The implementation is closely based on Unicode TR29, and uses the ICU grapheme cluster break property, but is tailored to more closely match the existing implementation and expected behavior. Part of a fix for b/15653110 Improve behavior of arrow keys in EditText Change-Id: I8eb742f77039c9ab7b2838285018cf8a8fc88343
* Make font runs less stickyRaph Levien2014-06-191-2/+17
| | | | | | | | | | | | | | Fixes b/15734816 In the text "Wi-Fi", "-Fi" appears bolder than "Wi" The problem was caused by "stickiness" in choosing fonts, where layout would prefer using a font used for preceding characters as long as it mapped the following characters in a run, in favor of the "best match" rules. This patch adds a whitelist for making the stickiness more conservative, only applying it for characters necessary for correct shaping (ZWJ and ZWNJ in particular) and basic punctuation, where it is desirable to match the style of the preceding text. Change-Id: I1cf116879f074a5a71c351846707bfdd07b0d320
* am e68467e9: Tighten requirements for fake boldRaph Levien2014-06-120-0/+0
|\ | | | | | | | | * commit 'e68467e971390f0c79992cd938a870093a3d6412': Tighten requirements for fake bold
| * Tighten requirements for fake boldRaph Levien2014-06-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | The simple predicate for fake bold (2 or more grades darker than requested) was applying it to thin (100 weight) when normal was requested. This patch tightens the predicate to also require that the requested weight be in the bold range. Fix for bug 15588352 "sans-serif-thin doesn't work on lockscreen" Change-Id: Id9988bd149a9c8a7c943e3b221f7fb4b37fb6ddb (cherry picked from commit 9f9f3b1ef40f7358dca6acd9dfef686cedefb6aa)
* | am 15651697: (-s ours) Support for fake bold and italicsRaph Levien2014-06-120-0/+0
|\| | | | | | | | | * commit '1565169734dbed6d59cc10f2a7de01f8601533e0': Support for fake bold and italics
| * Support for fake bold and italicsRaph Levien2014-06-117-39/+70
| | | | | | | | | | | | | | | | | | | | This patch adds support for computing when fake bold and fake italics are needed (because the styles are requested but not provided by the matching FontFamily), and providing them as part of the layout result. Part of the fix for bug 15436379 Fake bold doesn't fully work (Minikin) Change-Id: I180c034b559837943673b5c272c8e890178dff0d
* | am b1eae5ea: (-s ours) Add baseFont method to FontCollectionRaph Levien2014-06-120-0/+0
|\| | | | | | | | | * commit 'b1eae5ea1f0f1303d155ee550f9aa94acd0127c5': Add baseFont method to FontCollection
| * Add baseFont method to FontCollectionRaph Levien2014-06-112-0/+11
| | | | | | | | | | | | | | | | | | | | This patch adds a method to retrieve the base font from a FontCollection, which is useful when querying global font metrics. Part of the fix for bug 15467288 "Inconsistent line heights on Minikin builds" Change-Id: I268ae5128d0852a020d746bc22af81fc1a623228
* | Merge "Fix missing text on nonexistent font file"Raph Levien2014-06-111-6/+7
|\ \
| * | Fix missing text on nonexistent font fileRaph Levien2014-06-111-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for bug 15570313 "Missing text on nonexistent font file" This patch makes sure that the lastChar and mInstances arrays are in sync with each other even when a FontFamily being added has no valid fonts in it. Previously, when they got out of sync, unicode coverage calculation would be wrong, resulting in missing text. Change-Id: I69c727ef69e2c61e2b2d6b81d5a28c806327f865
* | | Tighten requirements for fake boldRaph Levien2014-06-121-3/+5
|/ / | | | | | | | | | | | | | | | | | | | | The simple predicate for fake bold (2 or more grades darker than requested) was applying it to thin (100 weight) when normal was requested. This patch tightens the predicate to also require that the requested weight be in the bold range. Fix for bug 15588352 "sans-serif-thin doesn't work on lockscreen" Change-Id: Id9988bd149a9c8a7c943e3b221f7fb4b37fb6ddb
* | Merge "Provisionally enable "palt" OpenType feature"Raph Levien2014-06-101-1/+10
|\ \
| * | Provisionally enable "palt" OpenType featureRaph Levien2014-06-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to test configurations where the Noto Japanese font will have its "palt" feature (to select tighter spacing in kana) will be enabled for framework but not WebView or Chrome rendering of Japanese text. This patch simply hardcodes this feature on. This is also a first step towards more general setting of OpenType features. The hardcoded feature list will grow into one set by parameters which will eventually be plumbed up to Java. Change-Id: Ie284e0487a1434155c8ac1cb68ddc4fc4b3c018a
* | | Support for fake bold and italicsRaph Levien2014-06-107-39/+70
|/ / | | | | | | | | | | | | | | | | | | This patch adds support for computing when fake bold and fake italics are needed (because the styles are requested but not provided by the matching FontFamily), and providing them as part of the layout result. Part of the fix for bug 15436379 Fake bold doesn't fully work (Minikin) Change-Id: I180c034b559837943673b5c272c8e890178dff0d
* | Add baseFont method to FontCollectionRaph Levien2014-06-062-0/+11
| | | | | | | | | | | | | | | | | | This patch adds a method to retrieve the base font from a FontCollection, which is useful when querying global font metrics. Part of the fix for bug 15467288 "Inconsistent line heights on Minikin builds" Change-Id: I268ae5128d0852a020d746bc22af81fc1a623228
* | reset sha1 3f1ea5d with historyQiwen Zhao2014-06-050-0/+0
|\ \ | |/ |/|
| * am 89339973: Fix unmatching typeRaph Levien2014-06-051-1/+1
| |\ | | | | | | | | | | | | * commit '893399732b64203133c22ad3c1f3535e46bf35a7': Fix unmatching type
| * \ am 448b0fd7: Support for scaleX and skewXRaph Levien2014-06-054-15/+43
| |\ \ | | | | | | | | | | | | | | | | * commit '448b0fd720d7ba902b9be224a287d08abe3ebea8': Support for scaleX and skewX
| * \ \ am 066e8575: Fix ZWJ not working for Indic fontsRaph Levien2014-05-292-27/+25
| |\ \ \ | | | | | | | | | | | | | | | | | | | | * commit '066e8575af64fb452617ac6005de6ccf6509553b': Fix ZWJ not working for Indic fonts
| * \ \ \ am 7b221d97: Language and variant selectionRaph Levien2014-05-297-22/+214
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * commit '7b221d97b7b64dc5ce457e19666d55d042e22e62': Language and variant selection
| * \ \ \ \ am 0297ee98: Fix for Minikin native crashRaph Levien2014-05-291-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0297ee985c26b49fc2a3b0941db354c27f436bbf': Fix for Minikin native crash
| * \ \ \ \ \ am 7c382381: Fix for bug 15252902 native crash in MinikinRaph Levien2014-05-271-4/+4
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c382381191b2280b53c375fe83dfc6217bbdfa9': Fix for bug 15252902 native crash in Minikin