Giter Club home page Giter Club logo

Comments (9)

TakWolf avatar TakWolf commented on May 31, 2024 1

我发布了一个快照版本:

https://github.com/TakWolf/fusion-pixel-font/releases/tag/snapshot

另外,Demo 页面已经重新部署(使用 otf 压缩 woff2):

https://fusion-pixel-font.takwolf.com/

可以看看是不是修复了这个问题

from fusion-pixel-font.

TakWolf avatar TakWolf commented on May 31, 2024 1

正式版已发布

https://github.com/TakWolf/fusion-pixel-font/releases/tag/2023.07.19

from fusion-pixel-font.

TakWolf avatar TakWolf commented on May 31, 2024

经过测试,OTF 显示不正常,TTF 正常

目前不知道具体的原因

Windows 8.1 photoshop CS6 显示异常

image
image

macOS Krita 正常

image

from fusion-pixel-font.

TransparentLC avatar TransparentLC commented on May 31, 2024

在 Windows 11 的 Edge 浏览器里也发现了相同的问题(但是 Firefox 就很正常),不过我尝试过使用 pyftsubset 对 release 里的 ttf 和 woff2 字体子集化然后保存成 ttf 和 woff2,otf 就没测试过了。

  • fusion-pixel-12px-proportional.ttf 不会重叠
  • fusion-pixel-12px-proportional.woff2 会重叠
  • pyftsubset fusion-pixel-12px-proportional.ttf --text-file=charset.txt --output-file=fusion-pixel-12px-proportional-subset.ttf 不会重叠
  • pyftsubset fusion-pixel-12px-proportional.ttf --text-file=charset.txt --output-file=fusion-pixel-12px-proportional-subset.woff2 --flavor=woff2 不会重叠
  • pyftsubset fusion-pixel-12px-proportional.woff2 --text-file=charset.txt --output-file=fusion-pixel-12px-proportional-subset.ttf 会重叠
  • pyftsubset fusion-pixel-12px-proportional.woff2 --text-file=charset.txt --output-file=fusion-pixel-12px-proportional-subset.woff2 --flavor=woff2 会重叠

从 ttf 子集化生成的 woff2 不会重叠,这个 woff2 和 release 里的 woff2 会有什么区别吗?

from fusion-pixel-font.

TakWolf avatar TakWolf commented on May 31, 2024

从 ttf 子集化生成的 woff2 不会重叠,这个 woff2 和 release 里的 woff2 会有什么区别吗?

目前 Releases 里面的 woff2 是基于 otf 的压缩版本,本质上等同于 otf

所以实际上是 otf 有问题,ttf 无问题。

但是我现在也不知道为什么会有这个问题,很奇怪。

我不确定到底是不是和 Windows 平台有关系。按道理布局需要的必要参数都有。但是 OpenType 确实有平台相关的参数(参考:https://glyphsapp.com/zh/learn/vertical-metrics)。

from fusion-pixel-font.

TakWolf avatar TakWolf commented on May 31, 2024

我目前手头没有 Windows 机器来测试。你们有谁可以帮忙测试一下 2023.04.26 以前的版本 otf 是否存在问题?

目前确实有一个点可能存在问题。

2023.04.26 之前版本构建代码中:T2CharStringPenotf 的矢量字形对象,第一个参数传的字宽

pen = T2CharStringPen(width, None)

之后的版本调整了构建系统,这里改成 0 了:

https://github.com/TakWolf/pixel-font-builder/blob/aa23b981a68272874d40cbb7cc8cc16c44fcbe0c/src/pixel_font_builder/opentype.py#L175

因为当时确实没有搞清楚这个参数的具体含义,改了之后发现没影响。但是我没有测过 Windows 平台。

有可能是这里有问题。

from fusion-pixel-font.

TransparentLC avatar TransparentLC commented on May 31, 2024

用 2023.04.26 测试了上面六种情况,没有重叠问题了。

from fusion-pixel-font.

TakWolf avatar TakWolf commented on May 31, 2024

用 2023.04.26 测试了上面六种情况,没有重叠问题了。

间距正常吗?

等宽模式半角占用 6px,全角12px。可视字空隙 1px。正确的渲染应该是这样的:

image

如果正常那就是这个问题了。

补一个源代码,他没有解释过这个 width 到底是什么?有可能 T2CharString 布局时这个 widthadvance_width 都有作用

class T2CharStringPen(BasePen):
    """Pen to draw Type 2 CharStrings.

    The 'roundTolerance' argument controls the rounding of point coordinates.
    It is defined as the maximum absolute difference between the original
    float and the rounded integer value.
    The default tolerance of 0.5 means that all floats are rounded to integer;
    a value of 0 disables rounding; values in between will only round floats
    which are close to their integral part within the tolerated range.
    """

    def __init__(self, width, glyphSet, roundTolerance=0.5, CFF2=False):
        super(T2CharStringPen, self).__init__(glyphSet)
        self.round = roundFunc(roundTolerance)
        self._CFF2 = CFF2
        self._width = width
        self._commands = []
        self._p0 = (0, 0)

from fusion-pixel-font.

TransparentLC avatar TransparentLC commented on May 31, 2024

是这个样子,每个字之间大概一个像素点的空隙。

我对字体格式相关的这些底层原理不太熟……

from fusion-pixel-font.

Related Issues (20)

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.