Skip to content

Commit

Permalink
extras: Add GeneralSans font overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
2 people authored and joeyhuab committed Feb 15, 2025
1 parent d03cf29 commit 1859ee0
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 0 deletions.
1 change: 1 addition & 0 deletions evolution.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ PRODUCT_PACKAGES += \
FontEvolveSansOverlay \
FontFifa2018Overlay \
FontGrandHotelOverlay \
FontGeneralSansOverlay \
FontHarmonySansOverlay \
FontLatoOverlay \
FontLinotteOverlay \
Expand Down
18 changes: 18 additions & 0 deletions prebuilt/product/etc/fonts_customization.xml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,24 @@
<font weight="300" style="normal">GautsMotelUpperRight.ttf</font>
</family>

<!-- General Sans -->
<family customizationType="new-named-family" name="generalsans">
<font weight="400" style="normal">GeneralSans-Regular.ttf</font>
</family>
<alias name="general-light" to="generalsans" weight="300" />
<alias name="general" to="generalsans" weight="400" />
<alias name="general-medium" to="generalsans" weight="500" />
<alias name="general-semi-bold" to="generalsans" weight="600" />
<alias name="general-bold" to="generalsans" weight="700" />
<alias name="times" to="generalsans" />
<alias name="times new roman" to="generalsans" />
<alias name="palatino" to="generalsans" />
<alias name="georgia" to="generalsans" />
<alias name="baskerville" to="generalsans" />
<alias name="goudy" to="generalsans" />
<alias name="fantasy" to="generalsans" />
<alias name="ITC Stone Serif" to="generalsans" />

<!-- GrandHotel -->
<family customizationType="new-named-family" name="grandhotel">
<font weight="400" style="normal">GrandHotel.ttf</font>
Expand Down
Binary file added prebuilt/product/fonts/GeneralSans-Regular.ttf
Binary file not shown.
20 changes: 20 additions & 0 deletions themes/fonts/FontGeneralSansOverlay/Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (C) 2024-25 Project Matrixx
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

runtime_resource_overlay {
name: "FontGeneralSansOverlay",
product_specific: true,
sdk_version: "current",
theme: "FontGeneralSans",
}
31 changes: 31 additions & 0 deletions themes/fonts/FontGeneralSansOverlay/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
/**
* Copyright (c) 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.theme.font.generalsans"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android"
android:category="android.theme.customization.font"
android:priority="1"/>

<application android:label="@string/font_generalsans_source_overlay" android:hasCode="false">
<meta-data
android:name="android.theme.customization.REQUIRED_SYSTEM_FONTS"
android:value="general,general-light,general-medium,general-semi-bold,general-bold" />
</application>
</manifest>
33 changes: 33 additions & 0 deletions themes/fonts/FontGeneralSansOverlay/res/values/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
/**
* Copyright (c) 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Name of a font family to use for body text. -->
<string name="config_bodyFontFamily" translatable="false">general</string>
<!-- Name of a font family to use for medium body text. -->
<string name="config_bodyFontFamilyMedium" translatable="false">general-semi-bold</string>
<!-- Name of a font family to use for headlines. If empty, falls back to platform default -->
<string name="config_headlineFontFamily" translatable="false">general</string>
<!-- Name of the font family used for system surfaces where the font should use medium weight -->
<string name="config_headlineFontFamilyMedium" translatable="false">general-bold</string>
<!-- Name of a font family to use as light font. For theming purpose. -->
<string name="config_lightFontFamily" translatable="false">@string/config_bodyFontFamily</string>
<!-- Name of a font family to use as regular font. For theming purpose. -->
<string name="config_regularFontFamily" translatable="false">@string/config_bodyFontFamily</string>
<!-- Name of the font family to use in the default lockscreen clock -->
<string name="config_clockFontFamily" translatable="false">@string/config_bodyFontFamily</string>
</resources>
21 changes: 21 additions & 0 deletions themes/fonts/FontGeneralSansOverlay/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
/**
* Copyright (c) 2019, The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Headline / Body font General Sans overlay -->
<string name="font_generalsans_source_overlay" translatable="false">General Sans</string>
</resources>

0 comments on commit 1859ee0

Please sign in to comment.