首页 \ 问答 \ 另一个@ font-face问题(Another @font-face issue)

另一个@ font-face问题(Another @font-face issue)

我正在建立一个网站,并希望使用花哨的,非标准的字体。 因此,我掌握了.ttf,并通过基于Web的转换器运行它以生成(较小的).woff2文件。

他们还提供了一个小页面来测试HTML,CSS和字体。 (我修改了一下,把它变成了一个.aspx文件,并且把它抽出服务器时间,这样我就可以确定它本身就是令人耳目一新的。

结果是,当我在本地预览此文件(我使用Visual Studio 2017)时,一切正常。 然后,我将.aspx,.css和.woff2文件FTP到一个(远程)测试服务器(与开发中的位置完全相同),并且不显示字体。

所以我的问题是,本地和远程站点之间有什么不同,以便本地站点能正确显示页面,但远程站点不会?

浏览器恰好是Firefox Quantum v58,但我不确定这会有什么不同,因为在本地,一切正常。 我可以理解,在安全设置方面,本地和远程之间可能存在差异,但我正在使用防火墙(Zonealarm)关闭进行这些测试。

一些片段:

/* font converted using font-converter.net. thank you! */
@font-face {
    font-family: 'ad';
    src: url('Fonts/ActionDisplay.woff2') format('woff2');
}

<html>
    <head>
        <title>You converted a font!</title>
        
        <link rel="stylesheet" href="stroke.css" type="text/css" media="all" />
        
        <style>
            .thankyou, .notes {
                font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
                font-size: 16px;
            }

            .sample {
                font-family: 'ad', Courier;
                font-size: 24px;
                border: 1px solid #ddd;
                display: inline-block;
                padding: 10px;
            }
        </style>
    </head>
    <body>
        <p class="thankyou">
            Thank you for using <a href="http://www.font-converter.net">font-converter.net</a>!<br />
            We really appreciate you for using our little service. We hope we can help you with our services again soon.
            <br /><br />
            And there it is, your lovely converted web font:
        </p>

        <p class="sample">
            The quick brown fox jumps over the lazy dog
        </p>

        <p class="notes">
            <b>CSS Stylesheet:</b> You'll find the stylesheet in this folder (if selected). The file is called <code>style.css</code><br />
            <b>web fonts:</b> You'll find all converted fonts in a subdirectory called <code>fonts</code> in this folger<br />
            <% Response.Write(DateTime.Now.AddHours(8)) %>
        </p>
    </body>
</html>

和工作页面:

本地


I'm building a web site and want to use a fancy, non-standard font. So I got hold of the .ttf and ran it through a web-based converter to generate a (smaller) .woff2 file.

They also provided a small page to test html, css and font. (I modified it a little bit, turned it into an .aspx and got it to pump out the server time, just so I could be sure it was refreshing itself.

The upshot is that when I preview this file locally (I use Visual Studio 2017) everything works fine. I then FTP the .aspx, the .css and the .woff2 files up to a (remote) test server (in exactly the same locations as in development), and the font does not display.

So my question is, what is different between the local and remote sites, such that the local site will properly display the page, but the remote one won't?

The browser happens to be Firefox Quantum v58, but I'm not sure that makes much difference because, locally, everything works. I can appreciate that there may be a difference between local and remote in terms of security settings, but I am doing these tests with my firewall (Zonealarm) turned off.

Some snippets:

/* font converted using font-converter.net. thank you! */
@font-face {
    font-family: 'ad';
    src: url('Fonts/ActionDisplay.woff2') format('woff2');
}

<html>
    <head>
        <title>You converted a font!</title>
        
        <link rel="stylesheet" href="stroke.css" type="text/css" media="all" />
        
        <style>
            .thankyou, .notes {
                font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
                font-size: 16px;
            }

            .sample {
                font-family: 'ad', Courier;
                font-size: 24px;
                border: 1px solid #ddd;
                display: inline-block;
                padding: 10px;
            }
        </style>
    </head>
    <body>
        <p class="thankyou">
            Thank you for using <a href="http://www.font-converter.net">font-converter.net</a>!<br />
            We really appreciate you for using our little service. We hope we can help you with our services again soon.
            <br /><br />
            And there it is, your lovely converted web font:
        </p>

        <p class="sample">
            The quick brown fox jumps over the lazy dog
        </p>

        <p class="notes">
            <b>CSS Stylesheet:</b> You'll find the stylesheet in this folder (if selected). The file is called <code>style.css</code><br />
            <b>web fonts:</b> You'll find all converted fonts in a subdirectory called <code>fonts</code> in this folger<br />
            <% Response.Write(DateTime.Now.AddHours(8)) %>
        </p>
    </body>
</html>

and the working page:

local


原文:https://stackoverflow.com/questions/48841313
更新时间:2022-09-01 12:09

最满意答案

实际上,您所引用的示例是为Java 7编写的。获取编写这些示例的免费电子书 ,您将阅读:

如果您需要升级以使此示例在您的操作系统上运行,您可能希望避免使用64位版本的Java 7,并选择32位版本。 64位版本的Java 6以及Java 7中缺少SunPKCS11提供程序。在下一章中我们将需要该提供程序。 Oracle何时解决此问题并不存在ETA。

这是3年前写的。 您可能想查看该指控的当前状态。

如您所知, sun不支持sun包中的所有类,例如sun.security.pkcs11.SunPKCS11 。 阅读的答案, 这是一个不好的做法,使用Sun的专有的Java类?


Actually, the examples you refer to were written for Java 7. Get the free ebook for which those examples were written and you'll read:

if you need to upgrade to make this example work on your OS, you may want to avoid the 64-bit version of Java 7, and opt for the 32-bit version. The SunPKCS11 provider is missing in the 64-bit version of Java 6 as well as Java 7. We’ll need that provider in the next chapter. There’s no ETA as to when Oracle will fix this problem.

That was written 3 years ago. You may want to check on the current status of that allegation.

As you know, all classes in sun packages, such as sun.security.pkcs11.SunPKCS11 aren't really supported by Oracle. Read the answers to It is a bad practice to use Sun's proprietary Java classes?

相关问答

更多
  • 要使用SignTool.exe对程序集进行数字签名。 CLR不检查也不验证数字签名。 To digitally sign an assembly use SignTool.exe. CLR doesn't check and doesn't verify digital signatures.
  • 开源的iTextSharp库将允许您这样做。 这是一个解释如何对pdf文件进行数字签名的帖子 。 如果您不想使用第三方库,那么您可以自行实施,但这可能是一项艰巨的任务 - >您可以先阅读pdf规范 (8.6MB) The open source iTextSharp library will allow you to do this. Here's a post explaining how to digitally sign a pdf file. If you don't want to use a t ...
  • 您希望用户将其证书的私钥上传到Web服务器,以便它可以签署PDF吗? 如果是这样,从安全角度来看,这从根本上打破了。 我想你可能已经错过了公共证书!=私钥。 (我们大多数人都很草率,并使用“证书”这个词来指代那些事情中的任何一个(或两个),所以这并不完全令人惊讶)。 从内存开始,CryptoAPI只有一组选择的方法,允许您访问密钥。 其中必须有一个“导出为PFX”的方法,所以你可以让你的设计工作,如果你真的,真的想,但我不建议这样做。 (将私钥发送到网络服务器的风险,破坏的不可否认性等等)。 如果你真的必须 ...
  • 实际上,您所引用的示例是为Java 7编写的。获取编写这些示例的免费电子书 ,您将阅读: 如果您需要升级以使此示例在您的操作系统上运行,您可能希望避免使用64位版本的Java 7,并选择32位版本。 64位版本的Java 6以及Java 7中缺少SunPKCS11提供程序。在下一章中我们将需要该提供程序。 Oracle何时解决此问题并不存在ETA。 这是3年前写的。 您可能想查看该指控的当前状态。 如您所知, sun不支持sun包中的所有类,例如sun.security.pkcs11.SunPKCS11 。 ...
  • 你在问题中提到的文件很好。 您必须创建数字签名文件。 此链接有一个使用PKCS文件并签署PDF文档的工具。 它声称使用iText,所以你应该能够理解这些步骤。 源代码在这里 The document you mentioned in the question is good. You have to create digital signature files. This link has a tool that uses PKCS files and sign PDF documents. It clai ...
  • PrivateKey是一个接口,实现取决于加密提供程序。 在您的情况下,对于USB令牌,提供程序(可能是Sun pkcs#11)在执行加密操作时将pkcs11命令封装到令牌。 私钥实际上并不包含在您的Java服务中,并且命令在令牌上执行 私钥是不可提取的,因此encoded值必须为null。 例如,如果您使用Pkcs12密钥库(本地.p12文件),您将看到encoded属性包含以DER格式编码的私钥 PrivateKey is an interface, the implementation depends ...
  • 问题解决了。 不是将证书存储在KSP中,而是将其放在CSP中。 然后我们可以使用SignDetached方法。 Problem solved. Instead of storing the certificate in the KSP it is placed in the CSP. Then we can use the SignDetached method.
  • 由于安全限制,无法使用javascript在系统/浏览器密钥库上安装证书 另一种解决方案是在客户端上安装具有嵌入式Web服务器的应用程序,并从该页面发送文档以进行签名。 此应用程序可以使用密钥库并包含itext库。 如果用户具有证书文件( .p12 / .pfx ),则可以使用WebCryptographyApi加载内容并在客户端签名文档(无需将证书上载到服务器。请参阅如何使用Javascript WebCrypto加载PKCS#12数字证书API It is not possible to use a c ...
  • 从技术角度来看,您可以将任何X.509证书与私钥一起使用,并正确设置密钥用法扩展以对文档进行签名。 但是,验证方(通常是Adobe Reader)只会信任某些证书。 Adobe要求Adobe Reader接受的证书是按照其要求发布的,其中之一是通过将私钥放到硬件上来保护私钥。 通过告知Reader使用Windows证书存储验证证书,将自定义根添加为可信根等,可以调整Adobe Reader以接受其他证书,但这需要在客户端(阅读器)端执行额外操作。 此外,您还没有找到证书颁发机构,它将向您出售适合数据签名的证 ...
  • 这里的软件包似乎提供了使用Ruby签名PDF的扩展。 它不是免费的,但看起来它提供了原生的ruby界面。 以下是如何在ruby中使用(在安装之后): require 'mypdfsigner' include MyPDFSigner inputPath = "/tmp/input.pdf" outputPath = "/tmp/output.pdf" location = "Chicago" reason = "Demo" contactInfo = "+1 555-555-5555" certify = ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)