Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,17 @@ runtime/SimpleGraphic/Screenshots

.emmyrc.json
.luarc.json

# 本地化工具编译产物;字体图集由 build.cmd 生成。
tools/FontAtlas.exe
tools/FontAtlas.obj
runtime/FontAtlas.exe
tools/LuaRunner.exe
tools/LuaRunner.obj
src/Locales/Fonts/
localisation-test-results.txt
tools/*.png
tools/*.pid
src/Tests/*.log
src/Tests/Run/
tools/node_modules/
9 changes: 9 additions & 0 deletions LOCALISATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Localisation / 多语言支持

- [English: complete localisation guide](docs/LOCALISATION.en.md)
- [中文:完整本地化指南](docs/LOCALISATION.zh-CN.md)

The guides describe the current design, supported languages, source setup,
resource and font maintenance, verification, and the remaining upstream PR work.

文档按章节说明设计思路、语言现状、源码运行、资源与字体维护、验证方法及合并前的待办事项。
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ You can find the full version history [here](CHANGELOG.md).
## Contribute
You can find instructions on how to contribute code and bug reports [here](CONTRIBUTING.md).

For language support, font setup, and translation maintenance, see the
[localisation guide](LOCALISATION.md) (English / 中文).

## Licence
[MIT](https://opensource.org/licenses/MIT)

Expand Down
Binary file added assets/fonts/NotoSansCJKkr-Regular.otf
Binary file not shown.
Binary file added assets/fonts/NotoSansJP-VF.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSansKR-VF.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSansSC-VF.ttf
Binary file not shown.
30 changes: 30 additions & 0 deletions assets/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Font assets / 字体资产

Setup, atlas generation, and release requirements:
[English](../../docs/LOCALISATION.en.md#6-fonts-atlases-and-release-assets) ·
[中文](../../docs/LOCALISATION.zh-CN.md#6-字体图集与发布资源).

| File | Use | Licence |
| --- | --- | --- |
| `NotoSansSC-VF.ttf` | `zh-CN`, `zh-TW` | [OFL](../../docs/licenses/NotoSansSC-OFL.txt) |
| `NotoSansJP-VF.ttf` | `ja-JP` | [OFL](../../docs/licenses/NotoSansJP-OFL.txt) |
| `NotoSansKR-VF.ttf` | `ko-KR` | [OFL](../../docs/licenses/NotoSansKR-OFL.txt) |
| `NotoSansCJKkr-Regular.otf` | Alternative asset; not selected by the runtime or included in the font release manifest | [OFL](../../docs/licenses/NotoSansCJKkr-OFL.txt) |

The VF sources are the Google Fonts repository paths
`ofl/notosanssc/NotoSansSC[wght].ttf`,
`ofl/notosansjp/NotoSansJP[wght].ttf`, and
`ofl/notosanskr/NotoSansKR[wght].ttf`.
The alternative OTF is the unchanged Regular face from the supplied
`07_NotoSansCJKkr.zip`, family `Noto Sans CJK KR`, version 2.004.
Other weights from that archive are not included.

| File | SHA-256 |
| --- | --- |
| `NotoSansSC-VF.ttf` | `A3041811A78C361B1DE50F953C805E0244951C21C5BD412F7232EF0D899AF0DA` |
| `NotoSansJP-VF.ttf` | `C2F3B4D463500A2DDCD3849CDED1FCEEB9FD6D1C32E6CBECD568453BA50FC68F` |
| `NotoSansKR-VF.ttf` | `194018E6B2B293A7964F037B25C0249CE1418BC9AB3C971060A03AA57861E252` |
| `NotoSansCJKkr-Regular.otf` | `6BCB2A0703AA137E874FC2DFFA85F6C21BA9A67FA329E81B8C801663AF7E992A` |

Source archive SHA-256:
`E26FCF98E75176D24984875377AB921DBB46055B88ED4A39454D91D6146C5654`.
26 changes: 26 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off
setlocal
cd /d "%~dp0"
if not defined VCToolsInstallDir (
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" (
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" >nul
) else (
echo Please run from an x64 Visual Studio developer command prompt.
exit /b 1
)
)
cl /nologo /std:c++17 /EHsc /utf-8 /O2 tools\FontAtlas.cpp /Fe:tools\FontAtlas.exe /Fo:tools\FontAtlas.obj gdi32.lib user32.lib
if errorlevel 1 exit /b 1
copy /Y tools\FontAtlas.exe runtime\FontAtlas.exe >nul
if errorlevel 1 exit /b 1
cl /nologo /std:c++17 /EHsc /utf-8 /O2 tools\LuaRunner.cpp /Fe:tools\LuaRunner.exe /Fo:tools\LuaRunner.obj
if errorlevel 1 exit /b 1
set "NOTO_SANS_SC_FILE=%~dp0assets\fonts\NotoSansSC-VF.ttf"
if defined NOTO_SANS_SC_FONT set "NOTO_SANS_SC_FILE=%NOTO_SANS_SC_FONT%"
if exist "%NOTO_SANS_SC_FILE%" (
tools\FontAtlas.exe src\Locales\Fonts "Noto Sans SC" "%NOTO_SANS_SC_FILE%"
) else (
tools\FontAtlas.exe src\Locales\Fonts "Noto Sans SC"
)
if errorlevel 1 exit /b 1
echo Build completed. Run start.cmd to launch PoB2.
423 changes: 423 additions & 0 deletions docs/LOCALISATION.en.md

Large diffs are not rendered by default.

245 changes: 245 additions & 0 deletions docs/LOCALISATION.zh-CN.md

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/licenses/AlimamaFangYuanTi-LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
阿里妈妈方圆体字体及包含该字体的字库软件,合称“阿里妈妈方圆体”。

阿里妈妈方圆体的知识产权和相关权益归属于淘宝(中国)软件有限公司(以下简称“阿里妈妈”),受《中华人民共和国著作权法》及其他适用法律法规、国际公约、条约的保护。

阿里妈妈授权个人、企业等用户在遵守本声明相关条款的前提下,可以下载、安装和使用上述阿里妈妈字体,该授权是免费的普通许可,用户可基于合法目的用于商业用途或非商业用途,以及嵌入式使用,但不得以任何违反本声明第4条及法律法规、政策、规章或公序良俗的方式使用。

除本法律声明中明确授权之外,阿里妈妈未授予用户关于阿里妈妈方圆体的其他权利。未经阿里妈妈授权,任何人不得:1)对阿里妈妈方圆体进行仿制、转换、翻译、反编译、反向工程、拆分、破解或以其他方式试图从该字库软件获取源代码;2)对阿里妈妈方圆体进行新增、拆分、修改或以其他方式进行二次创作;3)对阿里妈妈方圆体进行有偿方式转让、授权或许可给第三方/商家/用户使用;4)标注错误或不标注版权所有人阿里妈妈,无法标注版权所有人的情况除外;5)发布任何使外界误认其与阿里妈妈或其关联公司存在合作、赞助或背书等商业关联的不实信息。

阿里妈妈授予用户的上述授权不附带任何明示或暗示的保证,不对任何人因从非阿里妈妈官方渠道或指定渠道下载、安装或使用阿里妈妈方圆体而引发的任何直接或间接损失承担责任。

本声明的解释、履行与争议解决适用中华人民共和国的法律。用户与阿里妈妈就阿里妈妈方圆体的使用若发生争议,双方应友好协商,若协商不成,任一方有权向浙江省杭州市有管辖权的人民法院提起诉讼。

来源:阿里妈妈方圆体官方语雀法律声明(2023-05-29)
https://www.yuque.com/alimama_ai-font/vfse9w/fco5g1gifud8lls2
92 changes: 92 additions & 0 deletions docs/licenses/NotoSansCJKkr-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
This Font Software is licensed under the SIL Open Font License,
Version 1.1.

This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
93 changes: 93 additions & 0 deletions docs/licenses/NotoSansJP-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
93 changes: 93 additions & 0 deletions docs/licenses/NotoSansKR-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Loading