Redo patches to account for d21447d096a320a08b3efb2b8768fad0dcdcfd64
[netsurf-overlay.git] / www-client / netsurf / files / netsurf-9999-add-mona-family.patch
blobcb30e447700ce5468b25c9762fd4991526ab98ec
1 diff --git a/Docs/BUILDING-Framebuffer b/Docs/BUILDING-Framebuffer
2 index 3c8858a..f3683a2 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 89b8814..e29b603 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 3af8f98..b846b18 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 e4c3100..dd7837b 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 7b2f4f4..adcdbde 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/css/dump.c b/css/dump.c
71 index d3ebc94..cd0cb1e 100644
72 --- a/css/dump.c
73 +++ b/css/dump.c
74 @@ -810,6 +810,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/css/select.c b/css/select.c
85 index a929cf1..2e19633 100644
86 --- a/css/select.c
87 +++ b/css/select.c
88 @@ -1801,6 +1801,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 2f36887..897df6d 100644
100 --- a/desktop/options.h
101 +++ b/desktop/options.h
102 @@ -79,6 +79,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/desktop/plot_style.h b/desktop/plot_style.h
113 index af54e79..ce7cdcc 100644
114 --- a/desktop/plot_style.h
115 +++ b/desktop/plot_style.h
116 @@ -130,6 +130,7 @@ typedef enum {
117 PLOT_FONT_FAMILY_MONOSPACE,
118 PLOT_FONT_FAMILY_CURSIVE,
119 PLOT_FONT_FAMILY_FANTASY,
120 + PLOT_FONT_FAMILY_MONA,
121 PLOT_FONT_FAMILY_COUNT /**< Number of generic families */
122 } plot_font_generic_family_t;
124 diff --git a/frontends/framebuffer/Makefile b/frontends/framebuffer/Makefile
125 index 15888ae..7eaad15 100644
126 --- a/frontends/framebuffer/Makefile
127 +++ b/frontends/framebuffer/Makefile
128 @@ -19,6 +19,7 @@ CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE="$(NETSURF_FB_FONT_MONOSPACE)"'
129 CFLAGS += '-DNETSURF_FB_FONT_MONOSPACE_BOLD="$(NETSURF_FB_FONT_MONOSPACE_BOLD)"'
130 CFLAGS += '-DNETSURF_FB_FONT_CURSIVE="$(NETSURF_FB_FONT_CURSIVE)"'
131 CFLAGS += '-DNETSURF_FB_FONT_FANTASY="$(NETSURF_FB_FONT_FANTASY)"'
132 +CFLAGS += '-DNETSURF_FB_FONT_MONA="$(NETSURF_FB_FONT_MONA)"'
134 CFLAGS += -std=c99 -g -Dsmall \
135 -D_BSD_SOURCE \
136 diff --git a/frontends/framebuffer/Makefile.defaults b/frontends/framebuffer/Makefile.defaults
137 index 92d837e..97cb31c 100644
138 --- a/frontends/framebuffer/Makefile.defaults
139 +++ b/frontends/framebuffer/Makefile.defaults
140 @@ -36,6 +36,7 @@ NETSURF_FB_FONT_MONOSPACE := DejaVuSansMono.ttf
141 NETSURF_FB_FONT_MONOSPACE_BOLD := DejaVuSansMono-Bold.ttf
142 NETSURF_FB_FONT_CURSIVE := Comic_Sans_MS.ttf
143 NETSURF_FB_FONT_FANTASY := Impact.ttf
144 +NETSURF_FB_FONT_MONA := ipagp-mona.ttf
146 # Default binary install path
147 NETSURF_FRAMEBUFFER_BIN := $(PREFIX)/bin/
148 diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
149 index 7756ae7..c009bcb 100644
150 --- a/frontends/framebuffer/font_freetype.c
151 +++ b/frontends/framebuffer/font_freetype.c
152 @@ -66,6 +66,7 @@ enum fb_face_e {
153 FB_FACE_MONOSPACE_BOLD,
154 FB_FACE_CURSIVE,
155 FB_FACE_FANTASY,
156 + FB_FACE_MONA,
157 FB_FACE_COUNT
160 @@ -296,6 +297,17 @@ bool fb_font_init(void)
161 fb_faces[FB_FACE_FANTASY] = fb_face;
164 + /* mona face */
165 + fb_face = fb_new_face(nsoption_charp(fb_face_mona),
166 + "ipagp-mona.ttf",
167 + NETSURF_FB_FONT_MONA);
168 + if (fb_face == NULL) {
169 + /* mona face unavailable use the default */
170 + fb_faces[FB_FACE_MONA] = fb_faces[FB_FACE_SANS_SERIF];
171 + } else {
172 + fb_faces[FB_FACE_MONA] = fb_face;
176 /* set the default render mode */
177 if (nsoption_bool(fb_font_monochrome) == true)
178 @@ -366,6 +378,10 @@ static void fb_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
179 selected_face = FB_FACE_FANTASY;
180 break;
182 + case PLOT_FONT_FAMILY_MONA:
183 + selected_face = FB_FACE_MONA;
184 + break;
186 case PLOT_FONT_FAMILY_SANS_SERIF:
187 default:
188 if ((fstyle->flags & FONTF_ITALIC) ||
189 diff --git a/frontends/framebuffer/options.h b/frontends/framebuffer/options.h
190 index eee6f4b..c3a565a 100644
191 --- a/frontends/framebuffer/options.h
192 +++ b/frontends/framebuffer/options.h
193 @@ -62,6 +62,7 @@ NSOPTION_STRING(fb_face_monospace, NULL)
194 NSOPTION_STRING(fb_face_monospace_bold, NULL)
195 NSOPTION_STRING(fb_face_cursive, NULL)
196 NSOPTION_STRING(fb_face_fantasy, NULL)
197 +NSOPTION_STRING(fb_face_mona, NULL)
200 * Local Variables:
201 diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c
202 index e705918..5035a15 100644
203 --- a/frontends/gtk/gui.c
204 +++ b/frontends/gtk/gui.c
205 @@ -219,6 +219,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
206 nsoption_set_charp(font_mono, strdup("Monospace"));
207 nsoption_set_charp(font_cursive, strdup("Serif"));
208 nsoption_set_charp(font_fantasy, strdup("Serif"));
209 + nsoption_set_charp(font_mona, strdup("IPAMonaPGothic"));
211 return NSERROR_OK;
213 diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c
214 index 49b6293..a951d2a 100644
215 --- a/frontends/gtk/layout_pango.c
216 +++ b/frontends/gtk/layout_pango.c
217 @@ -271,6 +271,9 @@ nsfont_style_to_description(const plot_font_style_t *fstyle)
218 case PLOT_FONT_FAMILY_FANTASY:
219 desc = pango_font_description_from_string(nsoption_charp(font_fantasy));
220 break;
221 + case PLOT_FONT_FAMILY_MONA:
222 + desc = pango_font_description_from_string(nsoption_charp(font_mona));
223 + break;
224 case PLOT_FONT_FAMILY_SANS_SERIF:
225 default:
226 desc = pango_font_description_from_string(nsoption_charp(font_sans));
227 diff --git a/frontends/gtk/res/options.gtk2.ui b/frontends/gtk/res/options.gtk2.ui
228 index d5542ba..b4a6c2d 100644
229 --- a/frontends/gtk/res/options.gtk2.ui
230 +++ b/frontends/gtk/res/options.gtk2.ui
231 @@ -2862,6 +2862,9 @@
232 <row>
233 <col id="0" translatable="yes">preferencesFonttypeFantasy</col>
234 </row>
235 + <row>
236 + <col id="0" translatable="yes">preferencesFonttypeMona</col>
237 + </row>
238 </data>
239 </object>
240 <object class="GtkImage" id="image1">
241 diff --git a/frontends/gtk/res/options.gtk3.ui b/frontends/gtk/res/options.gtk3.ui
242 index 2a3516f..4a98971 100644
243 --- a/frontends/gtk/res/options.gtk3.ui
244 +++ b/frontends/gtk/res/options.gtk3.ui
245 @@ -2881,6 +2881,9 @@
246 <row>
247 <col id="0" translatable="yes">preferencesFonttypeFantasy</col>
248 </row>
249 + <row>
250 + <col id="0" translatable="yes">preferencesFonttypeMona</col>
251 + </row>
252 </data>
253 </object>
254 <object class="GtkListStore" id="liststore_developer_view">
255 diff --git a/render/font.c b/render/font.c
256 index 0b059a2..4214f86 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 9a86234..c14b6de 100644
271 --- a/resources/FatMessages
272 +++ b/resources/FatMessages
273 @@ -2542,6 +2542,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 @@ -6122,6 +6125,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