[LyX/2.3.x] Personalize fonts

Enrico Forestieri forenr at lyx.org
Thu Sep 3 18:17:15 UTC 2020


commit 1f1a8f60070fb6dea9b35c9ec3ef91d6307322f0
Author: Enrico Forestieri <forenr at lyx.org>
Date:   Thu Sep 3 20:42:05 2020 +0200

    Personalize fonts
    
    When the fonts distributed with texlive with same family name
    as ours are also managed by fontconfig, Qt is not able to
    discriminate ours by the style only. In order to be sure Qt
    will load our fonts, we change the foundry name from 'PfEd'
    to 'LyEd' and augment the font family name with this foundry
    name. This only works on *nix, because adding a foundry name
    seemingly breaks things on Windows. However, this is a *nix
    only problem, seemingly.
---
 lib/fonts/cmex10.sfd                |    1 +
 lib/fonts/cmex10.ttf                |  Bin 20688 -> 20688 bytes
 lib/fonts/cmmi10.sfd                |    2 +-
 lib/fonts/cmmi10.ttf                |  Bin 32036 -> 32044 bytes
 lib/fonts/cmr10.sfd                 |    1 +
 lib/fonts/cmr10.ttf                 |  Bin 26188 -> 26188 bytes
 lib/fonts/cmsy10.sfd                |    2 +-
 lib/fonts/cmsy10.ttf                |  Bin 28476 -> 28484 bytes
 lib/fonts/dsrom10.sfd               |    2 +-
 lib/fonts/dsrom10.ttf               |  Bin 9944 -> 9944 bytes
 lib/fonts/esint10.sfd               |    2 +-
 lib/fonts/esint10.ttf               |  Bin 24316 -> 24324 bytes
 lib/fonts/eufm10.sfd                |    1 +
 lib/fonts/eufm10.ttf                |  Bin 23476 -> 23476 bytes
 lib/fonts/msam10.sfd                |    2 +-
 lib/fonts/msam10.ttf                |  Bin 26620 -> 26628 bytes
 lib/fonts/msbm10.sfd                |    2 +-
 lib/fonts/msbm10.ttf                |  Bin 36460 -> 36468 bytes
 lib/fonts/rsfs10.sfd                |    2 +-
 lib/fonts/rsfs10.ttf                |  Bin 10924 -> 10932 bytes
 lib/fonts/stmary10.sfd              |   27 +++++++++++++++++----------
 lib/fonts/stmary10.ttf              |  Bin 18740 -> 18740 bytes
 lib/fonts/wasy10.sfd                |    2 +-
 lib/fonts/wasy10.ttf                |  Bin 20876 -> 20884 bytes
 src/frontends/qt4/GuiFontLoader.cpp |    7 +++++++
 status.23x                          |    2 ++
 26 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/lib/fonts/cmex10.sfd b/lib/fonts/cmex10.sfd
index cea4d9d..8431e86 100644
--- a/lib/fonts/cmex10.sfd
+++ b/lib/fonts/cmex10.sfd
@@ -50,6 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 0
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
+OS2Vendor: 'LyEd'
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
 DEI: 91125
diff --git a/lib/fonts/cmex10.ttf b/lib/fonts/cmex10.ttf
index cf8cd4c..af088f4 100755
Binary files a/lib/fonts/cmex10.ttf and b/lib/fonts/cmex10.ttf differ
diff --git a/lib/fonts/cmmi10.sfd b/lib/fonts/cmmi10.sfd
index da3416a..463e38a 100644
--- a/lib/fonts/cmmi10.sfd
+++ b/lib/fonts/cmmi10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 1175
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
diff --git a/lib/fonts/cmmi10.ttf b/lib/fonts/cmmi10.ttf
index 9b2b430..e7a7ac9 100755
Binary files a/lib/fonts/cmmi10.ttf and b/lib/fonts/cmmi10.ttf differ
diff --git a/lib/fonts/cmr10.sfd b/lib/fonts/cmr10.sfd
index 80f8e56..641fe4d 100644
--- a/lib/fonts/cmr10.sfd
+++ b/lib/fonts/cmr10.sfd
@@ -50,6 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 1186
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
+OS2Vendor: 'LyEd'
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 DEI: 91125
 TtTable: prep
diff --git a/lib/fonts/cmr10.ttf b/lib/fonts/cmr10.ttf
index e405536..efff9fc 100755
Binary files a/lib/fonts/cmr10.ttf and b/lib/fonts/cmr10.ttf differ
diff --git a/lib/fonts/cmsy10.sfd b/lib/fonts/cmsy10.sfd
index ad7e483..5ae7f20 100644
--- a/lib/fonts/cmsy10.sfd
+++ b/lib/fonts/cmsy10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 723
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
diff --git a/lib/fonts/cmsy10.ttf b/lib/fonts/cmsy10.ttf
index 40cb3a8..de70897 100755
Binary files a/lib/fonts/cmsy10.ttf and b/lib/fonts/cmsy10.ttf differ
diff --git a/lib/fonts/dsrom10.sfd b/lib/fonts/dsrom10.sfd
index 9ab5bc2..bf7e98b 100644
--- a/lib/fonts/dsrom10.sfd
+++ b/lib/fonts/dsrom10.sfd
@@ -52,7 +52,7 @@ OS2SupXOff: 0
 OS2SupYOff: 480
 OS2StrikeYSize: 49
 OS2StrikeYPos: 258
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000001.00000000.00000000.00000000
 DEI: 91125
diff --git a/lib/fonts/dsrom10.ttf b/lib/fonts/dsrom10.ttf
index 07db01f..ae17983 100755
Binary files a/lib/fonts/dsrom10.ttf and b/lib/fonts/dsrom10.ttf differ
diff --git a/lib/fonts/esint10.sfd b/lib/fonts/esint10.sfd
index eb0b568..71a4fe1 100644
--- a/lib/fonts/esint10.sfd
+++ b/lib/fonts/esint10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 0
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 40000001.80d40000
 OS2UnicodeRanges: 00000003.00000000.00000000.00000000
 Lookup: 4 0 1 "'liga' Ligature standard in Latin lookup 0"  {"'liga' Ligature standard in Latin lookup 0 subtable"  } ['liga' ('latn' <'dflt' > ) ]
diff --git a/lib/fonts/esint10.ttf b/lib/fonts/esint10.ttf
index deb6e5f..60535fd 100755
Binary files a/lib/fonts/esint10.ttf and b/lib/fonts/esint10.ttf differ
diff --git a/lib/fonts/eufm10.sfd b/lib/fonts/eufm10.sfd
index c80451a..7082f5e 100644
--- a/lib/fonts/eufm10.sfd
+++ b/lib/fonts/eufm10.sfd
@@ -50,6 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 1239
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
+OS2Vendor: 'LyEd'
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
 DEI: 91125
diff --git a/lib/fonts/eufm10.ttf b/lib/fonts/eufm10.ttf
index 0e670d4..da7d5c3 100755
Binary files a/lib/fonts/eufm10.ttf and b/lib/fonts/eufm10.ttf differ
diff --git a/lib/fonts/msam10.sfd b/lib/fonts/msam10.sfd
index 20030cd..4e21436 100644
--- a/lib/fonts/msam10.sfd
+++ b/lib/fonts/msam10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 0
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
diff --git a/lib/fonts/msam10.ttf b/lib/fonts/msam10.ttf
index 3b0cd89..3eaad5a 100755
Binary files a/lib/fonts/msam10.ttf and b/lib/fonts/msam10.ttf differ
diff --git a/lib/fonts/msbm10.sfd b/lib/fonts/msbm10.sfd
index de6db27..2453f50 100644
--- a/lib/fonts/msbm10.sfd
+++ b/lib/fonts/msbm10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 721
 OS2StrikeYSize: 102
 OS2StrikeYPos: 530
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000000.00000000.00000000.00000000
 MarkAttachClasses: 1
diff --git a/lib/fonts/msbm10.ttf b/lib/fonts/msbm10.ttf
index 04a4717..dd7c294 100755
Binary files a/lib/fonts/msbm10.ttf and b/lib/fonts/msbm10.ttf differ
diff --git a/lib/fonts/rsfs10.sfd b/lib/fonts/rsfs10.sfd
index 8206bdf..b28f6f4 100644
--- a/lib/fonts/rsfs10.sfd
+++ b/lib/fonts/rsfs10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: -101
 OS2SupYOff: 490
 OS2StrikeYSize: 50
 OS2StrikeYPos: 264
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 80000001.00000000.00000000.00000000
 Lookup: 258 0 0 "'kern' Horizontal Kerning in Latin lookup 0"  {"'kern' Horizontal Kerning in Latin lookup 0 subtable"  } ['kern' ('latn' <'dflt' > ) ]
diff --git a/lib/fonts/rsfs10.ttf b/lib/fonts/rsfs10.ttf
index 4160bcf..4b17608 100755
Binary files a/lib/fonts/rsfs10.ttf and b/lib/fonts/rsfs10.ttf differ
diff --git a/lib/fonts/stmary10.sfd b/lib/fonts/stmary10.sfd
index f1841d9..56637c8 100644
--- a/lib/fonts/stmary10.sfd
+++ b/lib/fonts/stmary10.sfd
@@ -1,4 +1,4 @@
-SplineFontDB: 3.0
+SplineFontDB: 3.2
 FontName: stmary10
 FullName: stmary10
 FamilyName: stmary10
@@ -6,23 +6,30 @@ Weight: Roman
 Copyright: Copyright (c) Taco Hoekwater, 1998. All rights reserved.
 Version: 001.001
 ItalicAngle: 0
-UnderlinePosition: -102.4
-UnderlineWidth: 51.2
+UnderlinePosition: -102
+UnderlineWidth: 51
 Ascent: 819
 Descent: 205
+InvalidEm: 0
 LayerCount: 2
-Layer: 0 0 "Back"  1
-Layer: 1 0 "Zeichenebene"  0
+Layer: 0 0 "Back" 1
+Layer: 1 0 "Zeichenebene" 0
+FSType: 0
 OS2Version: 0
 OS2_WeightWidthSlopeOnly: 0
 OS2_UseTypoMetrics: 0
 CreationTime: 1302307949
-ModificationTime: 1421634721
+ModificationTime: 1599145907
+PfmFamily: 17
+TTFWeight: 400
+TTFWidth: 5
+LineGap: 92
+VLineGap: 0
 OS2TypoAscent: 0
 OS2TypoAOffset: 1
 OS2TypoDescent: 0
 OS2TypoDOffset: 1
-OS2TypoLinegap: 0
+OS2TypoLinegap: 92
 OS2WinAscent: 0
 OS2WinAOffset: 1
 OS2WinDescent: 0
@@ -31,17 +38,17 @@ HheadAscent: 0
 HheadAOffset: 1
 HheadDescent: 0
 HheadDOffset: 1
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 MarkAttachClasses: 1
 DEI: 91125
-LangName: 1033 "" "" "LyX" "FontForge 2.0 : stmary10 : 17-7-2010" 
+LangName: 1033 "" "" "LyX" "FontForge 2.0 : stmary10 : 17-7-2010"
 Encoding: UnicodeBmp
 UnicodeInterp: none
 NameList: Adobe Glyph List
 DisplaySize: -96
 AntiAlias: 1
 FitToEm: 1
-WinInfo: 0 8 2
+WinInfo: 64 8 2
 BeginPrivate: 0
 EndPrivate
 BeginChars: 65539 131
diff --git a/lib/fonts/stmary10.ttf b/lib/fonts/stmary10.ttf
index bafedc4..a380b37 100755
Binary files a/lib/fonts/stmary10.ttf and b/lib/fonts/stmary10.ttf differ
diff --git a/lib/fonts/wasy10.sfd b/lib/fonts/wasy10.sfd
index f70df41..10468b5 100644
--- a/lib/fonts/wasy10.sfd
+++ b/lib/fonts/wasy10.sfd
@@ -50,7 +50,7 @@ OS2SupXOff: 0
 OS2SupYOff: 0
 OS2StrikeYSize: 51
 OS2StrikeYPos: 265
-OS2Vendor: 'PfEd'
+OS2Vendor: 'LyEd'
 OS2CodePages: 00000001.00000000
 OS2UnicodeRanges: 00000001.00000000.00000000.00000000
 MarkAttachClasses: 1
diff --git a/lib/fonts/wasy10.ttf b/lib/fonts/wasy10.ttf
index a4e32d2..feebb21 100755
Binary files a/lib/fonts/wasy10.ttf and b/lib/fonts/wasy10.ttf differ
diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp
index bfc215d..24e5e9b 100644
--- a/src/frontends/qt4/GuiFontLoader.cpp
+++ b/src/frontends/qt4/GuiFontLoader.cpp
@@ -189,7 +189,14 @@ QFont symbolFont(QString const & family, bool * ok)
 	upper[0] = family[0].toUpper();
 
 	QFont font;
+#if defined Q_WS_X11 || defined(QPA_XCB)
+	// On *nix we have to also specify the foundry to be able to
+	// discriminate our fonts when the texlive fonts are managed by
+	// fontconfig. Unfortunately, doing the same on Windows breaks things.
+	font.setFamily(family + QLatin1String(" [LyEd]"));
+#else
 	font.setFamily(family);
+#endif
 #if QT_VERSION >= 0x040800
 	font.setStyleName("LyX");
 
diff --git a/status.23x b/status.23x
index 552ccd7..cf4d1b2 100644
--- a/status.23x
+++ b/status.23x
@@ -32,6 +32,8 @@ What's new
 
 - Allow creation of a child file from the include dialog (bug 4475).
 
+- Make sure to load the correct math fonts in certain cases.
+
 
 * MISCELLANEOUS
 


More information about the lyx-cvs mailing list