Move SourceHanSansLite.ttf to the top level, so it can be classified into projects.

This commit is contained in:
Tom Rothamel
2022-03-22 23:06:30 -04:00
parent f71a9727b9
commit cbd12817d3
16 changed files with 49 additions and 45 deletions
+7 -16
View File
@@ -31,7 +31,7 @@ init -1 python:
from store import config from store import config
def translate_font(language, font, path=None): def translate_font(language, font):
""" """
Selects the font file that is used when translating `language`. Selects the font file that is used when translating `language`.
@@ -39,26 +39,17 @@ init -1 python:
Is the name of the font file used for both the launcher and Is the name of the font file used for both the launcher and
the new GUI template. This should be a string giving the name the new GUI template. This should be a string giving the name
of the font file. of the font file.
`path`
The path to the font file, relative to the launcher's game
directory. If not given, defaults to fonts.
""" """
if path is None:
path = "fonts"
fullfont = path + "/" + font
def callback(): def callback():
gui.REGULAR_FONT = fullfont gui.REGULAR_FONT = font
gui.LIGHT_FONT = fullfont gui.LIGHT_FONT = font
gui.REGULAR_BOLD = True gui.REGULAR_BOLD = True
style._default.font = fullfont style._default.font = font
style.default.font = fullfont style.default.font = font
gui.system_font = fullfont gui.system_font = font
gui.project_system_font = font gui.project_system_font = font
config.language_callbacks[language].append(callback) config.language_callbacks[language].append(callback)
@@ -66,7 +57,7 @@ init -1 python:
def s(s): def s(s):
return '"' + s + '"' return '"' + s + '"'
gui7.translate_copy(language, fullfont, font) gui7.translate_copy(language, "sdk-fonts/" + font, font)
gui7.translate_define(language, "gui.text_font", s(font)) gui7.translate_define(language, "gui.text_font", s(font))
gui7.translate_define(language, "gui.name_text_font", s(font)) gui7.translate_define(language, "gui.name_text_font", s(font))
gui7.translate_define(language, "gui.interface_text_font", s(font)) gui7.translate_define(language, "gui.interface_text_font", s(font))
+1 -1
View File
@@ -356,7 +356,7 @@ class CodeGenerator(object):
def copy_files(self): def copy_files(self):
for src, dst in language_copies[self.p.language]: for src, dst in language_copies[self.p.language]:
src = os.path.join(renpy.config.gamedir, src) src = os.path.join(renpy.config.renpy_base, src)
dst = os.path.join(self.p.prefix, dst) dst = os.path.join(self.p.prefix, dst)
if os.path.exists(dst): if os.path.exists(dst):
+6
View File
@@ -30,6 +30,9 @@
init -1 python hide: init -1 python hide:
# Update the searchpath to find additional fonts.
config.searchpath.append(config.renpy_base + "/sdk-fonts")
# Should we enable the use of developer tools? This should be # Should we enable the use of developer tools? This should be
# set to False before the game is released, so the user can't # set to False before the game is released, so the user can't
# cheat using developer tools. # cheat using developer tools.
@@ -349,6 +352,9 @@ init python:
source_and_binary("the_question") source_and_binary("the_question")
source_and_binary("tutorial") source_and_binary("tutorial")
# extra fonts.
build.classify_renpy("sdk-fonts/**", "source")
# docs. # docs.
build.classify_renpy("doc/", "source") build.classify_renpy("doc/", "source")
build.classify_renpy("doc/.doctrees/", None) build.classify_renpy("doc/.doctrees/", None)
+5
View File
@@ -162,6 +162,11 @@ define config.window_icon = "gui/window_icon.png"
init python: init python:
# SDK Fonts.
config.searchpath.append(config.renpy_base + "/sdk-fonts")
config.searchpath.append("sdk-fonts")
build.classify_renpy("sdk-fonts/**", "all")
## The following functions take file patterns. File patterns are case- ## The following functions take file patterns. File patterns are case-
## insensitive, and matched against the path relative to the base directory, ## insensitive, and matched against the path relative to the base directory,
## with and without a leading /. If multiple patterns match, the first is ## with and without a leading /. If multiple patterns match, the first is
+14 -15
View File
@@ -789,25 +789,24 @@ screen preferences():
textbutton _("After Choices") action Preference("after choices", "toggle") textbutton _("After Choices") action Preference("after choices", "toggle")
textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))
if renpy.loadable("../../launcher/game/fonts/SourceHanSansLite.ttf"): ## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
#begin language_picker #begin language_picker
## Additional vboxes of type "radio_pref" or "check_pref" can be
## added here, to add additional creator-defined preferences.
vbox: vbox:
style_prefix "radio" style_prefix "radio"
label _("Language") label _("Language")
textbutton "English" text_font "DejaVuSans.ttf" action Language(None) textbutton "English" text_font "DejaVuSans.ttf" action Language(None)
textbutton "Français" text_font "DejaVuSans.ttf" action Language("french") textbutton "Français" text_font "DejaVuSans.ttf" action Language("french")
textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian") textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian")
textbutton "Bahasa Melayu" text_font "DejaVuSans.ttf" action Language("malay") textbutton "Bahasa Melayu" text_font "DejaVuSans.ttf" action Language("malay")
textbutton "한국어" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("korean") textbutton "한국어" text_font "SourceHanSansLite.ttf" action Language("korean")
textbutton "简体中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("schinese") textbutton "简体中文" text_font "SourceHanSansLite.ttf" action Language("schinese")
textbutton "繁體中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("tchinese") textbutton "繁體中文" text_font "SourceHanSansLite.ttf" action Language("tchinese")
textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish") textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish")
textbutton "日本語" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("japanese") textbutton "日本語" text_font "SourceHanSansLite.ttf" action Language("japanese")
#end language_picker #end language_picker
+1 -2
View File
@@ -1,5 +1,5 @@
translate japanese python: translate japanese python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
translate japanese strings: translate japanese strings:
@@ -14,4 +14,3 @@ translate japanese strings:
# game/options.rpy:32 # game/options.rpy:32
old "Character Art: Deji.\nOriginal Character Art: derik.\n\nBackground Art: Mugenjohncel.\nOriginal Background Art: DaFool\n\nMusic By: Alessio\n\nWritten By: mikey" old "Character Art: Deji.\nOriginal Character Art: derik.\n\nBackground Art: Mugenjohncel.\nOriginal Background Art: DaFool\n\nMusic By: Alessio\n\nWritten By: mikey"
new "Character Art: Deji.\nOriginal Character Art: derik.\n\nBackground Art: Mugenjohncel.\nOriginal Background Art: DaFool\n\nMusic By: Alessio\n\nWritten By: mikey" new "Character Art: Deji.\nOriginal Character Art: derik.\n\nBackground Art: Mugenjohncel.\nOriginal Background Art: DaFool\n\nMusic By: Alessio\n\nWritten By: mikey"
+1 -1
View File
@@ -1,5 +1,5 @@
translate korean python: translate korean python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
config.window_title = u"물음 (The Question)" config.window_title = u"물음 (The Question)"
translate korean strings: translate korean strings:
+1 -1
View File
@@ -1,5 +1,5 @@
translate schinese python: translate schinese python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
translate schinese strings: translate schinese strings:
+1 -1
View File
@@ -1,5 +1,5 @@
translate tchinese python: translate tchinese python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
translate tchinese strings: translate tchinese strings:
+5
View File
@@ -152,6 +152,11 @@ define config.window_icon = "gui/window_icon.png"
init python: init python:
## Add SDK Fonts.
config.searchpath.append(config.renpy_base + "/sdk-fonts")
config.searchpath.append("sdk-fonts")
build.classify_renpy("sdk-fonts/**", "all")
## The following functions take file patterns. File patterns are case- ## The following functions take file patterns. File patterns are case-
## insensitive, and matched against the path relative to the base directory, ## insensitive, and matched against the path relative to the base directory,
## with and without a leading /. If multiple patterns match, the first is ## with and without a leading /. If multiple patterns match, the first is
+3 -3
View File
@@ -776,9 +776,9 @@ screen preferences():
textbutton "Français" text_font "DejaVuSans.ttf" action Language("french") textbutton "Français" text_font "DejaVuSans.ttf" action Language("french")
textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian") textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian")
textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish") textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish")
textbutton "한국어" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("korean") textbutton "한국어" text_font "SourceHanSansLite.ttf" action Language("korean")
textbutton "日本語" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("japanese") textbutton "日本語" text_font "SourceHanSansLite.ttf" action Language("japanese")
textbutton "简体中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("schinese") textbutton "简体中文" text_font "SourceHanSansLite.ttf" action Language("schinese")
# This should be last. # This should be last.
textbutton "Pig Latin" text_font "DejaVuSans.ttf" action Language("piglatin") textbutton "Pig Latin" text_font "DejaVuSans.ttf" action Language("piglatin")
+1 -1
View File
@@ -1,2 +1,2 @@
translate japanese python: translate japanese python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
+1 -2
View File
@@ -709,7 +709,7 @@ translate korean strings:
# indepth_style.rpy:22 # indepth_style.rpy:22
old "Button 2" old "Button 2"
new "{font=../../launcher/game/fonts/SourceHanSansLite.ttf}버튼 2{/font}" new "{font=SourceHanSansLite.ttf}버튼 2{/font}"
# indepth_style.rpy:66 # indepth_style.rpy:66
old "Style basics." old "Style basics."
@@ -806,4 +806,3 @@ translate korean strings:
# indepth_style.rpy:886 # indepth_style.rpy:886
old "Sixth Child" old "Sixth Child"
new "여섯 번째 자식" new "여섯 번째 자식"
+1 -1
View File
@@ -1,5 +1,5 @@
translate korean python: translate korean python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"
config.window_title = u"길라잡이" config.window_title = u"길라잡이"
translate korean strings: translate korean strings:
+1 -1
View File
@@ -1,2 +1,2 @@
translate schinese python: translate schinese python:
gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "../../launcher/game/fonts/SourceHanSansLite.ttf" gui.system_font = gui.main_font = gui.text_font = gui.name_text_font = gui.interface_text_font = gui.button_text_font = gui.choice_button_text_font = "SourceHanSansLite.ttf"