GithubHelp home page GithubHelp logo

takwolf / ark-pixel-font Goto Github PK

View Code? Open in Web Editor NEW
3.2K 24.0 61.0 7.06 MB

Open source Pan-CJK pixel font / 开源的泛中日韩像素字体

Home Page: http://ark-pixel-font.takwolf.com/

License: MIT License

Python 55.16% HTML 44.84%
fonts pixel cjk chinese chinese-simplified chinese-translation japanese korean font game

ark-pixel-font's Introduction

banner

方舟像素字体 / Ark Pixel Font

License OFL License MIT Releases Itch.io Discord QQ Group

开源的泛中日韩像素字体,黑体无衬线风格,支持 10、12 和 16 像素。

这个项目不仅提供了全部的字形源文件,也提供了构建字体所需要的完整程序。

Warning

该字体目前处于积极开发阶段,仍然缺少大量汉字。

生产环境请考虑临时性过渡方案:缝合像素字体

Important

这是一个开源项目,字体可以免费商用。

如果这个项目对您有帮助,请考虑 赞助 来支持开发工作。

预览

可以通过 Playground 实时预览字体效果。

10 像素

示例文本 · 等宽模式-字母表 · 比例模式-字母表

preview-10px

12 像素

示例文本 · 等宽模式-字母表 · 比例模式-字母表

preview-12px

16 像素

示例文本 · 等宽模式-字母表 · 比例模式-字母表

preview-16px

字符统计

可以通过下面的链接来查看字体各尺寸目前支持的字符情况。

尺寸 等宽模式 比例模式
10px font-info-10px-monospaced font-info-10px-proportional
12px font-info-12px-monospaced font-info-12px-proportional
16px font-info-16px-monospaced font-info-16px-proportional

尺寸

目前支持 10、12 和 16 三个像素尺寸。

字体的 UPMUnits Per Em,每个字面框包含的设计单位的数量)按照像素尺寸的 100 倍来转化,即:1 px = 100 units

字体各尺寸的 UPM 值如下:

尺寸 UPM
10px 1000
12px 1200
16px 1600

在渲染时,请将文本尺寸设置为对应字体的像素尺寸或其整数倍,以保证栅格化时能够精确地进行像素转化。

宽度模式

目前支持「等宽」和「比例」两种模式。

「等宽」模式

字符为全宽或半宽,排版时可严格对其。字形完全处于字面框内部,默认行高等于字体的像素尺寸。

但基线位置略微偏高,中西文混排时西文在视觉上重心偏高,美观性略差。

「比例」模式

字符宽度根据字形实际情况变化,基线处于合适的位置。纵向上字形可能会超出字面框,默认行高大于字体的像素尺寸。

该模式排版观感自然,如无特殊需求,你应该优先选择这个模式。

字体各尺寸的默认行高如下:

尺寸 行高
10px 16px
12px 18px
16px 24px

语言特定字形

不同国家或地区,由于规范或书写习惯不同,同一个字符,字形可能存在差别。这种情况大部分为汉字,少量为标点符号。

目前支持以下语言特定字形版本:

版本 含义 说明
latin 拉丁语 在非中日韩环境下使用,标点符号采用西文习惯写法。
zh_cn 中文-**大陆 字形采用**大陆地区标准规范 《通用规范汉字表》 中的写法。
zh_hk 中文-香港特别行政区 字形采用香港地区教育规范 《常用字字形表》 中的写法。
zh_tw 中文-**地区 字形采用**地区教育规范 《国字标准字体》 中的写法。
zh_tr 中文-传统印刷 字形采用 「传统印刷体」 写法,符合香港和**地区传统使用习惯。
ja 日语 字形采用日本参考规范 《常用汉字表》 中的写法。
ko 朝鲜语

下载

可通过以下渠道下载最新的版本:

目前提供 .otf.ttf.woff2.bdf.pcf 五种单字体格式,以及 .otc.ttc 两种集合字体格式。

使用包管理器安装

brew install font-ark-pixel-10px-monospaced
brew install font-ark-pixel-12px-monospaced
brew install font-ark-pixel-16px-monospaced

brew install font-ark-pixel-10px-proportional
brew install font-ark-pixel-12px-proportional
brew install font-ark-pixel-16px-proportional

本地构建

这是一个标准的 Python3 项目。

当您配置好运行环境后,执行 python -m tools.build 命令来开始构建。

等待任务完成后,可在 build/outputs 目录下找到生成的字体文件。

授权许可

分为「字体」和「构建程序」两个部分。

字体

使用 「SIL 开放字体许可证第 1.1 版」 授权,保留字体名称「方舟像素 / Ark Pixel」。

构建程序

使用 「MIT 许可证」 授权。

官方社区

程序依赖

字形依赖

外部工具

参考资料

赞助

如果这个项目对您有帮助,请考虑赞助来支持开发工作。

赞赏码 爱发电

请通过下面的链接来查看收到的赞助的具体情况:

赞助详情

ark-pixel-font's People

Contributors

takwolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ark-pixel-font's Issues

Pillow 字体绘制存在问题

问题跟踪:

python-pillow/Pillow#1646

python-pillow/Pillow#6469

这和字体构建本身无关,但是可能会影响相关图片物料的生成,有可能导致 build.py 执行失败

暂时使用如下 hack

ascent, descent = font.getmetrics()
line_gap = 0  # need to be set manually
line_height = ascent + descent + line_gap  # the correct way
spacing = line_height - font.getsize('A')[1]

需要等待上游彻底修复该问题

更改版本号格式,以及发布机制

目前版本号格式为:

x.y.z-dev-YYYYMMDD

这预期是一个长期小幅迭代更新的项目,所有尺寸为同时更新发布。因此可能永远无法到达真正意义上的 1.0.0 版本。

因此,计划将字体版本号更改为日期格式,例如:

2022.06.20

homebrew-fonts 构建需要按照比例和等宽模式拆分

@singularitti 从版本 2022.10.27 开始,拆分了等宽和比例模式,homebrew-fonts 构建需要重新规划。预计修改成这样:

  • 等宽模式
brew install font-ark-pixel-10px-monospaced
brew install font-ark-pixel-12px-monospaced
brew install font-ark-pixel-16px-monospaced
  • 比例模式
brew install font-ark-pixel-10px-proportional
brew install font-ark-pixel-12px-proportional
brew install font-ark-pixel-16px-proportional

另外,构件的名字重新做的规划。

这样修改会有问题吗?

字体对齐偏下了一点点

Screenshot 2023-11-07 16 39 50 苹方

--

Screenshot 2023-11-07 16 40 10 ark pixel / fusion-pixel 12px(截图是后者,但前者有相同问题)

--

Screenshot 2023-11-07 16 40 23 vonwaon bitmap 12px(另一像素,但它是偏上了一点点)

====

这个事情是严重的,望测试。截图是我使用在web中(woff2),在2x缩放的macos中的显示(chrome与safari相同结果)。界面元素经常有边距不小的框体,一方面是这导致框体的上下边距始终细微的偏移,另一方面是,当该字体与比如字体图标组合时,产生的一个正常,一个偏移。

Screenshot 2023-11-07 16 46 50 与苹方

--

Screenshot 2023-11-07 16 46 14 与ark pixel / fusion-pixel 12px(截图是后者,但前者有相同问题)

此处的字体图标也是苹果家的SF Pro,不过这点并不是因为苹果家两套自己对齐自己,其它字体图标也是要一直垂直位置居中的。

← ← 这是致命的,但一纠正好就完美了。正常其它哪怕系统自带的字体也不少有对齐不一致难以调整的情况,但大致而言还是存在一个:到底是否居中了没有的值的。(我在macos中测试苹果(PingFang SC)、微软(Microsoft YaHei / Microsoft YaHei UI)、谷歌(Noto Sans CJK SC)的自带默认字体都是没有偏移问题的)。

请务必修正!

====

补充一点,这个必须要同时使用多个字体时才显现问题。在一些程序中可能只能指定单个字体,它不会有这个问题,只要单独对它进行整个调整即可。但比如web中存在这个问题是这样发生的:先被指定的字体会成为垂直居中的依据,比如以ark pixel为首选字体时,所有其它字体的文字或字体图标如果并列一起的话,会跟随ark pixel的垂直位置,这就导致:当ark pixel偏下时 且ark pixel为首选时,其它字体就会呈现为往上飘,此时ark pixel是居中的,但其它字体不居中了,往上走了。而如果以其它字体为首选,接着是ark pixel,则ark pixel会呈现偏下。

就是这个问题,我认为的方案是与大部分操作系统的文字的线对齐,比如macos的。

中文(传统印刷)能否处理 Unicode 的原规格分离原则?

参见 https://zh.wikipedia.org/wiki/%E6%9C%AA%E7%B5%B1%E4%B8%80%E6%BC%A2%E5%AD%97%E5%88%97%E8%A1%A8

比如 "値 (U+5024)" 和 "值 (U+503C)",因为中文用户使用的是常用的代码点U+503C,但真正旧字形就在U+5024(日文常用的代码点)。所以为了统一旧字形,建议将U+5024映射到U+503C。

还有 "為" 与 "", "" 与 "真", "俞" 与 "", "" 与 "尚", "" 与 "青", "" 与 "飲" 等。请挑选具有旧字形的Unicode编码点,并将其重新映射到通用的中文编码点。

你不需要做所有的重映射。

与Minecraft & Zpix字体对比

Minecraft负责显示英文,Zpix负责显示中文

  • Ark Pixel Font的显示效果

    image

  • Minecraft&Zpix的显示效果

    image

中文显示上效果差不多,但英文显示上我感觉还是Minecraft的字体要好看些

python -m pip install -r requirements.txt

$ python -m pip install -r requirements.txt
Collecting beautifulsoup4==4.11.1
Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
......................
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting MarkupSafe==2.1.1
Using cached MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
ERROR: Could not find a version that satisfies the requirement minify_html==0.8.0 (from -r requirements.txt (line 8)) (from versions: 0.2.6, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.3.9, 0.3.10, 0.3.11, 0.3.12, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.5, 0.4.6, 0.4.7, 0.4.8, 0.4.9, 0.4.10, 0.4.11, 0.5.0, 0.5.2, 0.5.3, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.6.7, 0.6.8, 0.6.9, 0.6.10)
ERROR: No matching distribution found for minify_html==0.8.0 (from -r requirements.txt (line 8))

Nixpkgs need fix

谚文什么时候会有

RT,我感觉您《缝合怪》里的Galmuri的谚文可以改改然后再用这个数据生成。
不过要想实现全部的谚文覆盖的话,就无法考虑BDF等其他字体的条件了,因为要加OpenType表,目前BCF以及PCF都不能使用。

「丁卯点阵体」虽然看上去是像素的,但并不是老旧的像素字体格式,所有的「像素」都是由轮廓围合出来的。
作为一款当代的字体,「丁卯点阵体」配备了丰富的高级排版武器——这是坊间称做「OpenType 特性」的字体功能。在专业的平面设计和排版软件(比如 Adobe InDesign 和 Illustrator)以及网页开发中,它能够让文字以更加灵活的方式呈现。来源

以上。

构建字体的速度*非常慢*

之前在nixpkgs测试搭建方舟字体的时候,发现搭建全套字体居然花了15分钟多…… 慢得有一点不可理喻了。

...
python3.12-ark-pixel-font> INFO:font_service:Make font file: '/build/source/build/outputs/ark-pixel-16px-proportional-ko.pcf'
python3.12-ark-pixel-font> INFO:font_service:Make font collection file: '/build/source/build/outputs/ark-pixel-16px-proportional.otc'
python3.12-ark-pixel-font> INFO:font_service:Make font collection file: '/build/source/build/outputs/ark-pixel-16px-proportional.ttc'
python3.12-ark-pixel-font> buildPhase completed in 15 minutes 24 seconds

而且整个过程中CPU利用率没有超过10%(貌似是在单线程运转),完全没有达到用户硬件能够达到的速度。
目前肉眼能观察到,12px的字体比10px和16px搭建起来要慢很多,有没有可能搭建速度和字体中有的字符数量成正比?

想问一下后续的收字情况

我非常欣赏您的少数从零开始创作的《方舟像素字体》。我想问一下,在做完基本集(GB/T 2312)之后,会怎么样呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.