Windows 上的 Mac 字体渲染

发布于 2024-07-06 04:42:45 字数 1557 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

狂之美人 2024-07-13 04:42:45

使用 mactype

https://github.com/snowie2000/mactype ‍ ‍ ‍‌‌‌‌‌‌‌‌‌‌‌

use mactype

https://github.com/snowie2000/mactype

​‍​‍​‍​‍​‍​‍​‍​‍​‍​‍​‍​‍​‍‌‌‌‌‌‌‌‌‌

永不分离 2024-07-13 04:42:45

查看GDI++/FreeType链接链接)。 它是 Windows 的高度可配置的字体渲染替代品。 通过一些提示、抗锯齿等配置,您应该能够相当接近地近似 OSX 样式字体渲染。

Check out GDI++/FreeType (link, link). It's a highly configurable font-rendering replacement for Windows. With some configuration of hinting, anti-aliasing, etc, you should be able to approximate OSX style font rendering fairly close.

弥繁 2024-07-13 04:42:45

有人推荐了 sIFR,但我想当我需要使用非标准字体时这很有用?

sIFR 不会给您带来预期的效果。 与 Windows 的 ClearType 一样,Flash 的抗锯齿功能(sIFR 使用的)针对像素网格进行优化,而不是针对字体的准确表示进行优化。

您也许可以使用 Safari 捆绑的 CoreGraphics 库来进行字体渲染,但您可能会违反 Apple 的许可协议(尤其是当您尝试发布应用程序时……)。

Someone recommended sIFR but I guess that's useful when I need to use non-standard fonts?

sIFR will not give you the intended effect. Like Windows's ClearType, Flash's anti-aliasing (which sIFR uses) optimizes towards the pixel grid, not towards accurate representation of the typeface.

You may be able to use Safari's bundled CoreGraphics library to do your font rendering, but you'd likely break Apple's license agreements (especially once you try to ship your app…).

愛上了 2024-07-13 04:42:45

我正在编写一个 Java 应用程序,用字体做一些有趣的事情,并与一些图形设计师合作,他们想要您正在谈论的相同类型的字体渲染。 通过打开分数指标(又称为子像素字形放置精度)和抗锯齿功能,我能够非常接近,这是 Mac 和 Windows 字体渲染之间的主要区别。 对于较大的 TrueType 字体来说看起来相当不错。

这是我使用的 Java 代码。 这一切都是通过他们的原生字体渲染引擎完成的(我相信可能是 FreeType,不确定)。

g.setFont(new Font("Century Schoolbook", Font.PLAIN, 36));
g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                   RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                   RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

现在,如果我能弄清楚如何使 OpenType CFF 字体工作就好了。

I'm writing a Java application doing some interesting things with fonts and working with some graphic designers, and they want the same kind of font rendering you're talking about. I was able to get pretty close by turning on fractional metrics aka sub-pixel glyph placement accuracy, and anti-aliasing, which are the key differences between Mac and Windows font rendering. Looks pretty good for larger TrueType fonts.

Here's the Java code I used. It's all done with their native font rendering engine (which I believe may be FreeType, not sure exactly).

g.setFont(new Font("Century Schoolbook", Font.PLAIN, 36));
g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
                   RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                   RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

Now if only I could figure out how to make OpenType CFF fonts work.

梦开始←不甜 2024-07-13 04:42:45

Microsoft Powertoy Cleartype Tuner 可让您调整 Cleartype 的工作方式。 可能会有一点帮助。 但不确定它是否适用于比 Windows XP 更新的任何设备。

Cleartype Tuner

Microsoft Powertoy Cleartype Tuner lets you tweak the way Cleartype works. It might help a little bit. Not sure it works on anything newer than Windows XP though.

Cleartype Tuner

无人接听 2024-07-13 04:42:45

您可以等到 IE9,它显然具有更好的文本渲染,使用 DirectX: http://blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx

You could wait until IE9, which apparently has much better text rendering, using DirectX: http://blogs.msdn.com/ie/archive/2009/11/18/an-early-look-at-ie9-for-developers.aspx

随波逐流 2024-07-13 04:42:45

如果您想在 Firefox 中渲染 mac osx,则必须使用扩展 Anti-Aliasing Tuner:

https://addons.mozilla.org/firefox/addon/anti-aliasing-tuner/

只需将小字体和大字体的抗锯齿模式设置为“默认”,并将渲染模式设置为“轮廓”即可。

If you want mac osx rendering in firefox, you must use extension Anti-Aliasing Tuner:

https://addons.mozilla.org/firefox/addon/anti-aliasing-tuner/

Just set anti-aliasing mode as Default and rendering mode as Outline for small and large fonts and you're done.

掀纱窥君容 2024-07-13 04:42:45

我假设您希望能够在全球范围内使用 if,或者至少在 IE/Firefox 中使用,而不仅仅是像其他人建议的那样安装 Safari。

早在 Mac OS X 仍处于开发阶段时,就有计划发布适用于 Windows 的 Cocoa 框架,以允许编写的应用程序通过重新编译在 Windows 上本机运行。 我怀疑那套 Cocoa windows 库(黄盒不是吗?)会给你 Mac OS X 风格的字体渲染,但我不认为它曾经发布过(尽管你可能可以获得非常旧的 beta 版本)它来自某个地方,我有一种感觉,其中一些是 WebObjects 或类似的东西的一部分)。

我怀疑 Windows 版本的 Safari 使用的是 Windows 的 Cocoa 库的内部版本,这就是它具有 Mac OS X 字体渲染的原因(尽管我相信最近的 nightly 版本至少可以选择使用 Windows 的本机字体渲染)谁抱怨它看起来不合适)。

无论如何,长话短说,除非你要编写自己的字体渲染器,否则我认为没有任何简单的方法可以做到这一点(除了使用 Safari 之外)

I'm assuming you would like to be ablt to use if globally, or at least in IE/Firefox, not just be installing Safari as other have suggested.

Back in the days wen Mac OS X was still in development, there was a plan to release the Cocoa framework for windows, to allow applications written to it to run natively on Windows with a recompile. I suspect that set of Cocoa windows libraries (Yellow Box wasn't it?) would have given you Mac OS X style font rendering but I don't think it was ever released (though you may be able to get very old beta versions of it from somewhere, and I have a feeling some of it was somehow part of WebObjects or something like that).

I suspect the windows version of Safari is using an internal version of the Cocoa libraries for Windows, whcih is why it has Mac OS X font rendering (though I believe recent nightly builds at least have the option to use Windows' native font rendering for those who were complaining about it looking out of place).

Anyway, long store short, unless you're going to write your own font renderer, I don't think there's any easy way to do it (other than using Safari)

卷耳 2024-07-13 04:42:45

不确定这是否是一个设置,但当然,Windows 上的 Safari 使用 OS X 渲染算法进行渲染。

Not sure if this is a setup, but of course, Safari on Windows renders using the OS X rendering algorithm.

作业与我同在 2024-07-13 04:42:45

Brad 是对的:如果你想要 Mac 字体渲染算法,请使用 Safari。

Jeff 和 Joel 之前都曾在博客中讨论过这一点(毫不奇怪,大约是在 Windows 版 Safari 发布时),如果您想了解更多详细信息:

http://www.codinghorror.com/blog/archives/000885.html

Brad is right: use Safari if you want the Mac font rendering algorithm.

Jeff and Joel have both blogged about this before (not surprisingly, around the time that Safari was released for Windows), if you would like more details:

http://www.codinghorror.com/blog/archives/000885.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文