Adjust mona patch for plot_style.h relocation
[netsurf-overlay.git] / www-client / netsurf / files / netsurf-9999-add-mona-family.patch
blob607b2fe0f3e26db38caa93ca40e4a31b8a919d90
1 diff --git a/Docs/BUILDING-Framebuffer b/Docs/BUILDING-Framebuffer
2 index 3c8858a32..f3683a249 100644
3 --- a/Docs/BUILDING-Framebuffer
4 +++ b/Docs/BUILDING-Framebuffer
5 @@ -242,6 +242,7 @@
6 NETSURF_FB_FONT_MONOSPACE_BOLD
7 NETSURF_FB_FONT_CURSIVE
8 NETSURF_FB_FONT_FANTASY
9 + NETSURF_FB_FONT_MONA
11 The font selection may be changed by placing truetype font files
12 in the resources path. The resource files will be the generic names
13 @@ -264,6 +265,7 @@
14 fb_face_monospace_bold - The bold monospaced font
15 fb_face_cursive - The cursive font
16 fb_face_fantasy - The fantasy font
17 + fb_face_mona - The mona font
19 Old Freetype
20 --------------
21 diff --git a/Docs/Options b/Docs/Options
22 index 89b881414..e29b60303 100644
23 --- a/Docs/Options
24 +++ b/Docs/Options
25 @@ -54,6 +54,8 @@ General Options
26 | | | | |
27 | font_fantasy | string | NULL | Default fantasy font
28 | | | | |
29 +| font_mona | string | NULL | Default mona font
30 +| | | | |
31 | accept_language | string | NULL | Accept-Language header.
32 | | | | |
33 | accept_charset | string | NULL | Accept-Charset header.
34 diff --git a/Docs/USING-Framebuffer b/Docs/USING-Framebuffer
35 index 3af8f983f..b846b1821 100644
36 --- a/Docs/USING-Framebuffer
37 +++ b/Docs/USING-Framebuffer
38 @@ -205,3 +205,4 @@ Configuring
39 fb_face_monospace_bold - The bold monospaced font
40 fb_face_cursive - The cursive font
41 fb_face_fantasy - The fantasy font
42 + fb_face_mona - The mona font
43 diff --git a/Docs/netsurf-fb.1 b/Docs/netsurf-fb.1
44 index e4c310075..dd7837b5c 100644
45 --- a/Docs/netsurf-fb.1
46 +++ b/Docs/netsurf-fb.1
47 @@ -80,6 +80,9 @@ Family name of the cursive font.
48 .B \-\-font_fantasy
49 Family name of the fantasy font.
50 .TP
51 +.B \-\-font_mona
52 +Family name of the mona font.
53 +.TP
54 .B \-\-accept_language
55 Languages to accept.
56 .TP
57 diff --git a/Docs/netsurf-gtk.1 b/Docs/netsurf-gtk.1
58 index 7b2f4f4f3..adcdbdeb1 100644
59 --- a/Docs/netsurf-gtk.1
60 +++ b/Docs/netsurf-gtk.1
61 @@ -57,6 +57,8 @@ Family name of the monospace font.
62 Family name of the cursive font.
63 .It Fl -font_fantasy
64 Family name of the fantasy font.
65 +.It Fl -font_mona
66 +Family name of the mona font.
67 .It Fl -accept_language
68 Languages to accept.
69 .It Fl -accept_charset
70 diff --git a/content/handlers/css/dump.c b/content/handlers/css/dump.c
71 index 1ad188cb8..7da1c6a0f 100644
72 --- a/content/handlers/css/dump.c
73 +++ b/content/handlers/css/dump.c
74 @@ -896,6 +896,9 @@ void nscss_dump_computed_style(FILE *stream, const css_computed_style *style)
75 case CSS_FONT_FAMILY_MONOSPACE:
76 fprintf(stream, " monospace ");
77 break;
78 + case CSS_FONT_FAMILY_MONA:
79 + fprintf(stream, " mona ");
80 + break;
84 diff --git a/content/handlers/css/select.c b/content/handlers/css/select.c
85 index daa3b4087..d8a84b83e 100644
86 --- a/content/handlers/css/select.c
87 +++ b/content/handlers/css/select.c
88 @@ -1794,6 +1794,9 @@ css_error ua_default_for_property(void *pw, uint32_t property, css_hint *hint)
89 case PLOT_FONT_FAMILY_FANTASY:
90 hint->status = CSS_FONT_FAMILY_FANTASY;
91 break;
92 + case PLOT_FONT_FAMILY_MONA:
93 + hint->status = CSS_FONT_FAMILY_MONA;
94 + break;
96 } else if (property == CSS_PROP_QUOTES) {
97 /** \todo Not exactly useful :) */
98 diff --git a/desktop/options.h b/desktop/options.h
99 index d91898c6e..7c077b4dc 100644
100 --- a/desktop/options.h
101 +++ b/desktop/options.h
102 @@ -82,6 +82,9 @@ NSOPTION_STRING(font_cursive, NULL)
103 /** Default fantasy font */
104 NSOPTION_STRING(font_fantasy, NULL)
106 +/** Default mona font */
107 +NSOPTION_STRING(font_mona, NULL)
109 /** Accept-Language header. */
110 NSOPTION_STRING(accept_language, NULL)
112 diff --git a/frontends/framebuffer/Makefile b/frontends/framebuffer/Makefile
113 index 6d2acb079..cba1ced9e 100644
114 --- a/frontends/framebuffer/Makefile
115 +++ b/frontends/framebuffer/Makefile
116 @@ -19,6 +19,7 @@ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
117 CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
118 CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
119 CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
120 +CFLAGS += '-DNETSURF_FB_FONT_MONA="$(NETSURF_FB_FONT_MONA)"'
122 CFLAGS += -std=c99 -g -Dsmall \
123 -D_BSD_SOURCE \
124 diff --git a/frontends/framebuffer/Makefile.defaults b/frontends/framebuffer/Makefile.defaults
125 index cc712e992..aa18b2738 100644
126 --- a/frontends/framebuffer/Makefile.defaults
127 +++ b/frontends/framebuffer/Makefile.defaults
128 @@ -36,6 +36,7 @@ NETSURF_FB_FONT_MONOSPACE := DejaVuSansMono.ttf
129 NETSURF_FB_FONT_MONOSPACE_BOLD := DejaVuSansMono-Bold.ttf
130 NETSURF_FB_FONT_CURSIVE := Comic_Sans_MS.ttf
131 NETSURF_FB_FONT_FANTASY := Impact.ttf
132 +NETSURF_FB_FONT_MONA := ipagp-mona.ttf
134 # Default binary install path
135 NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
136 diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
137 index e7c07f5ff..b5b95e443 100644
138 --- a/frontends/framebuffer/font_freetype.c
139 +++ b/frontends/framebuffer/font_freetype.c
140 @@ -67,6 +67,7 @@ enum fb_face_e {
141 FB_FACE_MONOSPACE_BOLD,
142 FB_FACE_CURSIVE,
143 FB_FACE_FANTASY,
144 + FB_FACE_MONA,
145 FB_FACE_COUNT
148 @@ -297,6 +298,17 @@ bool fb_font_init(void)
149 fb_faces[FB_FACE_FANTASY] = fb_face;
152 + /* mona face */
153 + fb_face = fb_new_face(nsoption_charp(fb_face_mona),
154 + "ipagp-mona.ttf",
155 + NETSURF_FB_FONT_MONA);
156 + if (fb_face == NULL) {
157 + /* mona face unavailable use the default */
158 + fb_faces[FB_FACE_MONA] = fb_faces[FB_FACE_SANS_SERIF];
159 + } else {
160 + fb_faces[FB_FACE_MONA] = fb_face;
164 /* set the default render mode */
165 if (nsoption_bool(fb_font_monochrome) == true)
166 @@ -367,6 +379,10 @@ static void fb_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
167 selected_face = FB_FACE_FANTASY;
168 break;
170 + case PLOT_FONT_FAMILY_MONA:
171 + selected_face = FB_FACE_MONA;
172 + break;
174 case PLOT_FONT_FAMILY_SANS_SERIF:
175 default:
176 if ((fstyle->flags & FONTF_ITALIC) ||
177 diff --git a/frontends/framebuffer/options.h b/frontends/framebuffer/options.h
178 index eee6f4bc6..c3a565a1f 100644
179 --- a/frontends/framebuffer/options.h
180 +++ b/frontends/framebuffer/options.h
181 @@ -62,6 +62,7 @@ NSOPTION_STRING(fb_face_monospace, NULL)
182 NSOPTION_STRING(fb_face_monospace_bold, NULL)
183 NSOPTION_STRING(fb_face_cursive, NULL)
184 NSOPTION_STRING(fb_face_fantasy, NULL)
185 +NSOPTION_STRING(fb_face_mona, NULL)
188 * Local Variables:
189 diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
190 index 8d6b42234..641db3992 100644
191 --- a/frontends/gtk/gui.c
192 +++ b/frontends/gtk/gui.c
193 @@ -217,6 +217,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
194 nsoption_set_charp(font_mono, strdup("Monospace"));
195 nsoption_set_charp(font_cursive, strdup("Serif"));
196 nsoption_set_charp(font_fantasy, strdup("Serif"));
197 + nsoption_set_charp(font_mona, strdup("IPAMonaPGothic"));
199 return NSERROR_OK;
201 diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c
202 index bad57d684..49c530fe1 100644
203 --- a/frontends/gtk/layout_pango.c
204 +++ b/frontends/gtk/layout_pango.c
205 @@ -272,6 +272,9 @@ nsfont_style_to_description(const plot_font_style_t *fstyle)
206 case PLOT_FONT_FAMILY_FANTASY:
207 desc = pango_font_description_from_string(nsoption_charp(font_fantasy));
208 break;
209 + case PLOT_FONT_FAMILY_MONA:
210 + desc = pango_font_description_from_string(nsoption_charp(font_mona));
211 + break;
212 case PLOT_FONT_FAMILY_SANS_SERIF:
213 default:
214 desc = pango_font_description_from_string(nsoption_charp(font_sans));
215 diff --git a/frontends/gtk/res/options.gtk2.ui b/frontends/gtk/res/options.gtk2.ui
216 index d5542ba5d..b4a6c2d31 100644
217 --- a/frontends/gtk/res/options.gtk2.ui
218 +++ b/frontends/gtk/res/options.gtk2.ui
219 @@ -2862,6 +2862,9 @@
220 <row>
221 <col id="0" translatable="yes">preferencesFonttypeFantasy</col>
222 </row>
223 + <row>
224 + <col id="0" translatable="yes">preferencesFonttypeMona</col>
225 + </row>
226 </data>
227 </object>
228 <object class="GtkImage" id="image1">
229 diff --git a/frontends/gtk/res/options.gtk3.ui b/frontends/gtk/res/options.gtk3.ui
230 index 2a3516f09..4a989710c 100644
231 --- a/frontends/gtk/res/options.gtk3.ui
232 +++ b/frontends/gtk/res/options.gtk3.ui
233 @@ -2881,6 +2881,9 @@
234 <row>
235 <col id="0" translatable="yes">preferencesFonttypeFantasy</col>
236 </row>
237 + <row>
238 + <col id="0" translatable="yes">preferencesFonttypeMona</col>
239 + </row>
240 </data>
241 </object>
242 <object class="GtkListStore" id="liststore_developer_view">
243 diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
244 index 30db3663e..b39154f7f 100644
245 --- a/include/netsurf/plot_style.h
246 +++ b/include/netsurf/plot_style.h
247 @@ -71,6 +71,7 @@ typedef enum {
248 PLOT_FONT_FAMILY_MONOSPACE,
249 PLOT_FONT_FAMILY_CURSIVE,
250 PLOT_FONT_FAMILY_FANTASY,
251 + PLOT_FONT_FAMILY_MONA,
252 PLOT_FONT_FAMILY_COUNT /**< Number of generic families */
253 } plot_font_generic_family_t;
255 diff --git a/render/font.c b/render/font.c
256 index 94ef877c7..6136ad33b 100644
257 --- a/render/font.c
258 +++ b/render/font.c
259 @@ -52,6 +52,9 @@ static plot_font_generic_family_t plot_font_generic_family(
260 case CSS_FONT_FAMILY_FANTASY:
261 plot = PLOT_FONT_FAMILY_FANTASY;
262 break;
263 + case CSS_FONT_FAMILY_MONA:
264 + plot = PLOT_FONT_FAMILY_MONA;
265 + break;
266 case CSS_FONT_FAMILY_SANS_SERIF:
267 default:
268 plot = PLOT_FONT_FAMILY_SANS_SERIF;
269 diff --git a/resources/FatMessages b/resources/FatMessages
270 index ead95fc06..c311eb393 100644
271 --- a/resources/FatMessages
272 +++ b/resources/FatMessages
273 @@ -2552,6 +2552,9 @@ nl.gtk.preferencesFonttypeCursive:Cursief
274 en.gtk.preferencesFonttypeFantasy:Fantasy
275 fr.gtk.preferencesFonttypeFantasy:Fantasy
276 nl.gtk.preferencesFonttypeFantasy:Fantasie
277 +en.gtk.preferencesFonttypeMona:Mona
278 +fr.gtk.preferencesFonttypeMona:Mona
279 +nl.gtk.preferencesFonttypeMona:Mona
280 en.gtk.preferencesPrivacyTabtitle:Privacy
281 fr.gtk.preferencesPrivacyTabtitle:Confidentialité
282 nl.gtk.preferencesPrivacyTabtitle:Privacy
283 @@ -6137,6 +6140,11 @@ de.all.FontFantasy:Fantasy
284 fr.all.FontFantasy:Fantaisie
285 it.all.FontFantasy:Fantasia
286 nl.all.FontFantasy:Fantasie
287 +en.all.FontMona:Mona
288 +de.all.FontMona:Mona
289 +fr.all.FontMona:Mona
290 +it.all.FontMona:Mona
291 +nl.all.FontMona:Mona
292 en.ami.FontFallback:Preferred fallback
293 de.ami.FontFallback:Preferred fallback
294 fr.ami.FontFallback:Police de caractères de secour préférée