Bläddra i källkod

Set default typeface in web views to TeX Gyre Pagella

Neal Wilson 11 år sedan
förälder
incheckning
d4f39e0b1c

+ 4
- 0
src/resources.qrc Visa fil

@@ -15,5 +15,9 @@
15 15
         <file>resources/html/about.html</file>
16 16
         <file>resources/html/style.css</file>
17 17
         <file>resources/fonts/entypo.ttf</file>
18
+        <file>resources/fonts/texgyrepagella-bold.otf</file>
19
+        <file>resources/fonts/texgyrepagella-bolditalic.otf</file>
20
+        <file>resources/fonts/texgyrepagella-italic.otf</file>
21
+        <file>resources/fonts/texgyrepagella-regular.otf</file>
18 22
     </qresource>
19 23
 </RCC>

Binär
src/resources/fonts/texgyrepagella-bold.otf Visa fil


Binär
src/resources/fonts/texgyrepagella-bolditalic.otf Visa fil


Binär
src/resources/fonts/texgyrepagella-italic.otf Visa fil


Binär
src/resources/fonts/texgyrepagella-regular.otf Visa fil


+ 12
- 0
src/typica.w Visa fil

@@ -12441,11 +12441,23 @@ app.setWindowIcon(QIcon(":/resources/icons/appicons/logo.svg"));
12441 12441
 @ Similarly some elements make use of a special font which is loaded from
12442 12442
 resource data.
12443 12443
 
12444
+There has been a report of a bug which I have not been able to reproduce and
12445
+which the original reporter has not yet gotten back to me with the results of
12446
+a test, so I have opted for an alternate approach which does not preclude the
12447
+use of the earlier plan but which may solve the matter. This brings in the
12448
+TeX Gyre Pagella font and sets this as the default standard font for all web
12449
+views.
12450
+
12444 12451
 @<Set up fonts@>=
12445 12452
 QFile entypo(":/resources/fonts/entypo.ttf");
12446 12453
 entypo.open(QIODevice::ReadOnly);
12447 12454
 QFontDatabase::addApplicationFontFromData(entypo.readAll());
12448 12455
 entypo.close();
12456
+QFontDatabase::addApplicationFont(":/resources/fonts/texgyrepagella-regular.otf");
12457
+QFontDatabase::addApplicationFont(":/resources/fonts/texgyrepagella-bold.otf");
12458
+QFontDatabase::addApplicationFont(":/resources/fonts/texgyrepagella-bolditalic.otf");
12459
+QFontDatabase::addApplicationFont(":/resources/fonts/texgyrepagella-italic.otf");
12460
+QWebSettings::globalSettings()->setFontFamily(QWebSettings::StandardFont, "Tex Gyre Pagella");
12449 12461
 
12450 12462
 @ Some widgets provided by \pn{} require access to a database in order to work.
12451 12463
 To simplify using these widgets, the application will request information

Laddar…
Avbryt
Spara