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