fonts: add JetBrains Mono

Issue: otter-12
Change-Id: I63c571f0b28d8e081835f68157ea2ce284a6e9df
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/fonts/FontJetBrainsMonoOverlay/Android.bp b/fonts/FontJetBrainsMonoOverlay/Android.bp
new file mode 100644
index 0000000..6bddf0a
--- /dev/null
+++ b/fonts/FontJetBrainsMonoOverlay/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: "FontJetBrainsMonoOverlay",
+    theme: "FontJetBrainsMono",
+    product_specific: true,
+}
diff --git a/fonts/FontJetBrainsMonoOverlay/AndroidManifest.xml b/fonts/FontJetBrainsMonoOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..8db2360
--- /dev/null
+++ b/fonts/FontJetBrainsMonoOverlay/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.jetbrainsmono"
+    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_jetbrains-mono_overlay">
+        <meta-data
+            android:name="android.theme.customization.REQUIRED_SYSTEM_FONTS"
+            android:value="jetbrains-mono,jetbrains-mono-medium" />
+    </application>
+</manifest>
diff --git a/fonts/FontJetBrainsMonoOverlay/res/values/config.xml b/fonts/FontJetBrainsMonoOverlay/res/values/config.xml
new file mode 100644
index 0000000..a3c34dc
--- /dev/null
+++ b/fonts/FontJetBrainsMonoOverlay/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">jetbrains-mono</string>
+    <!-- Name of a font family to use for medium body text. -->
+    <string name="config_bodyFontFamilyMedium" translatable="false">jetbrains-mono-medium</string>
+    <!-- Name of a font family to use for headlines. If empty, falls back to platform default -->
+    <string name="config_headlineFontFamily" translatable="false">jetbrains-mono</string>
+    <!-- Name of the font family used for system surfaces where the font should use medium weight -->
+    <string name="config_headlineFontFamilyMedium" translatable="false">jetbrains-mono-medium</string>
+</resources>
diff --git a/fonts/FontJetBrainsMonoOverlay/res/values/strings.xml b/fonts/FontJetBrainsMonoOverlay/res/values/strings.xml
new file mode 100644
index 0000000..bade28c
--- /dev/null
+++ b/fonts/FontJetBrainsMonoOverlay/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 JetBrains Mono overlay -->
+    <string name="font_jetbrains-mono_overlay" translatable="false">JetBrains Mono</string>
+</resources>
diff --git a/fonts/etc/fonts_customization.xml b/fonts/etc/fonts_customization.xml
index 0c9a7fb..8b6a129 100644
--- a/fonts/etc/fonts_customization.xml
+++ b/fonts/etc/fonts_customization.xml
@@ -1,5 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <fonts-modification version="1">
+    <family customizationType="new-named-family" name="jetbrains-mono">
+        <font weight="400" style="normal">JetBrainsMono-Regular.ttf</font>
+        <font weight="400" style="italic">JetBrainsMono-Italic.ttf</font>
+        <font weight="500" style="normal">JetBrainsMono-Medium.ttf</font>
+        <font weight="500" style="italic">JetBrainsMono-MediumItalic.ttf</font>
+        <font weight="700" style="normal">JetBrainsMono-Bold.ttf</font>
+        <font weight="700" style="italic">JetBrainsMono-BoldItalic.ttf</font>
+    </family>
+    <alias name="jetbrains-mono-medium" to="jetbrains-mono" weight="500" />
+    <alias name="jetbrains-mono-bold" to="jetbrains-mono" weight="700" />
+
     <family customizationType="new-named-family" name="lato">
         <font weight="400" style="normal">Lato-Regular.ttf</font>
         <font weight="400" style="italic">Lato-Italic.ttf</font>