ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.65k stars 2.24k forks source link

[Bug] `<code>`'s `monospace` font is missing International Phonetic Alphabet symbols #15535

Closed david-allison closed 8 months ago

david-allison commented 8 months ago

AnkiDroid

Screenshot 2024-02-16 at 16 16 48

Issue in 2.16.X and 2.17

Font: Droid Sans Mono


Anki Desktop

Screenshot 2024-02-16 at 16 17 52

Font: Menlo (macos monospace)

david-allison commented 8 months ago

Sadly, Open Font License (SIL OFL) fonts are not GPL compatible.

https://www.gnu.org/licenses/license-list.en.html#SILOFL

Once we find a font, here's the patch:

Index: AnkiDroid/src/main/assets/flashcard.css
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/AnkiDroid/src/main/assets/flashcard.css b/AnkiDroid/src/main/assets/flashcard.css
--- a/AnkiDroid/src/main/assets/flashcard.css   (revision 1113858df6a6b8c8c93afac0e1f788942db70c9f)
+++ b/AnkiDroid/src/main/assets/flashcard.css   (date 1708106416495)
@@ -41,8 +41,14 @@
   background-color: #ccc;
 }

+@font-face {
+    font-family: NotoSansMono;
+    src: url("file:///android_asset/fonts/NotoSansMono-Regular.ttf")
+}
+
 #typeans {
   width: 100%;
+    font-family: NotoSansMono;
 }

 .typePrompt {