- 16 3月, 2017 1 次提交
-
-
由 Roozbeh Pournader 提交于
Previously, in greedy line breaking, when a line overflowed, we found the best line breaking candidate before it and broke the line there. But we didn't check to see if the remaining part now fits in a line. With this change, we now repeat checking for overflows, and break again until we have no breaking opportunity or the remaining text now fits in a line. Also found an issue with greedy line breaking and keeping the hyphenation edit for the next line which is now fixed. Test: Manual. The issue reported in the bug is now fixed. Bug: 34185255 Bug: https://code.google.com/p/android/issues/detail?id=231437 Bug: 33560754 Change-Id: I93bdd341e4f8e1257710e453e4938f224cb2a1ff
-
- 15 3月, 2017 3 次提交
-
-
由 Seigo Nonaka 提交于
LayoutCache only keeps result of layout and can live after FontCollection is destructed by GC. This kind of failure will be captured by minikin_stress_tests in the subsequent CL (I1bf4ba43e6e97cd04e7d6dd42d388dd17ce64c7b) Test: ran minikin_tests Bug: 36223724 Change-Id: I639b73c0f1041549158c43212a901c82df4b02db
-
由 Roozbeh Pournader 提交于
Previously, we stayed on the conservative side and disallowed any grapheme breaks (and thus cursoring) where a virama was followed by a letter, since we did not know if the virama would be forming a cluster with the letter or not. This created problems with Indic languages with infrequent conjuncts, such as Tamil. Now we use the information in calculated advances to find if a cluster is formed. If there is no cluster, we break the grapheme and allow cursoring after the virama. Test: Unit tests added to GraphemeBreakTests and MeasurementTests. Test: Also manually tested Tamil sequences. Bug: 35721792 Change-Id: Ib159edb94b3ad6f693f0d3dad016b332b2cef447
-
由 Seigo Nonaka 提交于
This reverts commit 62ad5653. Bug: 36208043 Test: N/A Change-Id: I165ab7a0718ea50a8034adb6277809e271fd762c
-
- 14 3月, 2017 2 次提交
-
-
由 Seigo Nonaka 提交于
To share the calculated coverage information across the processes, make SparseBitSet serializable. Bug: 34042446 Test: minikin_tests passes Change-Id: I0463138adcf234739bb3ce1cdadf382021921f3e
-
由 Seigo Nonaka 提交于
This CL includes: - Stop using utils/Mutex and use std::mutex instead. - Stop using utils/Singleton. Test: minikin_tests passed Change-Id: Ib3f75b83397a546472bb5f91e066e44506e78263
-
- 13 3月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
This is 2nd attempt at I9e01d237c9adcb05e200932401cb1a4780049f86. The previous CL was reverted because 8-bit integers were too small to store the indices of mFamilyVec. This CL changes it to 16-bit integers since size_t is still unnecessary large. Theoretically, 32-bit integers are necessary for the indices of mFamilyVec since the size of mFamilyVec can be 0x10EE01. However, in practice, 16-bit integers are enough for the indices of mFamilyVec. The length of mFamilyVec for the system fonts is 2084. Even if the developers load their own very large fonts, it can only increase the number of elements in mFamilyVec to at most 0x10FF. As the result, memory usage of the FontCollections for the system fonts decreases as follows. 64-bit process: before: 398,264 bytes, after: 282,568 bytes (-115,696 bytes) 32-bit process: before: 199,132 bytes, after: 149,548 bytes (-49,584 bytes) Bug: 33562608 Test: Verified Emoji and CJK characters are present. Test: android.text.cts.EmojiTest passed Test: Minikin unit tests passed Change-Id: I6796fd55ac30fe30528a212ebf6097b1d672e2f8
-
- 07 3月, 2017 1 次提交
-
-
由 Roozbeh Pournader 提交于
With this change, different languages can have a different minimum length for suffix and prefixes when hyphenating. Previously, the defaults used for English, 2 and 3, were used for every language. Bug: 35712376 Test: Minikin unit tests were updated and the pass Change-Id: Iffaf11c6b208c57d28d45b17246e177572dc1210
-
- 03 3月, 2017 1 次提交
-
-
由 Roozbeh Pournader 提交于
This adds better support for Arabic script languages, Armenian, Catalan, Hebrew, Kannada, Malayalam, Polish, Tamil, and Telugu by adding various hyphenation types and edits appropriate for the locales. For Arabic script languages, soft hyphens act transparently with regard to joining: If a line is broken at a soft hyphen where the two characters around the soft hyphen were joining each other before, they will continue to appear joining if the line is broken at the soft hyphen and a hyphen glyph is inserted. This is needed for Central Asian languages such as Uighur. For Armenian, U+058A ARMENIAN HYPHEN is used for line breaks caused by either automatic hyphenation or soft hyphens. For Catalan, nonstandard line breaks are implemented for "l·l", which hyphenates as "l-/l". For Polish, when there is a line break at a hyphen, the hyphen is repeated at the next line. For the South Indic languages, when breaks happen due to soft breaks or automatic hyphenation, no visible hyphen is inserted, although a penalty is added. For Hebrew, support for using U+05BE HEBREW PUNCTUATION MAQAF has been implemented, but it's turned off pending confirmation of desirability. Also, hard hyphens, which previously had no penalty added for breaking the line after them, now have the same penalty as an automatic or soft break, with the difference that no hyphen is inserted when they break. Finally, some bugs have been fixed with hyphenating multiscript and multi-font words. Bug: 19950445 Bug: 19955011 Bug: 25623243 Bug: 26154469 Bug: 26154471 Bug: 33387871 Bug: 33560754 Bug: 33752592 Bug: 33754204 Test: Unit tests added, plus thorough manual testing Change-Id: Iaccf776ce8d1d434ee8b1c534ff3659d80fdc338
-
- 24 2月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
Let's use shared_ptr since manual ref counting can be a bug-prone and using the global mutex inside destructor is not useful for some time. To remove raw pointer manipulation, needed to change Layout constructors. Layout is no longer copyable and need to pass FontCollection to constructor. Bug: 28119474 Test: minikin_tests passed Test: hwui_unit_tests passed Test: No performance regression in minikin_perftest. Change-Id: I8824593206ecba74cbc9731e298f045e1ae442a3
-
- 22 2月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
Test: None Change-Id: I203d9ba7e1a1fcfdb10cd6a711d9a35136cbddd6
-
- 31 1月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
This is 2nd attempt of I08e9b74192f8af1d045f1276498fa4e60d73863e. The original CL was reverted due to conflicting with another CL submitted before. Here is the original commit message of reverted change. This lays the groundwork for variation settings support. Since we should regard different variations of a font as different fonts, we need to create new typefaces. To reuse the same instance of MinikinFont, as much as possible, FontFamily::createFamilyWithVariation now reuses an existence instance, while incrementing the reference count. Test: minikin_tests Bug: 33062398 Change-Id: Ib25bf1bb5a5191e15a6523954146521464c91906
-
- 20 1月, 2017 3 次提交
-
-
由 Seigo Nonaka 提交于
This is 2nd attempt of 41e02e96 The difference is adding clearElementsEithLock to Font class which is necessary to delete Fonts object outside of minikin. This method should be removed once http://b/28119474 is fixed. Here is original commit message of reverted change. This lays the groundwork for making SparseBitSet serializable. FontFamily.addFont is only used when the FontFamily is constructed. Thus, instead of calling FontFamily.addFont multiple time, passes Font list to the constructor. By this change, FontFamily can be immutable now. By making FontFamily immutable, We can create FontFamily with pre-calculated SparseBitSet. Bug: 34042446 Bug: 28119474 Bug: 34378805 Test: minikin_tests has passed Change-Id: Ice433931196f5ae79a1a7ee0c98020f914aeb5f2
-
由 Siyamed Sinir 提交于
This reverts commit 41e02e96. Bug: 34378805 Change-Id: I8f1ee00b365c8b17c6140e9e286fbea082e31364
-
由 Siyamed Sinir 提交于
This reverts commit 90e6b188. Bug: 34378805 Change-Id: I22b683f774813724f220b1b8584ab188f3cf4fa7
-
- 13 1月, 2017 1 次提交
-
-
由 Siyamed Sinir 提交于
This reverts commit c4b989fc. Test: Manually tested Bug: 34247671 Change-Id: I0510009b2deac784770f26059681b1980800abc8
-
- 12 1月, 2017 2 次提交
-
-
由 Seigo Nonaka 提交于
This lays the groundwork for variation settings support. Since we should regard different variations of a font as different fonts, we need to create new typefaces. To reuse the same instance of MinikinFont, as much as possible, FontFamily::createFamilyWithVariation now reuses an existence instance, while incrementing the reference count. Test: minikin_tests Bug: 33062398 Change-Id: I08e9b74192f8af1d045f1276498fa4e60d73863e
-
由 Seigo Nonaka 提交于
This lays the groundwork for making SparseBitSet serializable. FontFamily.addFont is only used when the FontFamily is constructed. Thus, instead of calling FontFamily.addFont multiple time, passes Font list to the constructor. By this change, FontFamily can be immutable now. By making FontFamily immutable, We can create FontFamily with pre-calculated SparseBitSet. Bug: 34042446 Test: minikin_tests has passed Change-Id: I2576789fba6cb27687e920e2488e8bedbcf7d36f
-
- 06 1月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
Since switching to 64-bit devices, size_t is now a 64-bit integer. FontCollection::Range uses two size_t integers but they just point to an index in mFamilies. To reduce the memory usage, this CL changes the size_t integers to uint8_t. The maximum size of each integer in Range is the size of FontCollection::mFamilies. The largest this can go is the system font list plus a user defined family, which has 91 families. So an 8-bit integer should be enough. With this change, about 84 KiB of memory will be saved per font collection. Since eight font collections are created during bootstrap, about 670 KiB of memory will be saved with this CL. Bug: 33562608 Test: Ran FontCollection.collectionAllocationSizeTest on a 64-bit device. On my Nexus 5X, it changed from 327358 to 241342. Change-Id: I9e01d237c9adcb05e200932401cb1a4780049f86
-
- 02 1月, 2017 1 次提交
-
-
由 Seigo Nonaka 提交于
Add an "mJustified" for justification, and tune the line breaking to produce good results. Major differences for fully justified text include: - Space can be shrunk in justified text. - Hyphenation should be more aggressive in justified text. Also adds a penalty for the last line being very short. This is tuned to be more aggressive for ragged right than for justified text. This is based on a patch by Raph Levien (raph@google.com). Bug: 31707212 Test: Manually tested with Icbfab2faa11a6a0b52e6f0a77a9c9b5ef6e191da Change-Id: If366f82800831ccc247ec07b7bc28ca4c6ae0ed6
-
- 17 11月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
This is 2nd attempt of Ifcd7a348d7fb5af081192899dbcdfc7fb4eebbf9 After Id766ab16a8d342bf7322a90e076e801271d527d4, GetTable is no longer used in production due to poor performance and it is now only used in tests. This CL removes GetTable interface from MinikinFont and update tests code to use new interfaces, GetFontData, GetFontSize and GetFontIndex. Bug: 27860101 Test: Manually done Change-Id: Ib48973ff25cdc61a4c666d28128266df0aaea83e
-
- 16 11月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
Add a wordSpacing paint parameter, which will be used for justification. Bug: 31707212 Test: ran minikin_tests Change-Id: I91224ab8ef882ac0c87425c28ab731fead283612
-
- 25 10月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
This reverts commit 1d525df4. This causes a crash on Android Auto. Bug: 32374752 Change-Id: Ia2ff77bf9a12351c6949f79ef6fa2d8016e3022d
-
- 18 10月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
After Id766ab16a8d342bf7322a90e076e801271d527d4, GetTable is no longer used in production due to poor performance and it is now only used in tests. This CL removes GetTable interface from MinikinFont and update tests code to use new interfaces, GetFontData, GetFontSize and GetFontIndex. Bug: 27860101 Test: Manually done Change-Id: Ifcd7a348d7fb5af081192899dbcdfc7fb4eebbf9
-
- 13 9月, 2016 1 次提交
-
-
由 Elliott Hughes 提交于
Bug: http://b/22403888 Change-Id: I9e18496fcc38ad2e6b922455daa9f2a46778ec55
-
- 16 8月, 2016 2 次提交
-
-
由 Chih-Hung Hsieh 提交于
* Add explicit keyword to conversion constructors, or add NOLINT(implicit) for implicit converters. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I0c7b90f9bb953a9f2e4f0fb2032fa65ac604b9ca Merged-In: I0c7b90f9bb953a9f2e4f0fb2032fa65ac604b9ca
-
由 Chih-Hung Hsieh 提交于
* Add explicit keyword to conversion constructors, or add NOLINT(implicit) for implicit converters. Bug: 28341362 Test: build with WITH_TIDY=1 Change-Id: I0c7b90f9bb953a9f2e4f0fb2032fa65ac604b9ca
-
- 10 6月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
Here is a new policy of the namespace of minikin. - All components should be in minikin namespace. - All tests are also in minikin namespace and no anonymous namespace. Bug: 29233740 Change-Id: I71a8a35049bb8d624f7a78797231e90fed1e2b8c
-
- 15 4月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
Minikin has a special font fallback for VS15/VS16, so hasVariationSelector for emojis with VS15/VS16 should always return true. Bug: 27531970 Change-Id: Ieebd58f48b135b6ec50d999df68dcc09b1284606
-
- 13 4月, 2016 1 次提交
-
-
由 Raph Levien 提交于
There was the possibility of stale indents from previous invocations persisting in the mLineWidths across multiple invocations. This patch clears them. Bug: 28090810 Change-Id: I3621dfbe983512046289373711709aeade52eab4
-
- 12 4月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
This CL fixes following test cases in minikin_tests - FontFamilyTest.hasVariationSelectorTest - HbFontCacheTest.getHbFontLockedTest - HbFontCacheTest.purgeCacheTest For the fix of FontFamilyTest.hasVariationSelectorTest, removing virtual from GetUniqueId() in MinikinFont. After [1], MinikinFont's destructor started calling purgeHbCache() which calls virtual method, MinikinFont::GetUniqueId(). Fortunately, the SkTypeface::uniqueID() returns just internal value, so we can store it at the construction time and use it instead of calling SkTypeface::uniqueID() every time. This patch also changes purgeHbFont to purgeHbFontLocked, as all uses of it were already under global mutex. This change avoids deadlock on explicit unref, as when invoked by a Java finalizer from the Java object that holds a reference to the font. Some of the tests needed to change to using the ref counting protocol rather than explicitly destructing font objects, as well. [1] 9afcc6e2 Bug: 28105730 Bug: 28105688 Change-Id: Ie5983c4869147dacabdca81af1605066cd680b3f
-
- 08 4月, 2016 2 次提交
-
-
由 Raph Levien 提交于
The hb_font_t object holds on to tables of font data, acquired through the MinikinFont::GetTable interface, which is based on copying data into caller-owned buffers. Now that we're caching lots of hb_font_t's, the cost of these buffers is significant. This patch moves to a different interface, inspired by HarfBuzz's hb_reference_table API, where the font can provide a pointer to the actual font data (which will often be mmap'ed, so it doesn't even consume physical RAM). Bug: 27860101 Change-Id: Id766ab16a8d342bf7322a90e076e801271d527d4
-
由 Raph Levien 提交于
This patch eagerly purges the corresponding hb_font_t object from the HbFontCache when the underlying MinikinFont is destroyed. After that, the key will no longer be accessed, so having the entry is wastes memory. Bug: 27251075 Bug: 27860101 Change-Id: I1b98016133fe3baf6525ac37d970a65ddccadb4f
-
- 04 3月, 2016 1 次提交
-
-
由 Seigo Nonaka 提交于
Bug: 26808815 Change-Id: I2a5a52f2c441d27c7ef270342b4ef93c3de9e56e
-
- 19 2月, 2016 1 次提交
-
-
由 Keisuke Kuroyanagi 提交于
With this CL, measureText is used for getRunAdvance, getOffsetForAdvance and line breaking. Bug: 24505153 Change-Id: Ib699f6b1391b46537736fc274cdb41686586b550
-
- 18 2月, 2016 3 次提交
-
-
由 Raph Levien 提交于
Recent changes have added special cases for line breaks within URLs and email addresses. Such breaks are undesirable when they can be avoided, but at other times are needed to avoid huge gaps, or indeed to make the line fit at all. This patch assigns a penalty for such breaks, equal to the hyphenation penalty. The mechanism is currently very simple, but would be easy to fine-tune based on more detailed information about break quality. Bug: 20126487 Bug: 20566159 Change-Id: I0d3323897737a2850f1e734fa17b96b065eabd9c
-
由 Raph Levien 提交于
This change adds accceptable line breaks according to sections 7.42 (Dividing URLs and e-mail addresses) and 14.12 (URLs or DOIs and line breaks) of the Chicago Manual of Style (16th ed.). In general, these place breaks before punctuation symbols, and suppresses them after hyphens. Bug: 20126487 Bug: 20566159 Change-Id: I2d07d516b920a506a2f718c38fb435c5eb1ee1f8
-
由 Raph Levien 提交于
Detect URLs and email addresses, and suppress both line breaking and hyphenation within them. Bug: 20126487 Bug: 20566159 Change-Id: I43629347a063dcf579e355e5b678d7195f453ad9
-
- 17 2月, 2016 2 次提交
-
-
由 Seigo Nonaka 提交于
Before this patch, the font fallback chain iterated all installed font families if a variation selector was specified. This CL narrows down the range of iteration. To decide the font family for the variation sequence, we need to search for both the variation sequence and its base code point. The new range of the iteration is a union of them. With this change, the running time of Paint.hasGlyph for the variation sequence improves 50% and the running time of Paint.measureText for the variation sequence improves 40% for the large text case on Nexus 6 userdebug. Bug: 26784699 Bug: 11750374 Change-Id: Iced1349e3ca750821d8882c551551f65bb569794
-
由 Raph Levien 提交于
Implement a WordBreaker that defines our concept of valid word boundaries, customizing the ICU behavior. Currently, we suppress line breaks at soft hyphens (these are handled specially). Also, the new WordBreaker class has methods that determine the start and end of the word (punctuation stripped) for the purpose of hyphenation. This patch, in its current form, doesn't handle email addresses and URLs specially, but the WordBreaker class is the correct place to do so. Also, special case handling of hyphens and dashes is still done in LineBreaker, but all of that should be moved to WordBreaker. Bug: 20126487 Bug: 20566159 Change-Id: I492cbad963f9b74a2915f010dad46bb91f97b2fe
-