fonts: add Open Sans

Issue: otter-12
Change-Id: I19b578c0d92952d33b4b29fc0553da2e4f52bfd2
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/fonts/FontOpenSansOverlay/Android.bp b/fonts/FontOpenSansOverlay/Android.bp
new file mode 100644
index 0000000..bdd4069
--- /dev/null
+++ b/fonts/FontOpenSansOverlay/Android.bp
@@ -0,0 +1,25 @@
+//
+// Copyright (c) 2020,2022 The LineageOS 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.
+//
+
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+runtime_resource_overlay {
+    name: "FontOpenSansOverlay",
+    theme: "FontOpenSans",
+    product_specific: true,
+}
diff --git a/fonts/FontOpenSansOverlay/AndroidManifest.xml b/fonts/FontOpenSansOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..aee79fd
--- /dev/null
+++ b/fonts/FontOpenSansOverlay/AndroidManifest.xml
@@ -0,0 +1,33 @@
+<!--
+    Copyright (c) 2020, The LineageOS 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="eco.shift.overlay.font.opensans"
+    android:versionCode="1"
+    android:versionName="1.0">
+
+    <overlay
+        android:targetPackage="android"
+        android:category="android.theme.customization.font"
+        android:priority="1" />
+
+    <application
+        android:hasCode="false"
+        android:label="@string/font_open-sans_overlay">
+        <meta-data
+            android:name="android.theme.customization.REQUIRED_SYSTEM_FONTS"
+            android:value="open-sans,open-sans-medium" />
+    </application>
+</manifest>
diff --git a/fonts/FontOpenSansOverlay/res/values/config.xml b/fonts/FontOpenSansOverlay/res/values/config.xml
new file mode 100644
index 0000000..01b8e00
--- /dev/null
+++ b/fonts/FontOpenSansOverlay/res/values/config.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/**
+ * Copyright (c) 2020, The LineageOS 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">open-sans</string>
+    <!-- Name of a font family to use for medium body text. -->
+    <string name="config_bodyFontFamilyMedium" translatable="false">open-sans-medium</string>
+    <!-- Name of a font family to use for headlines. If empty, falls back to platform default -->
+    <string name="config_headlineFontFamily" translatable="false">open-sans</string>
+    <!-- Name of the font family used for system surfaces where the font should use medium weight -->
+    <string name="config_headlineFontFamilyMedium" translatable="false">open-sans-medium</string>
+</resources>
diff --git a/fonts/FontOpenSansOverlay/res/values/strings.xml b/fonts/FontOpenSansOverlay/res/values/strings.xml
new file mode 100644
index 0000000..24d867c
--- /dev/null
+++ b/fonts/FontOpenSansOverlay/res/values/strings.xml
@@ -0,0 +1,21 @@
+<!--
+/**
+ * Copyright (c) 2020, 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 Open Sans overlay -->
+    <string name="font_open-sans_overlay" translatable="false">Open Sans</string>
+</resources>
diff --git a/fonts/etc/fonts_customization.xml b/fonts/etc/fonts_customization.xml
index 8b6a129..1f67283 100644
--- a/fonts/etc/fonts_customization.xml
+++ b/fonts/etc/fonts_customization.xml
@@ -22,6 +22,17 @@
     <alias name="lato-medium" to="lato" weight="500" />
     <alias name="lato-bold" to="lato" weight="700" />
 
+    <family customizationType="new-named-family" name="open-sans">
+        <font weight="400" style="normal">OpenSans-Regular.ttf</font>
+        <font weight="400" style="italic">OpenSans-Italic.ttf</font>
+        <font weight="500" style="normal">OpenSans-Medium.ttf</font>
+        <font weight="500" style="italic">OpenSans-MediumItalic.ttf</font>
+        <font weight="700" style="normal">OpenSans-Bold.ttf</font>
+        <font weight="700" style="italic">OpenSans-BoldItalic.ttf</font>
+    </family>
+    <alias name="open-sans-medium" to="open-sans" weight="500" />
+    <alias name="open-sans-bold" to="open-sans" weight="700" />
+
     <family customizationType="new-named-family" name="rubik">
         <font weight="400" style="normal">Rubik-Regular.ttf</font>
         <font weight="400" style="italic">Rubik-Italic.ttf</font>