From 836f699592a95f7be606cf483ae69cedf6c3e5e0 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 12 Nov 2003 22:38:46 +0000 Subject: [PATCH] ^Font and ^FontSize git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3134 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/lang.cpp | 26 +++++++++++++++++++++++++- Source/lang.h | 3 +++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Source/lang.cpp b/Source/lang.cpp index e810063c..9c11488f 100644 --- a/Source/lang.cpp +++ b/Source/lang.cpp @@ -113,6 +113,8 @@ struct { {"^Kilo", "K", BOTH_STATIC}, {"^Mega", "M", BOTH_STATIC}, {"^Giga", "G", BOTH_STATIC}, + {"^Font", "MS Shell Dlg", NONE_STATIC}, + {"^FontSize", "8", NONE_STATIC}, {"^RTL", "0", NONE_STATIC} }; @@ -613,6 +615,28 @@ void CEXEBuild::FillLanguageTable(LanguageTable *table) { table->lang_strings->set(sn, temp); continue; } + else if (i == NLF_FONT) + { + int font_size = *build_font ? build_font_size : table->nlf.m_iFontSize; + if (font_size) + { + char temp[64]; + sprintf(temp, "%d", font_size); + table->lang_strings->set(sn, temp); + } + else + table->lang_strings->set(sn, dstr); + continue; + } + else if (i == NLF_FONTSIZE) + { + char *font = *build_font ? build_font : table->nlf.m_szFont; + if (font) + table->lang_strings->set(sn, font); + else + table->lang_strings->set(sn, dstr); + continue; + } table->lang_strings->set(sn, dstr); } } @@ -751,7 +775,7 @@ LanguageTable * CEXEBuild::LoadLangFile(char *filename) { } // Read strings - for (int i = 0; i < NLF_STRINGS - 1; i++) { + for (int i = 0; i < NLF_STRINGS - 3 /* ^Font, ^FontSize and ^RTL */; i++) { // skip virtual strings if (!NLFStrings[i].szDefault) diff --git a/Source/lang.h b/Source/lang.h index 354d25a8..867d65a7 100644 --- a/Source/lang.h +++ b/Source/lang.h @@ -275,6 +275,9 @@ enum { NLF_KILO, NLF_MEGA, NLF_GIGA, + + NLF_FONT, + NLF_FONTSIZE, NLF_RTL, NLF_STRINGS