Skip to content

Commit b7e775a

Browse files
committed
Get Kenney and Liberation to show in resources
* Add initial graphic courtesy of @DigiDuncan * Add SIL Open Font License to links.rst * Add basic inset for the Liberation fonts * Add printing for the Liberation font info + SIL link
1 parent e24e2f5 commit b7e775a

File tree

3 files changed

+56
-15
lines changed

3 files changed

+56
-15
lines changed
79.9 KB
Loading

doc/links.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
.. Concepts
3030
.. _CC0: https://creativecommons.org/publicdomain/#publicdomain-cc0-10
3131
.. _Creative Commons licenses: https://creativecommons.org/share-your-work/cclicenses/
32+
.. _SIL Open Font License: https://openfontlicense.org/
3233

3334
.. Licensing
3435
.. _BibTeX: https://www.bibtex.org/Format/

util/create_resources_listing.py

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,27 @@ def create_resource_path(
113113
return f"{prefix}:resources:{path.as_posix()}{suffix}"
114114

115115

116+
KENNEY_TTFS = "Kenney TTFs"
117+
LIBERATION_TTFS = "Liberation TTFs"
118+
116119
# pending: post-3.0 cleanup # unstructured kludge
117120
REPLACE_TITLE_WORDS = {
118-
"ttf": "Kenney TTFs",
121+
"Kenney": KENNEY_TTFS,
122+
"Liberation": LIBERATION_TTFS,
119123
"gui": "GUI",
120124
"window": "Window & Panel",
121125
".": "Top-level Resources"
122126
}
127+
# NASTY! # pending: post-3.0 cleanup
128+
OVERRIDE_LEVELS = {
129+
KENNEY_TTFS: 2,
130+
LIBERATION_TTFS: 2
131+
}
132+
123133
# pending: post-3.0 cleanup # more unstructured filth
124134
SKIP_TITLES = {
125-
"Kenney TTFs"
135+
"Ttf"
136+
# "Kenney TTFs"
126137
}
127138

128139

@@ -230,6 +241,10 @@ def process_resource_directory(out, dir: Path):
230241

231242
file_list = filter_dir(path, keep=is_unskipped_file)
232243
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)
233248

234249
if num_files > 0:
235250

@@ -246,23 +261,48 @@ def process_resource_directory(out, dir: Path):
246261
continue
247262
as_tup = tuple(display_parts[:heading_level])
248263
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+
249270
do_heading(out, heading_level, part)
250271
visited_headings.add(as_tup)
251272

252273
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+
)
266306

267307
n_cols = get_header_num_cols(raw_resource_handle, num_files)
268308
widths = get_column_widths_for_n(n_cols)

0 commit comments

Comments
 (0)