omni: add muli font and overlay
Change-Id: Ib4b179e3d61125a4b19fe3f7ad4872b97bd7350b
diff --git a/config/packages.mk b/config/packages.mk
index f9f171d..9d13fd1 100644
--- a/config/packages.mk
+++ b/config/packages.mk
@@ -76,3 +76,4 @@
su
$(call inherit-product-if-exists, external/google-fonts/lato/fonts.mk)
+$(call inherit-product-if-exists, vendor/omni/prebuilt/fonts/fonts.mk)
diff --git a/prebuilt/etc/fonts_customization.xml b/prebuilt/etc/fonts_customization.xml
index 5d1024b..7432a61 100644
--- a/prebuilt/etc/fonts_customization.xml
+++ b/prebuilt/etc/fonts_customization.xml
@@ -10,4 +10,16 @@
</family>
<alias name="lato-semi-bold" to="lato" weight="500" />
<alias name="lato-bold" to="lato" weight="700" />
+ <family name="muli" customizationType="new-named-family">
+ <font weight="400" style="normal">Muli-Regular.ttf</font>
+ <font weight="400" style="italic">Muli-Italic.ttf</font>
+ <font weight="500" style="normal">Muli-Medium.ttf</font>
+ <font weight="500" style="italic">Muli-MediumItalic.ttf</font>
+ <font weight="600" style="normal">Muli-SemiBold.ttf</font>
+ <font weight="600" style="italic">Muli-SemiBoldItalic.ttf</font>
+ <font weight="700" style="normal">Muli-Bold.ttf</font>
+ <font weight="700" style="italic">Muli-BoldItalic.ttf</font>
+ </family>
+ <alias name="muli-semi-bold" to="muli" weight="600" />
+ <alias name="muli-bold" to="muli" weight="700" />
</fonts-modification>
diff --git a/prebuilt/fonts/Android.mk b/prebuilt/fonts/Android.mk
new file mode 100644
index 0000000..a8287c3
--- /dev/null
+++ b/prebuilt/fonts/Android.mk
@@ -0,0 +1,53 @@
+# Copyright (C) 2018 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.
+
+# We have to use BUILD_PREBUILT instead of PRODUCT_COPY_FIES,
+# to copy over the NOTICE file.
+
+LOCAL_PATH := $(call my-dir)
+
+ifneq ($(SMALLER_FONT_FOOTPRINT),true)
+
+include $(CLEAR_VARS)
+
+# Build the rest of font files as prebuilt.
+# $(1): The source file name in LOCAL_PATH.
+# It also serves as the module name and the dest file name.
+define build-one-font-module
+$(eval include $(CLEAR_VARS))\
+$(eval LOCAL_MODULE := $(1))\
+$(eval LOCAL_SRC_FILES := $(1))\
+$(eval LOCAL_MODULE_CLASS := ETC)\
+$(eval LOCAL_MODULE_TAGS := optional)\
+$(eval LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT)/fonts)\
+$(eval LOCAL_PRODUCT_MODULE := true) \
+$(eval include $(BUILD_PREBUILT))
+endef
+
+font_src_files := \
+ Muli-Regular.ttf \
+ Muli-Italic.ttf \
+ Muli-Medium.ttf \
+ Muli-MediumItalic.ttf \
+ Muli-SemiBold.ttf \
+ Muli-SemiBoldItalic.ttf \
+ Muli-Bold.ttf \
+ Muli-BoldItalic.ttf
+
+$(foreach f, $(font_src_files), $(call build-one-font-module, $(f)))
+
+build-one-font-module :=
+font_src_files :=
+
+endif
diff --git a/prebuilt/fonts/Muli-Bold.ttf b/prebuilt/fonts/Muli-Bold.ttf
new file mode 100644
index 0000000..9383139
--- /dev/null
+++ b/prebuilt/fonts/Muli-Bold.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-BoldItalic.ttf b/prebuilt/fonts/Muli-BoldItalic.ttf
new file mode 100644
index 0000000..111b746
--- /dev/null
+++ b/prebuilt/fonts/Muli-BoldItalic.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-Italic.ttf b/prebuilt/fonts/Muli-Italic.ttf
new file mode 100644
index 0000000..207ab18
--- /dev/null
+++ b/prebuilt/fonts/Muli-Italic.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-Medium.ttf b/prebuilt/fonts/Muli-Medium.ttf
new file mode 100644
index 0000000..f28c094
--- /dev/null
+++ b/prebuilt/fonts/Muli-Medium.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-MediumItalic.ttf b/prebuilt/fonts/Muli-MediumItalic.ttf
new file mode 100644
index 0000000..06eb9ae
--- /dev/null
+++ b/prebuilt/fonts/Muli-MediumItalic.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-Regular.ttf b/prebuilt/fonts/Muli-Regular.ttf
new file mode 100644
index 0000000..9776a3e
--- /dev/null
+++ b/prebuilt/fonts/Muli-Regular.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-SemiBold.ttf b/prebuilt/fonts/Muli-SemiBold.ttf
new file mode 100644
index 0000000..86d5ecc
--- /dev/null
+++ b/prebuilt/fonts/Muli-SemiBold.ttf
Binary files differ
diff --git a/prebuilt/fonts/Muli-SemiBoldItalic.ttf b/prebuilt/fonts/Muli-SemiBoldItalic.ttf
new file mode 100644
index 0000000..6188913
--- /dev/null
+++ b/prebuilt/fonts/Muli-SemiBoldItalic.ttf
Binary files differ
diff --git a/prebuilt/fonts/fonts.mk b/prebuilt/fonts/fonts.mk
new file mode 100644
index 0000000..f7f508d
--- /dev/null
+++ b/prebuilt/fonts/fonts.mk
@@ -0,0 +1,27 @@
+# Copyright (C) 2018 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.
+
+# We have to use PRODUCT_PACKAGES (together with BUILD_PREBUILT) instead of
+# PRODUCT_COPY_FILES to install the font files, so that the NOTICE file can
+# get installed too.
+
+PRODUCT_PACKAGES := \
+ Muli-Regular.ttf \
+ Muli-Italic.ttf \
+ Muli-Medium.ttf \
+ Muli-MediumItalic.ttf \
+ Muli-SemiBold.ttf \
+ Muli-SemiBoldItalic.ttf \
+ Muli-Bold.ttf \
+ Muli-BoldItalic.ttf
diff --git a/themes/overlays/Android.mk b/themes/overlays/Android.mk
index 80da163..0eb3c82 100644
--- a/themes/overlays/Android.mk
+++ b/themes/overlays/Android.mk
@@ -25,7 +25,8 @@
PrimaryColorDarkBlueOverlay \
PrimaryColorDeepBlueOverlay \
AccentColorRedDevilOverlay \
- FontLatoSourceOverlay
+ FontLatoSourceOverlay \
+ FontMuliSourceOverlay
include $(BUILD_PHONY_PACKAGE)
include $(CLEAR_VARS)
diff --git a/themes/overlays/FontMuliSourceOverlay/Android.mk b/themes/overlays/FontMuliSourceOverlay/Android.mk
new file mode 100644
index 0000000..80f375a
--- /dev/null
+++ b/themes/overlays/FontMuliSourceOverlay/Android.mk
@@ -0,0 +1,31 @@
+#
+# Copyright 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.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_RRO_THEME := FontMuliSource
+
+LOCAL_PRODUCT_MODULE := true
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_PACKAGE_NAME := FontMuliSourceOverlay
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_RRO_PACKAGE)
diff --git a/themes/overlays/FontMuliSourceOverlay/AndroidManifest.xml b/themes/overlays/FontMuliSourceOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..9fe0de2
--- /dev/null
+++ b/themes/overlays/FontMuliSourceOverlay/AndroidManifest.xml
@@ -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.mulisource"
+ 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_muli_source_overlay" android:hasCode="false">
+ <meta-data
+ android:name="android.theme.customization.REQUIRED_SYSTEM_FONTS"
+ android:value="muli,muli-semi-bold,muli-bold" />
+ </application>
+</manifest>
diff --git a/themes/overlays/FontMuliSourceOverlay/res/values/config.xml b/themes/overlays/FontMuliSourceOverlay/res/values/config.xml
new file mode 100644
index 0000000..75a86dd
--- /dev/null
+++ b/themes/overlays/FontMuliSourceOverlay/res/values/config.xml
@@ -0,0 +1,28 @@
+<!--
+/**
+ * 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">muli</string>
+ <!-- Name of a font family to use for medium body text. -->
+ <string name="config_bodyFontFamilyMedium" translatable="false">muli-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">muli-semi-bold</string>
+ <!-- Name of the font family used for system surfaces where the font should use medium weight -->
+ <string name="config_headlineFontFamilyMedium" translatable="false">muli-bold</string>
+</resources>
+
diff --git a/themes/overlays/FontMuliSourceOverlay/res/values/strings.xml b/themes/overlays/FontMuliSourceOverlay/res/values/strings.xml
new file mode 100644
index 0000000..de6ba15
--- /dev/null
+++ b/themes/overlays/FontMuliSourceOverlay/res/values/strings.xml
@@ -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">
+ <!-- Lato overlay -->
+ <string name="font_muli_source_overlay" translatable="false">Muli</string>
+</resources>