SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Downloaden Sie, um offline zu lesen
Recent Text Features
Old and New features
Seigo Nonaka
Android Text @ Google
@ttuusskk
PrecomputedText
● Used for background text layout
● Easy integration with RecyclerView
recyclerView.adapter =
object: RecyclerView.Adapter<Holder>() {
override fun onBindViewHolder(holder: Holder,
position: Int) {
Holder.view.apply {
setTextFuture(
PrecomputedTextCompat.getTextFuture(
sampleText[position],
textMetricsParamsCompat,
null)
)
}
}
}
Performance
Improvement
● Removed global mutex lock during doing
text layout.
0
25
50
75
100
milliseconds
125
150
175
API27
API27
API27
API28
1 thread 2 threads 4 thread 8 threads
34.9
49.0
82.1
318.7
22.1 22.5
26.5
82.6
Typeface.Builder
● Replacement for createFromAsset,
createFromFile.
● Variable Font Support (later)
● Font Collection Support
textView1.typeface =
Typeface.Builder(assets, "NotoSansCJK-Regular.ttc")
.setTtcIndex(0).build()
textView2.typeface =
Typeface.Builder(assets, "NotoSansCJK-Regular.ttc")
.setTtcIndex(1).build()
textView3.typeface =
Typeface.Builder(assets, "NotoSansCJK-Regular.ttc")
.setTtcIndex(2).build()
textView4.typeface =
Typeface.Builder(assets, "NotoSansCJK-Regular.ttc")
.setTtcIndex(3).build()
Variable Font
● OpenType Variable Font
● Either string representation or
FontVariationAxis class can be
used.
textView1.typeface =
Typeface.Builder(assets, "AdobeVFPrototype.ttf")
.setFontVariationSettings("'wght' 200").build()
textView2.typeface =
Typeface.Builder(assets, "AdobeVFPrototype.ttf")
.setFontVariationSettings("'wght' 400").build()
textView3.typeface =
Typeface.Builder(assets, "AdobeVFPrototype.ttf")
.setFontVariationSettings("'wght' 700").build()
textView4.typeface =
Typeface.Builder(assets, "AdobeVFPrototype.ttf")
.setFontVariationSettings("'wght' 900").build()
Locale List Fallback
● Font selector is now aware of locale list
● By default, system locale settings is
used.
textView1.textLocales =
LocaleList.forLanguageTags("en-US,ja-JP")
textView2.textLocales =
LocaleList.forLanguageTags("en-US,zh-CN")
textView3.textLocales =
LocaleList.forLanguageTags("en-US,zh-TW")
textView4.textLocales =
LocaleList.forLanguageTags("ja-JP,zh-TW")
Serif Fallback
● System font is now aware of serif font.
● Use serif font if fonFamily=”serif” is
specified.
Justification
● Justification by whitespaces
● API is available since API 26, but due to
bug, please use it API 28+
Line Spacing
Improvement
● Avoid glyph overlap for the taller glyph
languages.
● Enabled by default API 28+
● You can move back to old impl by
specifying fallbackLineSpacing=”false”
Thank you for your attention!

Weitere ähnliche Inhalte

Was ist angesagt?

XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
Vincent Massol
 
Switching to angular.js silk way
Switching to angular.js   silk waySwitching to angular.js   silk way
Switching to angular.js silk way
Pavlo Iuriichuk
 

Was ist angesagt? (19)

XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and SharepointXWiki: wiki collaboration as an alternative to Confluence and Sharepoint
XWiki: wiki collaboration as an alternative to Confluence and Sharepoint
 
Supercharge your next Vue app with Nuxt
Supercharge your next Vue app with NuxtSupercharge your next Vue app with Nuxt
Supercharge your next Vue app with Nuxt
 
Getting Reactive Data
Getting Reactive DataGetting Reactive Data
Getting Reactive Data
 
Oasis montaj workshop session 1
Oasis montaj workshop session 1Oasis montaj workshop session 1
Oasis montaj workshop session 1
 
The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84
 
The Ring programming language version 1.6 book - Part 63 of 189
The Ring programming language version 1.6 book - Part 63 of 189The Ring programming language version 1.6 book - Part 63 of 189
The Ring programming language version 1.6 book - Part 63 of 189
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Capturar direccion ip y mac en win cc scada
Capturar direccion ip y mac en win cc scadaCapturar direccion ip y mac en win cc scada
Capturar direccion ip y mac en win cc scada
 
Pavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk wayPavlo Yuriychuk — Switching to Angular.js. Silk way
Pavlo Yuriychuk — Switching to Angular.js. Silk way
 
Switching to angular.js silk way
Switching to angular.js   silk waySwitching to angular.js   silk way
Switching to angular.js silk way
 
Hujs 总结
Hujs 总结Hujs 总结
Hujs 总结
 
OpenStackTO: Friendly coexistence of Virtual Machines and Containers on Kuber...
OpenStackTO: Friendly coexistence of Virtual Machines and Containers on Kuber...OpenStackTO: Friendly coexistence of Virtual Machines and Containers on Kuber...
OpenStackTO: Friendly coexistence of Virtual Machines and Containers on Kuber...
 
The Ring programming language version 1.5.3 book - Part 71 of 184
The Ring programming language version 1.5.3 book - Part 71 of 184The Ring programming language version 1.5.3 book - Part 71 of 184
The Ring programming language version 1.5.3 book - Part 71 of 184
 
The Ring programming language version 1.3 book - Part 45 of 88
The Ring programming language version 1.3 book - Part 45 of 88The Ring programming language version 1.3 book - Part 45 of 88
The Ring programming language version 1.3 book - Part 45 of 88
 
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.3 book - Part 72 of 184
 
KubeVirt (Kubernetes and Cloud Native Toronto)
KubeVirt (Kubernetes and Cloud Native Toronto)KubeVirt (Kubernetes and Cloud Native Toronto)
KubeVirt (Kubernetes and Cloud Native Toronto)
 
10 exciting features of CaseMaster 2.0
10 exciting features of CaseMaster 2.010 exciting features of CaseMaster 2.0
10 exciting features of CaseMaster 2.0
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185
 

Ähnlich wie Android: Recent Text Features

react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
janet736113
 
MobileCity:Core Data
MobileCity:Core DataMobileCity:Core Data
MobileCity:Core Data
Allan Davis
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
Alessandro Molina
 

Ähnlich wie Android: Recent Text Features (20)

react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
Android development
Android developmentAndroid development
Android development
 
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup  - Getting Started with MVVM Light for WPF - 11 may 2019Meetup  - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
 
Custom gutenberg block development with React
Custom gutenberg block development with ReactCustom gutenberg block development with React
Custom gutenberg block development with React
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
 
React native
React nativeReact native
React native
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
Universal JS Applications with React
Universal JS Applications with ReactUniversal JS Applications with React
Universal JS Applications with React
 
Drools & jBPM future roadmap talk
Drools & jBPM future roadmap talkDrools & jBPM future roadmap talk
Drools & jBPM future roadmap talk
 
Using react with meteor
Using react with meteorUsing react with meteor
Using react with meteor
 
Getting Started With ReactJS
Getting Started With ReactJSGetting Started With ReactJS
Getting Started With ReactJS
 
MobileCity:Core Data
MobileCity:Core DataMobileCity:Core Data
MobileCity:Core Data
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overview
 
React Context API
React Context APIReact Context API
React Context API
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
 
Daggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processorDaggerate your code - Write your own annotation processor
Daggerate your code - Write your own annotation processor
 

Kürzlich hochgeladen

+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 

Kürzlich hochgeladen (20)

COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 

Android: Recent Text Features

  • 1. Recent Text Features Old and New features Seigo Nonaka Android Text @ Google @ttuusskk
  • 2. PrecomputedText ● Used for background text layout ● Easy integration with RecyclerView recyclerView.adapter = object: RecyclerView.Adapter<Holder>() { override fun onBindViewHolder(holder: Holder, position: Int) { Holder.view.apply { setTextFuture( PrecomputedTextCompat.getTextFuture( sampleText[position], textMetricsParamsCompat, null) ) } } }
  • 3. Performance Improvement ● Removed global mutex lock during doing text layout. 0 25 50 75 100 milliseconds 125 150 175 API27 API27 API27 API28 1 thread 2 threads 4 thread 8 threads 34.9 49.0 82.1 318.7 22.1 22.5 26.5 82.6
  • 4. Typeface.Builder ● Replacement for createFromAsset, createFromFile. ● Variable Font Support (later) ● Font Collection Support textView1.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(0).build() textView2.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(1).build() textView3.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(2).build() textView4.typeface = Typeface.Builder(assets, "NotoSansCJK-Regular.ttc") .setTtcIndex(3).build()
  • 5. Variable Font ● OpenType Variable Font ● Either string representation or FontVariationAxis class can be used. textView1.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 200").build() textView2.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 400").build() textView3.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 700").build() textView4.typeface = Typeface.Builder(assets, "AdobeVFPrototype.ttf") .setFontVariationSettings("'wght' 900").build()
  • 6. Locale List Fallback ● Font selector is now aware of locale list ● By default, system locale settings is used. textView1.textLocales = LocaleList.forLanguageTags("en-US,ja-JP") textView2.textLocales = LocaleList.forLanguageTags("en-US,zh-CN") textView3.textLocales = LocaleList.forLanguageTags("en-US,zh-TW") textView4.textLocales = LocaleList.forLanguageTags("ja-JP,zh-TW")
  • 7. Serif Fallback ● System font is now aware of serif font. ● Use serif font if fonFamily=”serif” is specified.
  • 8. Justification ● Justification by whitespaces ● API is available since API 26, but due to bug, please use it API 28+
  • 9. Line Spacing Improvement ● Avoid glyph overlap for the taller glyph languages. ● Enabled by default API 28+ ● You can move back to old impl by specifying fallbackLineSpacing=”false”
  • 10. Thank you for your attention!