diff --git a/launcher/game/gui7.rpy b/launcher/game/gui7.rpy index 758ff58d2..2787d599a 100644 --- a/launcher/game/gui7.rpy +++ b/launcher/game/gui7.rpy @@ -31,7 +31,7 @@ init -1 python: 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`. @@ -39,26 +39,17 @@ init -1 python: 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 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(): - gui.REGULAR_FONT = fullfont - gui.LIGHT_FONT = fullfont + gui.REGULAR_FONT = font + gui.LIGHT_FONT = font gui.REGULAR_BOLD = True - style._default.font = fullfont - style.default.font = fullfont + style._default.font = font + style.default.font = font - gui.system_font = fullfont + gui.system_font = font gui.project_system_font = font config.language_callbacks[language].append(callback) @@ -66,7 +57,7 @@ init -1 python: def s(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.name_text_font", s(font)) gui7.translate_define(language, "gui.interface_text_font", s(font)) diff --git a/launcher/game/gui7/code.py b/launcher/game/gui7/code.py index 111d70081..c5d3b1f2a 100644 --- a/launcher/game/gui7/code.py +++ b/launcher/game/gui7/code.py @@ -356,7 +356,7 @@ class CodeGenerator(object): def copy_files(self): 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) if os.path.exists(dst): diff --git a/launcher/game/options.rpy b/launcher/game/options.rpy index bc1787712..79d9f8eb1 100644 --- a/launcher/game/options.rpy +++ b/launcher/game/options.rpy @@ -30,6 +30,9 @@ 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 # set to False before the game is released, so the user can't # cheat using developer tools. @@ -349,6 +352,9 @@ init python: source_and_binary("the_question") source_and_binary("tutorial") + # extra fonts. + build.classify_renpy("sdk-fonts/**", "source") + # docs. build.classify_renpy("doc/", "source") build.classify_renpy("doc/.doctrees/", None) diff --git a/launcher/game/fonts/SourceHanSansLite.ttf b/sdk-fonts/SourceHanSansLite.ttf similarity index 100% rename from launcher/game/fonts/SourceHanSansLite.ttf rename to sdk-fonts/SourceHanSansLite.ttf diff --git a/the_question/game/options.rpy b/the_question/game/options.rpy index 1de7b7bd6..8e33bfd0d 100644 --- a/the_question/game/options.rpy +++ b/the_question/game/options.rpy @@ -162,6 +162,11 @@ define config.window_icon = "gui/window_icon.png" 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- ## insensitive, and matched against the path relative to the base directory, ## with and without a leading /. If multiple patterns match, the first is diff --git a/the_question/game/screens.rpy b/the_question/game/screens.rpy index 0e408bf4d..0ed546bd4 100644 --- a/the_question/game/screens.rpy +++ b/the_question/game/screens.rpy @@ -789,25 +789,24 @@ screen preferences(): textbutton _("After Choices") action Preference("after choices", "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 - ## Additional vboxes of type "radio_pref" or "check_pref" can be - ## added here, to add additional creator-defined preferences. - vbox: - style_prefix "radio" - label _("Language") + vbox: + style_prefix "radio" + label _("Language") - textbutton "English" text_font "DejaVuSans.ttf" action Language(None) - textbutton "Français" text_font "DejaVuSans.ttf" action Language("french") - textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian") - textbutton "Bahasa Melayu" text_font "DejaVuSans.ttf" action Language("malay") - textbutton "한국어" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("korean") - textbutton "简体中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("schinese") - textbutton "繁體中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("tchinese") - textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish") - textbutton "日本語" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("japanese") + textbutton "English" text_font "DejaVuSans.ttf" action Language(None) + textbutton "Français" text_font "DejaVuSans.ttf" action Language("french") + textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian") + textbutton "Bahasa Melayu" text_font "DejaVuSans.ttf" action Language("malay") + textbutton "한국어" text_font "SourceHanSansLite.ttf" action Language("korean") + textbutton "简体中文" text_font "SourceHanSansLite.ttf" action Language("schinese") + textbutton "繁體中文" text_font "SourceHanSansLite.ttf" action Language("tchinese") + textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish") + textbutton "日本語" text_font "SourceHanSansLite.ttf" action Language("japanese") #end language_picker diff --git a/the_question/game/tl/japanese/options.rpy b/the_question/game/tl/japanese/options.rpy index c65cddd1a..58a81a697 100644 --- a/the_question/game/tl/japanese/options.rpy +++ b/the_question/game/tl/japanese/options.rpy @@ -1,5 +1,5 @@ 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: @@ -14,4 +14,3 @@ translate japanese strings: # 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" new "Character Art: Deji.\nOriginal Character Art: derik.\n\nBackground Art: Mugenjohncel.\nOriginal Background Art: DaFool\n\nMusic By: Alessio\n\nWritten By: mikey" - diff --git a/the_question/game/tl/korean/options.rpy b/the_question/game/tl/korean/options.rpy index 3c1ac090e..6521cd403 100644 --- a/the_question/game/tl/korean/options.rpy +++ b/the_question/game/tl/korean/options.rpy @@ -1,5 +1,5 @@ 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)" translate korean strings: diff --git a/the_question/game/tl/schinese/options.rpy b/the_question/game/tl/schinese/options.rpy index 78d775080..508e5f7cc 100644 --- a/the_question/game/tl/schinese/options.rpy +++ b/the_question/game/tl/schinese/options.rpy @@ -1,5 +1,5 @@ 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: diff --git a/the_question/game/tl/tchinese/options.rpy b/the_question/game/tl/tchinese/options.rpy index 9858273b3..31cc9041d 100644 --- a/the_question/game/tl/tchinese/options.rpy +++ b/the_question/game/tl/tchinese/options.rpy @@ -1,5 +1,5 @@ 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: diff --git a/tutorial/game/options.rpy b/tutorial/game/options.rpy index 9d511c32a..15d2522c7 100644 --- a/tutorial/game/options.rpy +++ b/tutorial/game/options.rpy @@ -152,6 +152,11 @@ define config.window_icon = "gui/window_icon.png" 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- ## insensitive, and matched against the path relative to the base directory, ## with and without a leading /. If multiple patterns match, the first is diff --git a/tutorial/game/screens.rpy b/tutorial/game/screens.rpy index 68b959b9b..f46c86556 100644 --- a/tutorial/game/screens.rpy +++ b/tutorial/game/screens.rpy @@ -776,9 +776,9 @@ screen preferences(): textbutton "Français" text_font "DejaVuSans.ttf" action Language("french") textbutton "Русский" text_font "DejaVuSans.ttf" action Language("russian") textbutton "Español" text_font "DejaVuSans.ttf" action Language("spanish") - textbutton "한국어" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("korean") - textbutton "日本語" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("japanese") - textbutton "简体中文" text_font "../../launcher/game/fonts/SourceHanSansLite.ttf" action Language("schinese") + textbutton "한국어" text_font "SourceHanSansLite.ttf" action Language("korean") + textbutton "日本語" text_font "SourceHanSansLite.ttf" action Language("japanese") + textbutton "简体中文" text_font "SourceHanSansLite.ttf" action Language("schinese") # This should be last. textbutton "Pig Latin" text_font "DejaVuSans.ttf" action Language("piglatin") diff --git a/tutorial/game/tl/japanese/style.rpy b/tutorial/game/tl/japanese/style.rpy index 0e1e46d7f..b282938a1 100644 --- a/tutorial/game/tl/japanese/style.rpy +++ b/tutorial/game/tl/japanese/style.rpy @@ -1,2 +1,2 @@ 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" diff --git a/tutorial/game/tl/korean/indepth_style.rpy b/tutorial/game/tl/korean/indepth_style.rpy index d60cd7c96..5e5cb5ed0 100644 --- a/tutorial/game/tl/korean/indepth_style.rpy +++ b/tutorial/game/tl/korean/indepth_style.rpy @@ -709,7 +709,7 @@ translate korean strings: # indepth_style.rpy:22 old "Button 2" - new "{font=../../launcher/game/fonts/SourceHanSansLite.ttf}버튼 2{/font}" + new "{font=SourceHanSansLite.ttf}버튼 2{/font}" # indepth_style.rpy:66 old "Style basics." @@ -806,4 +806,3 @@ translate korean strings: # indepth_style.rpy:886 old "Sixth Child" new "여섯 번째 자식" - diff --git a/tutorial/game/tl/korean/options.rpy b/tutorial/game/tl/korean/options.rpy index 6c91d4b82..bfd5153b0 100644 --- a/tutorial/game/tl/korean/options.rpy +++ b/tutorial/game/tl/korean/options.rpy @@ -1,5 +1,5 @@ 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"길라잡이" translate korean strings: diff --git a/tutorial/game/tl/schinese/style.rpy b/tutorial/game/tl/schinese/style.rpy index 3d3d8e0d7..bc2b0b903 100644 --- a/tutorial/game/tl/schinese/style.rpy +++ b/tutorial/game/tl/schinese/style.rpy @@ -1,2 +1,2 @@ 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"