File: replace-sourcecodepro-font-with-inconsolata

package info (click to toggle)
mu-editor 1.2.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,492 kB
  • sloc: python: 33,326; makefile: 154; xml: 32; sh: 7
file content (57 lines) | stat: -rw-r--r-- 2,426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Description: Remove hard-coded dependency on the Source Code Pro font
 Mu bundles the Adobe Source Code Pro font with its source, and hard-codes its
 use within the editor. This patch removes this requirement, replacing it with
 the Inconsolata font, which is already packaged for Debian. Separately, we
 repackage the source (via Files-Excluded) to remove the fonts from the
 Debian source tarball and add a binary dependency on fonts-inconsolata.
 .
 Note that Debian packaging efforts for the Adobe Font Development Kit for
 OpenType (#762252) and the Source Code Pro fonts (#736681) remain unresolved
 at the time of creating this patch.
Author: Nick Morrott <knowledgejunkie@gmail.com>
Forwarded: not-needed
Last-Update: 2018-12-21
---
Index: mu-editor/mu/interface/themes.py
===================================================================
--- mu-editor.orig/mu/interface/themes.py
+++ mu-editor/mu/interface/themes.py
@@ -25,10 +25,9 @@ from mu.resources import load_stylesheet
 # The default font size.
 DEFAULT_FONT_SIZE = 14
 # All editor windows use the same font
-FONT_NAME = "Source Code Pro"
+FONT_NAME = "Inconsolata"
 
-FONT_FILENAME_PATTERN = "SourceCodePro-{variant}.otf"
-FONT_VARIANTS = ("Bold", "BoldIt", "It", "Regular", "Semibold", "SemiboldIt")
+FONT_FILENAME = "Inconsolata.otf"
 # Load the three themes from resources/css/[night|day|contrast].css
 # NIGHT_STYLE is a dark theme.
 NIGHT_STYLE = load_stylesheet("night.css")
@@ -66,10 +65,9 @@ class Font:
         """
         if cls._DATABASE is None:
             cls._DATABASE = QFontDatabase()
-            for variant in FONT_VARIANTS:
-                filename = FONT_FILENAME_PATTERN.format(variant=variant)
-                font_data = load_font_data(filename)
-                cls._DATABASE.addApplicationFontFromData(font_data)
+            filename = FONT_FILENAME
+            font_data = load_font_data(filename)
+            cls._DATABASE.addApplicationFontFromData(font_data)
         return cls._DATABASE
 
     def load(self, size=DEFAULT_FONT_SIZE):
Index: mu-editor/MANIFEST.in
===================================================================
--- mu-editor.orig/MANIFEST.in
+++ mu-editor/MANIFEST.in
@@ -5,7 +5,6 @@ include LICENSE
 include conf/*
 include mu/resources/css/*
 include mu/resources/images/*
-include mu/resources/fonts/*
 include mu/resources/pygamezero/*
 recursive-include mu/resources/web *
 include run.py