版本 Diff 差异对比
条目:字体修改 · 对比历史版本与当前版本间的真实 Wikitext 差异
+40 行新增-63 行移除
历史基准版本Rev #63045
/* Using a New Font */
9723966242020-02-11 01:49:04
当前最新版本Rev #104061
当前线上生效正文
挖子兰2025-03-09 13:20:40
Wikitext 语法逐行变动
当前版本新增历史版本移除
- {{version|1.25}}{{需要翻译}}
-
- Fonts are applied to textual elements in the interface. All fonts are found and should be placed in the {{path|gfx/fonts/}} folder.
-
- == Creating a New Font ==
+ {{version|1.25}}字体应用于界面中的文本元素。所有字体都放置在 {{path|gfx/fonts/}}文件夹中。
+ == 创建一个新字体 ==
{{SVersion|1.25}}
- 754/5000
- 要创建新字体,您需要下载一个名为[http://www.angelcode.com/products/bmfont/ BMFont]的程序,该程序用于从字体生成字体页和描述符文件。
+ 创建新字体,您需要下载一个名为[http://www.angelcode.com/products/bmfont/ BMFont]的程序,该程序用于从字体生成字体页和描述符文件。
+
安装BMFont之后,将其打开并导入字体。 为此,请单击选项菜单按钮,然后单击字体设置按钮。 在“字体设置”菜单中,添加您的字体文件。
- 这将使用所选字体支持的所有符号填充字体画布。 您的所有符号都应突出显示,以使其包含在字体文件中,因此,您可以通过不突出显示它们来选择不包括某些符号,无论是通过侧边栏还是手动选择它们。 除非您需要将字体设置为特定大小,否则这不是必需的。
+ 这将使用所选字体支持的所有符号填充字体画布。 所有符号都应突出显示,以使其包含在字体文件中,因此,可以通过不突出显示它们来选择不包括某些符号,无论是通过侧边栏还是手动选择它们。 除非需要将字体设置为特定大小,否则这不是必需的。
- === Font Settings ===
+ === 字体设置 ===
{{SVersion|1.25}}
- Having imported your font, it is time to setup how you want the font to look. To do this, open the Font Settings menu again. Below are the fields you need to change:
+ 导入字体之后,就可以设置字体的外观了。为此,再次打开字体设置菜单。下面是你需要更改的字段:
*'''Charset''':设置为OEM-ANSI。
- *'''Size''':这是您的字体的字体大小,将其设置为所需的大小。
+ *'''Size''':这是字体的大小,将其设置为所需的大小。
*'''Match char height''':勾选此项,以便每个字符都具有相同的高度。
- *'''字体平滑处理''':如果您的字体在游戏中看起来过于清晰,请勾选此项。
- *'''轮廓粗细''':如果您希望字体具有轮廓,请在此处设置所需的粗细。
+ *'''Font smoothing''':如果字体在游戏中看起来过于清晰,请勾选此项。
+ *'''Outline thickness''':如果希望字体具有轮廓,请在此处设置所需的粗细。
=== 导出选项 ===
- 设置字体后,现在该设置如何导出字体了。 为此,请打开“导出选项”菜单。 以下是您可能想要更改的字段:
+ 设置字体后,现在该设置如何导出字体了。 为此,请打开“导出选项”菜单。 以下是可能要更改的字段:
- '''填充''':控制字体图像中每个字符之间的填充。 仅当您打算手动编辑字体文件并且不希望字符靠得太近时才需要。
+ '''Padding''':控制字体图像中每个字符之间的填充。 仅当你手动编辑字体文件并且不希望字符靠得太近时才需要。
- '''间距''':控制字体图像中字符之间的最小间距。 将此设置为1-1或更高(如果您遇到字符间出血)。
+ '''Spacing''':控制字体图像中字符之间的最小间距。 将此设置为1-1或更高(如果您遇到字符间出血)。
- '''宽度''':控制字体图像的宽度。 如果所有字符都不适合一张图像,请提高此值。
+ '''Width''':控制字体图像的宽度。 如果所有字符都不适合一张图像,请提高此值。
- '''高度''':控制字体图像的高度。 如果所有字符都不适合一张图像,请提高此值。
+ '''Height''':控制字体图像的高度。 如果所有字符都不适合一张图像,请提高此值。
- '''通道''':控制字符的合成方式。 除非已指定轮廓,否则将它们全部设置为字形,然后将Alpha通道设置为轮廓,其余部分设置为字形。
+ '''Channels''':控制字符的合成方式。 除非已指定轮廓,否则将它们全部设置为glyph,然后将Alpha通道设置为outline,其余部分设置为glyph。
- '''字体描述符''':需要设置为文本。
+ '''Font descriptor''':需要设置为text。
- '''纹理''':应设置为.tga或.dds
+ '''Textures''':应设置为.tga或.dds
- === Saving the Font ===
+ === 保存字体 ===
{{SVersion|1.25}}
- Having setup the font as you would like it, check that the characters all fit on one page by clicking on the Visualize button in the Options menu. If they don't you need to increase the size of the font image width and height.
+ 根据需要设置字体后,单击“选项”菜单中的“可视化”按钮,检查字符是否全部适合一个页面。如果没有,则需要增加字体的大小:图像的宽度和高度。
- Save the font.
+ 最后保存字体。
- == Using a New Font ==
+ == 使用新字体 ==
{{SVersion|1.25}}
- 点击图标下载 AppAndroidiOS
- 检测语言英语中文德语
- 中文(简体)英语日语
+ 保存新字体后,现在应该有两个文件,一个字体图像文件(即my_font.tga)和一个字体描述符(即my_font.fnt)。 打开字体描述符文件,因为需要进行编辑以与欧陆风云4兼容。
- Having saved your new font, you should now possess two files, a font image file (i.e. my_font.tga) and a font descriptor (i.e. my_font.fnt). Open your font descriptor file, as you need to edit it for compatibility with Hearts of Iron IV.
-
- Once opened, you need to change the following lines:
- * '''size''': make the value a positive.
- * '''unicode''': delete the key and value.
- * '''outline''': delete the key and value if your font doesn't use an outline.
- * '''pages=1''': delete the key and value.
- * '''packed=0''': delete the key and value.
- * '''alphaChnl=0''': delete the key and value.
- * '''redChnl=0''': delete the key and value.
- * '''greenChnl=0''': delete the key and value.
- * '''blueChnl=0''': delete the key and value.
- * '''page id=0''': delete the key and value.
- * '''file=\"x.tga\"''': delete the key and value.
- * '''chars count=216''': delete the key and value.
- * '''chnl=15''': delete the key and value for every character.
-
- 934/5000
- 保存新字体后,您现在应该拥有两个文件,一个字体图像文件(即my_font.tga)和一个字体描述符(即my_font.fnt)。 打开字体描述符文件,因为需要进行编辑以与Hearts of Iron IV兼容。
-
- 打开后,您需要更改以下几行:
+ 打开后,需要更改以下几行:
*'''size''':将值设为正数。
*'''unicode''':删除键和值。
*'''outline''':如果您的字体不使用轮廓,则删除键和值。
*'''pages = 1''':删除键和值。
*'''packed = 0''':删除键和值。
*'''alphaChnl = 0''':删除键和值。
*'''redChnl = 0''':删除键和值。
*'''greenChnl = 0''':删除键和值。
*'''blueChnl = 0''':删除键和值。
*'''page id = 0''':删除键和值。
*'''file =“ x.tga”''':删除键和值。
*'''字符数= 216''':删除键和值。
*'''chnl = 15''':删除每个字符的键和值。
- 完成此操作后,保存字体描述符文件。 现在可以在《钢铁雄心IV》中使用它了。
+ 完成此操作后,保存字体描述符文件。 现在可以在《欧陆风云4》中使用它了。
- To make your new font available you need to add a '''.gfx''' definition for it in your mod files. Here is an example:
+ 要使新字体可用,需要在 mod 文件中为其添加 '''.gfx''' 定义。下面是一个示例:
<pre>
bitmapfonts = {
bitmapfont = {
- name = \"monofonto_tooltip\"
- path = \"gfx/fonts/monofonto_tooltip\"
+ name = "monofonto_tooltip"
+ path = "gfx/fonts/monofonto_tooltip"
color = 0xffffffff
}
}
</pre>
- Note you can change the localization color symbols effects by including the textcolors scope within your font:
+ 注意,可以通过在字体中加入文本颜色范围来更改本地化颜色符号效果:
<pre>
bitmapfonts = {
bitmapfont = {
- name = \"monofonto_tooltip\"
- path = \"gfx/fonts/monofonto_tooltip\"
+ name = "monofonto_tooltip"
+ path = "gfx/fonts/monofonto_tooltip"
color = 0xffffffff
textcolors = {
G = { 86 172 91 }
R = { 222 86 70 }
Y = { 238 201 35 }
H = { 238 203 35 }
T = { 255 255 255 }
}
}
}
</pre>
- If you want to change the map font, you need to override the '''tahoma_60''' font definition with your own font.
+ 如果要更改地图字体,则需要使用自己的字体覆盖 '''tahoma_60''' 字体定义。
- == Kerning ==
+ == 字距调整 ==
{{SVersion|1.25}}
- Many fonts will not be exported with kerning information included in the font descriptor file. This can lead to character overlaps ingame which can be unsightly. To fix this, you need to add kerning information to your font descriptor file.
+ 许多字体不会在导出字体描述符文件中包含的字距调整信息时显示。这可能会导致游戏中的文字重叠。要解决此问题,需要将字距调整信息添加到字体描述符文件中。
- To do this, open your font descriptor file and add a new line following this format for each kerning pair:
- <pre>
+ 为此,请打开字体描述符文件,并为每个字偶间距调整对添加以下格式的新行:<pre>
kerning first=<symbol position> second=<symbol position> amount=<pixel width>
</pre>
- A symbol's position within a font can be seen in BMFont by looking in the lower right at the status bar when hovering over a symbol in the font canvas.
+ 将鼠标悬停在字体画布中的元件上时,通过查看状态栏的右下角,可以在 BMFont 中查看元件在字体中的位置。
- The pixel amount is the space between the first and second symbol.
+ 像素量是第一个和第二个元件之间的间距。
- You may have realized that manually creating each kerning pair is not very feasible. It is best to use a programming language (such as Python) to generate the kerning lines for you. Below is an example script you can use in Python 3.x or above:
+ 手动创建每个字偶间距调整对不可行。最好使用编程语言(如 Python)生成字偶间距调整线。以下是可以在 '''Python 3.x''' 或更高版本中使用的示例脚本:<pre>
+ file = open( "kerning.txt", "wt" )
- <pre>
- file = open( \"kerning.txt\", \"wt\" )
-
# Add the symbol positions of the blank symbol slots here.
exclude = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 , 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26,
27, 28, 29, 30, 31, 127, 129, 141, 143, 144, 156, 173, 181]
for x in range( 1, 255 ):
for y in range(1, 255):
if x not in exclude:
if y not in exclude:
- file.write( \"kerning first={0} second={1} amount=1
- \".format( x, y ) )
+ file.write( "kerning first={0} second={1} amount=1\
+ ".format( x, y ) )
file.close()
</pre>
{{Modding navbox}}
[[Category:模组制作]]
[[en:Font_modding]]
