Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Typeface
Search
Keishin Yokomaku
September 24, 2014
Technology
0
1.2k
Typeface
Android library for easy use of typeface.
Keishin Yokomaku
September 24, 2014
Tweet
Share
More Decks by Keishin Yokomaku
See All by Keishin Yokomaku
One screen, many BottomSheets
keithyokoma
0
380
LazyColumnのitemがViewPortの中で占める領域の割合を知りたい
keithyokoma
0
650
Build apps for Cars
keithyokoma
0
520
Save the state
keithyokoma
0
570
Either in Kotlin
keithyokoma
0
580
持続的なアプリ開発のためのDXを支える技術
keithyokoma
2
5.2k
Make the objects serializable with kotlinx.serialization
keithyokoma
0
5.1k
Kotlin で書く Gradle Custom Tasks
keithyokoma
0
540
DX Improvements
keithyokoma
3
400
Other Decks in Technology
See All in Technology
[MIRU25] NaiLIA: Multimodal Retrieval of Nail Designs Based on Dense Intent Descriptions
keio_smilab
PRO
1
130
2025/07/22_家族アルバム みてねのCRE における生成AI活用事例
masartz
2
150
隙間時間で爆速開発! Claude Code × Vibe Coding で作るマニュアル自動生成サービス
akitomonam
2
200
ecspressoの設計思想に至る道 / sekkeinight2025
fujiwara3
12
2.1k
AI エンジニアの立場からみた、AI コーディング時代の開発の品質向上の取り組みと妄想
soh9834
8
590
経理出身PdMがAIプロダクト開発を_ハンズオンで学んだ話.pdf
shunsukenarita
1
240
Railsの限界を超えろ!「家族アルバム みてね」の画像・動画の大規模アップロードを支えるアーキテクチャの変遷
ojima_h
4
520
ML Pipelineの開発と運用を OpenTelemetryで繋ぐ @ OpenTelemetry Meetup 2025-07
getty708
0
320
少人数でも回る! DevinとPlaybookで支える運用改善
ishikawa_pro
4
1.8k
Kiro Hookを Terraformで検証
ao_inoue
0
140
人と生成AIの協調意思決定/Co‑decision making by people and generative AI
moriyuya
0
180
生成AIを活用した野球データ分析 - メジャーリーグ編 / Baseball Analytics for Gen AI
shinyorke
PRO
1
250
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.4k
Testing 201, or: Great Expectations
jmmastey
43
7.6k
Thoughts on Productivity
jonyablonski
69
4.8k
Balancing Empowerment & Direction
lara
1
510
Facilitating Awesome Meetings
lara
54
6.5k
Unsuck your backbone
ammeep
671
58k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Site-Speed That Sticks
csswizardry
10
730
Statistics for Hackers
jakevdp
799
220k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Transcript
Typeface @KeithYokoma - Drivemode, Inc. potatotips #9
About myself • KeithYokoma • Keishin Yokomaku • Drivemode, Inc.
• GitHub: https://github.com/KeithYokoma • e-Book: http://amzn.to/1mZNydv
Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface
Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface Typeface
http://bit.ly/1rjOdtN
Typeface • Cool • Nice • Beautiful • Android provides
Roboto by default
Typeface • If you would like to change the typeface…
TextView#setTypeface(Typeface) Paint#setTypeface(Typeface) Button#setTypeface(Typeface) EditText#setTypeface(Typeface)
Typeface • Read Typeface from your assets Typeface.createFromAsset(AssetManager, String)
Typeface • Read Typeface from your assets ! • Caution!
Typeface.createFromAsset(AssetManager, String) Typeface.createFromAsset leaks asset stream! http://bit.ly/1rVOkir
Typeface • Workaround: cache private final Hashtable<String, Typeface> mCache =
new Hashtable<String, Typeface>();! private final Application mApplication;! ! public synchronized Typeface get(String name) {! ! Typeface typeface = mCache.get(name);! ! if(typeface == null) {! ! ! try {! ! ! ! typeface = Typeface.createFromAsset(mApplication.getAssets(), name);! ! ! } catch (Exception exp) {! ! ! ! return null;! ! ! }! ! ! mCache.put(name, typeface);! ! }! ! return typeface;! }
Typeface • If you would like to change the typeface
for ActionBar title Dialog button texts Dialog message text ActionBar tab text All text views in the view group blah blah blah…
Typeface • Got it, we introduce you our library! TypefaceHelper
- http://bit.ly/1AxfqLz
Typeface • First, initialize the object in your Application. public
class SampleApp extends Application {! ! @Override! ! public void onCreate() {! ! ! super.onCreate();! ! ! TypefaceHelper.initialize(this);! ! }! ! ! @Override! ! public void onTerminate() {! ! ! TypefaceHelper.destroy();! ! ! super.onTerminate();! ! }! }
Typeface • Set your Typeface. public class SampleActivity extends Activity
{! ! ! TextView mTextView;! ! ! @Override! ! public void onCreate(Bundle icicle) {! ! ! // …! ! ! TypefaceHelper helper = TypefaceHelper.getInstance();! ! ! helper.setTypeface(this, “MyFont.ttf”);! ! ! helper.setTypeface(mTextView, “Another.ttf”);! ! }! }
Typeface • That's it. Just do it!
Typeface • You can set your Typeface to… • All
views that is a child of TextView. • All TextViews that is belong to ViewGroup. • Activity, Fragment, Dialog. • Canvas(thanks to Nohana team!)
Typeface • Works in progress 1. OptionsMenu 2. Preferences 3.
Set typeface by annotation
Typeface @KeithYokoma - Drivemode, Inc. potatotips #9