简体   繁体   English

'font-family:Symbol'和Windows-1252

[英]'font-family: Symbol' and Windows-1252

I have a bunch of HTML documents that contain some simple text in Windows-1252 encoding, but throughout the text there are numerous appearances of span elements with font-family: Symbol . 我有一堆HTML文档,其中包含Windows-1252编码中的一些简单文本,但在整个文本中,有许多span元素的外观font-family: Symbol

For example: 例如:

<span style='font-family:Symbol'>Ñ</span>

Which appears as the greek delta - Δ in the browser. 在浏览器中显示为希腊三角洲 - Δ。

Google told me that using the Symbol font might show different results on different systems, as it's not actually a well defined font. Google告诉我,使用Symbol字体可能会在不同的系统上显示不同的结果,因为它实际上并不是一个定义良好的字体。
Is this really true? 这是真的吗? Is it "unsafe" to use the Symbol font? 使用Symbol字体是“不安全的”吗?

If so, is there any way to reliably convert (on my own system) such symbols in the Symbol font to their Windows-1252 counterparts? 如果是这样,有没有办法可以将Symbol字体中的Symbol (在我自己的系统上)可靠地转换为它们的Windows-1252对应物?

It's been always unsafe to rely on having certain font installed on all the computers/smartphones/gadgets that visit your site. 依赖于访问您网站的所有计算机/智能手机/小工具上安装某些字体始终是不安全的。 There're some font embedding techniques that work reasonably well in some modern browsers but you'd need to repack the Symbol font and I doubt the copyright owner allows you to do it. 有些字体嵌入技术在某些现代浏览器中运行得相当好,但您需要重新打包Symbol字体,我怀疑版权所有者是否允许您这样做。

Of course, most characters in the Symbol font are not in the Windows-1252 encoding but that should not be an issue. 当然,Symbol字体中的大多数字符都不是Windows-1252编码,但这应该不是问题。 You can use the following map to obtain the appropriate HTML entities. 您可以使用以下映射来获取适当的HTML实体。 However, you'll have to write a script or program using a programming language (HTML is just a markup language). 但是,您必须使用编程语言编写脚本或程序(HTML只是一种标记语言)。

The problem is that the greek letter you see is just the appearance, the actual letter is something completely different. 问题是,你看到的希腊字母只是外观,实际的字母是完全不同的东西。

I can think of two ways to convert it: 我可以想到两种方法来转换它:
1. Write a script (in your language of choice) that converts each letter to it's Greek counterpart. 1.编写一个脚本(用您选择的语言),将每个字母转换为希腊语。 (Ñ => Δ) (Ñ=>Δ)
2. Take a screenshot of the document/page and use an OCR-program to convert it to Greek text. 2.截取文档/页面的屏幕截图,并使用OCR程序将其转换为希腊文本。

When using font-family , if neither of the listed font faces are found on the client, that is without the webfont embeds, may result in changing to default font of client hence a different font replacement for what you'd show to your users. 使用font-family ,如果在客户端上找不到所列出的字体,也就是没有webfont嵌入,可能会导致更改为客户端的默认字体,因此会为您向用户显示的字体替换不同的字体。

You may want to use UTF-8 encoding and put the delta (Δ) sign in your HTML content, or use webfont embeds to provide an option, "use the font I want from this". 您可能希望使用UTF-8编码并在您的HTML内容中添加delta(Δ)符号,或使用webfont embeds提供选项,“使用我想要的字体”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM