@@ -113,16 +113,27 @@ def create_resource_path(
113
113
return f"{ prefix } :resources:{ path .as_posix ()} { suffix } "
114
114
115
115
116
+ KENNEY_TTFS = "Kenney TTFs"
117
+ LIBERATION_TTFS = "Liberation TTFs"
118
+
116
119
# pending: post-3.0 cleanup # unstructured kludge
117
120
REPLACE_TITLE_WORDS = {
118
- "ttf" : "Kenney TTFs" ,
121
+ "Kenney" : KENNEY_TTFS ,
122
+ "Liberation" : LIBERATION_TTFS ,
119
123
"gui" : "GUI" ,
120
124
"window" : "Window & Panel" ,
121
125
"." : "Top-level Resources"
122
126
}
127
+ # NASTY! # pending: post-3.0 cleanup
128
+ OVERRIDE_LEVELS = {
129
+ KENNEY_TTFS : 2 ,
130
+ LIBERATION_TTFS : 2
131
+ }
132
+
123
133
# pending: post-3.0 cleanup # more unstructured filth
124
134
SKIP_TITLES = {
125
- "Kenney TTFs"
135
+ "Ttf"
136
+ # "Kenney TTFs"
126
137
}
127
138
128
139
@@ -230,6 +241,10 @@ def process_resource_directory(out, dir: Path):
230
241
231
242
file_list = filter_dir (path , keep = is_unskipped_file )
232
243
num_files = len (file_list )
244
+ def _debug_print_files () -> None : # pending: post-3.0 cleanup
245
+ """Nasty little temp helper"""
246
+ for file in file_list :
247
+ print (file .name )
233
248
234
249
if num_files > 0 :
235
250
@@ -246,23 +261,48 @@ def process_resource_directory(out, dir: Path):
246
261
continue
247
262
as_tup = tuple (display_parts [:heading_level ])
248
263
if as_tup not in visited_headings :
264
+ # NASTY! # pending: post 3.0 cleanup
265
+ if part in OVERRIDE_LEVELS :
266
+ heading_level = OVERRIDE_LEVELS [part ]
267
+
268
+ # print("!!!", heading_level, part, as_tup)
269
+
249
270
do_heading (out , heading_level , part )
250
271
visited_headings .add (as_tup )
251
272
252
273
if raw_resource_handle == ":resources:images/" :
253
- for f in file_list :
254
- print (f .name )
255
-
256
- if raw_resource_handle == ":resources:fonts/ttf/" :
257
- for f in file_list :
258
- print (f .name )
259
- # pending: post-3.0 cleanup
260
- out .write ("\n " )
261
- out .write (".. figure:: images/fonts_blue.png\n " )
262
- out .write (" :alt: The bundled Kenney.nl fonts.\n " )
263
- out .write ("\n " )
264
- out .write (" Arcade includes the following fonts from `Kenney.nl's font pack <https://kenney.nl/assets/kenney-fonts>`_\n " )
265
- out .write (" are available using the path and filenames below.\n " )
274
+ _debug_print_files ()
275
+
276
+ if raw_resource_handle .startswith (":resources:fonts/ttf/" ):
277
+ _debug_print_files ()
278
+ if raw_resource_handle .endswith ("Kenney/" ):
279
+ out .write ("\n " )
280
+
281
+ out .write (".. figure:: images/fonts_blue.png\n " )
282
+ # out.write(" :align: center\n")
283
+ out .write (" :alt: The bundled Kenney.nl fonts.\n " )
284
+ out .write ("\n " )
285
+ # Put the text *after* the CSS, or add <br> via .. raw:: html blocks
286
+ # since the CSS may be broken.
287
+ out .write ("Arcade includes the following fonts from `Kenney.nl's font pack <https://kenney.nl/assets/kenney-fonts>`_\n " )
288
+ out .write ("are available using the path and filenames below.\n " )
289
+ out .write ("\n " )
290
+
291
+ elif raw_resource_handle .endswith ("Liberation/" ):
292
+ out .write (
293
+ "\n "
294
+ ".. figure:: images/fonts_liberation.png\n "
295
+ " :alt: The bundled Liberation font family trio.\n "
296
+ #" :align: center\n"
297
+ # Put the text *after* the CSS, or add <br> via .. raw:: html blocks
298
+ # since the CSS may be broken.
299
+ "\n "
300
+ "Arcade also includes the Liberation font family. This trio of fonts is designed as\n "
301
+ "generic, drop-in replacements for Times New Roman, Arial, and Courier.\n "
302
+ "\n "
303
+ "The Liberation font family uses the proven, commercial-friendly\n "
304
+ "`SIL Open Font License`_ widely accepted within games and design spaces.\n "
305
+ )
266
306
267
307
n_cols = get_header_num_cols (raw_resource_handle , num_files )
268
308
widths = get_column_widths_for_n (n_cols )
0 commit comments