27 Mart 2025'ten itibaren AOSP'yi derlemek ve AOSP'ye katkıda bulunmak için aosp-main
yerine android-latest-release
kullanmanızı öneririz. Daha fazla bilgi için AOSP'de yapılan değişiklikler başlıklı makaleyi inceleyin.
Özel yazı tipleri ekleme
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Artık yazı tiplerini değiştirmek için çalışma zamanında kaynak yer paylaşımlarını (RRO'lar) kullanabilirsiniz. Yazı tipi paketi oluşturmak için özel yazı tipleri ekleyerek yazı tiplerini temalarda kullanabilir ve özelleştirmeleri uygulamak için RRO'ları kullanabilirsiniz.
Aşağıdaki görevleri tamamlayın:
custom-fonts.zip dosyasında örnek bir dosya yapısı ve örnek dosyalar sağlanır.
Bu dosyayı indirip kendi kullanımınız için yerel olarak ayıklayın.
Yazı tipi paketi oluşturma
Yazı tipi paketi oluşturmak için:
- Tüm yazı tipi
ttf
dosyalarını vendor
bölümündeki yazı tipi paketine ekleyin. Örnek:
vendor/[oem]/fonts/[oem]-sans/
- Yazı tipi paketi için
Android.mk
dosyasını oluşturun. Örnek:
vendor/[oem]/fonts/[oem]-[fontname]/Android.mk
- Modülün,
etc
klasöründeki product
bölümüne yükleneceğinden emin olun. Bunun için modülün aşağıdaki işaretlere sahip olduğunu onaylayın:
LOCAL_MODULE_CLASS := ETC
LOCAL_PRODUCT_MODULE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/fonts
Yukarıda verilen örnek kod, yazı tipi paketi modülünün tam tanımını göstermektedir.
- Yazı tipi paketi için
fonts.mk
adlı bir dosya oluşturun ve ardından yazı tipi ttf
dosyalarını PRODUCT_PACKAGES
'ye ekleyin. Örnek:
vendor/[oem]/fonts/[oem]-[fontname]/fonts.mk
Örnek:
PRODUCT_PACKAGES := \
[font name].ttf \
Cihaz yer paylaşımı paketi oluşturma
- Derlemeye eklenecek
fonts_customization.xml
adlı bir modül oluşturun.
Bu modül, yazı tipi ailelerini içeren fonts_customization.xml
dosyasını işaret eder ve tüm yazı tipi paketlerinin make dosyalarını çağırır. Örnek:
vendor/[oem]/[device]_overlay/fonts/Android.mk
- Yazı tipi ailelerini oluşturun:
vendor/[oem]/[device]_overlay/fonts/fonts_customization.xml
Dosyanın kök düzeyi bir fonts-modification
etiketi olmalıdır. Bu öğe altındaki yazı tipi paketlerinin her biri için yazı tipi aileleri ekleyin. Ayrıca her yazı tipi ailesine customizationType="new-named-family"
ekleyin ve her birinin name
özelliğine sahip olduğundan emin olun. Bu ad daha sonra yazı tipi ailesine erişmek için kullanılır. Bu dosya, daha önce Android.mk
içinde tanımlanan fonts_customizations.xml
modülüne eklenmelidir.
Yukarıda verilen örnekte geçerli bir fonts_customization.xml
dosyası bulunmaktadır.
fonts.mk
etiketini oluşturun. Örnek:
vendor/[oem]/[device]_overlay/fonts/fonts.mk
PRODUCT_PACKAGES
işaretinin altına fonts_customization.xml
ekleyin.
- Daha önce oluşturulan yazı tipi paketlerinin her birini çağırın.
$(call inherit-product-if-exists, vendor/[oem]/fonts/[oem]-[fontname]/fonts.mk)
- Yazı tipi modülünü
PRODUCT_PACKAGES
altındaki derlemeye ekleyin ve ardından yeniden derleyin.
Yazı tipleri sisteme yüklenir.
ttf
yazı tipi dosyalarının cihazdaki /product/fonts
klasöründe olduğundan emin olun.
- Cihazdaki
fonts_customization.xml
'nin /product/etc/
konumunda olduğunu doğrulayın.
Yeni sistem yazı tipi ailesini kullanma
Yeni sistem yazı tipi ailesini kullanmak için:
<style name="customstyle">
<item name="android:fontFamily">customfontfamily</item>
</style>
Bu sayfadaki içerik ve kod örnekleri, İçerik Lisansı sayfasında açıklanan lisanslara tabidir. Java ve OpenJDK, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-10 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-10 UTC."],[],[],null,["# Add custom fonts\n\nYou can now use runtime resource overlays (RROs) to change fonts. By adding custom\nfonts to make a font package, you can use fonts in themes and use RROs to apply the\ncustomizations.\n\nComplete these tasks:\n\n- [Make a font package](/docs/automotive/hmi/car_ui/fonts#make)\n- [Create a device overlay package](/docs/automotive/hmi/car_ui/fonts#create)\n- [Use the added system fonts family](/docs/automotive/hmi/car_ui/fonts#use)\n\nA sample file structure and sample files are provided in\n[custom-fonts.zip](/static/docs/automotive/hmi/car_ui/custom-fonts.zip).\nDownload and then extract this file locally for your own use.\n\nMake a font package\n-------------------\n\nTo make a font package:\n\n1. Add all the font `ttf` files to the font package in the `vendor` partition. For example:\n\n `vendor/[oem]/fonts/[oem]-sans/`\n2. Create the `Android.mk` file for the font package. For example:\n\n `vendor/[oem]/fonts/[oem]-[fontname]/Android.mk`\n3. Make sure the module will be installed in the `product` partition in the `etc` folder. To do so, confirm the module has the following flags: \n\n ```makefile\n LOCAL_MODULE_CLASS := ETC\n LOCAL_PRODUCT_MODULE := true\n LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/fonts\n ```\n\n The sample code provided above illustrates a complete definition of a font package module.\n4. Create a file named `fonts.mk` for the font package and then add the font `ttf` files to `PRODUCT_PACKAGES`. For example:\n\n `vendor/[oem]/fonts/[oem]-[fontname]/fonts.mk`\n\n For example: \n\n ```objective-c\n PRODUCT_PACKAGES := \\\n [font name].ttf \\\n ```\n\nCreate a device overlay package\n-------------------------------\n\n1. Make a module called `fonts_customization.xml` to be added to the build. This module points to the `fonts_customization.xml` file that contains the font families and calls the make files of all the font packages. For example:\n\n `vendor/[oem]/[device]_overlay/fonts/Android.mk`\n2. Create the font families: `vendor/[oem]/[device]_overlay/fonts/fonts_customization.xml`\n\n The root level of the file must be a `fonts-modification` tag. Add\n font families for each of the font packages under this element. In addition, add\n `customizationType=\"new-named-family\"` to every font family, and make\n sure each has a `name` attribute. This name is used later to access the\n font family. This file must be added to the `fonts_customizations.xml`\n module defined previously in `Android.mk`.\n\n The sample provided above contains a valid `fonts_customization.xml` file.\n3. Create `fonts.mk`. For example:\n\n `vendor/[oem]/[device]_overlay/fonts/fonts.mk`\n4. Add `fonts_customization.xml` under the `PRODUCT_PACKAGES` flag.\n5. Call into each of the previously created font packages.\n `$(call inherit-product-if-exists, vendor/[oem]/fonts/[oem]-[fontname]/fonts.mk)`\n\n6. Add the font module to the build under `PRODUCT_PACKAGES` and then rebuild. The fonts will be installed on the system.\n7. Verify that the `ttf` fonts files are in the `/product/fonts` folder on the device.\n8. Verify that `fonts_customization.xml` is in `/product/etc/` on the device.\n\nUse the new system fonts family\n-------------------------------\n\nTo use the new system fonts family: \n\n```text\n\u003cstyle name=\"customstyle\"\u003e\n \u003citem name=\"android:fontFamily\"\u003ecustomfontfamily\u003c/item\u003e\n\u003c/style\u003e\n```"]]