如何解码 base64 编码的字体信息?

2023-09-30前端开发问题
45

本文介绍了如何解码 base64 编码的字体信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我遇到了一个使用编码字体信息的网站.我尝试通过 Base64 Endoder/Decoder Web 服务将此编码字体转换为二进制文件,但我找不到结果文件的格式.

I encountered a website which used encoded font information. I tried to convert this encoded font to a binary file through the Base64 Endoder/Decoder Web service, but I couldn't find out what is the format of the resulting file.

这里是编码后的 CSS 内容(内容太大,无法复制/粘贴在这里).

Here is the encoded CSS content (the content is too big to be copied/paste here).

谢谢!

请不要猜测我想做什么.

我想问一些关于 base64 代码是如何被伪造的问题,以及我缺少什么能够扭转这个过程,这意味着我不了解其中的所有内容.这些技术通常用于具有自定义字体的网页中,并且与直接在 CSS 文件中引用的原始字体文件相比似乎有一些改进.我完全清楚所涉及的字体是商业字体,不能随意使用.

I am asking questions about how the base64 code has been forged and what I am missing to be able to reverse the process, which means I do not understand everything in it. These technique is often used in webpages with custom fonts, and seems to have some improvements compared to the raw font file directly given reference in the CSS file. I am fully aware that the involved fonts are commercial ones and can't be used freely.

那场辩论跑题了,停止拖钓.

That debate is off-topic, stop trolling.

推荐答案

1) 定位完整的字体声明,例如data:font/opentype;base64,AaBbCcDdEeFf0123456789==

1) locate the complete font declaration, for example, data:font/opentype;base64,AaBbCcDdEeFf0123456789==

2) 复制编码数据部分;排除前导类型声明和逗号.

2) copy the encoded data portion; exclude the leading type declaration and comma.

删除这个 data:font/opentype;base64,

你想要这个:AaBbCcDdEeFf0123456789==

3) 解码数据并保存为二进制编码文件.不要解码数据并将结果手动粘贴到文本编辑器中.使用 http://www.motobit.com/util/base64-decoder-encoder.asp 选择从 Base64 字符串解码数据"和导出到二进制文件"选项.

3) decode the data and save as a binary encoded file. Do not decode the data and manually paste the result into a text editor. Use http://www.motobit.com/util/base64-decoder-encoder.asp Select the "decode the data from a Base64 string" and "export to a binary file" options.

4) 使用纯文本编辑器查看文件.文件的前 3 或 4 个字母可能是woff"、otf"或ttf".这是您的实际文件类型.

4) View the file using a plain text editor. The first 3 or 4 letters of the file are probably "woff", "otf", or "ttf". This is your actual file type.

这篇关于如何解码 base64 编码的字体信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

layui 单选框、复选框、下拉菜单不显示问题如何解决?
1. 如果是ajax嵌套了 页面, 请确保 只有最外层的页面引入了layui.css 和 layui.js ,内层页面 切记不要再次引入 2. 具体代码如下 layui.use(['form', 'upload'], function(){ var form = layui.form; form.render(); // 加入这一句});...
2024-11-09 前端开发问题
313

layui要如何改变时间日历布局大小?
问题描述 我想改变layui时间日历布局大小,这个要怎么操作呢? 解决办法 可以用css样式对时间日历进行重新布局,具体代码如下: !DOCTYPE htmlhtmlheadmeta charset="UTF-8"title/titlelink rel="stylesheet" href="../../layui/css/layui.css" /style#test-...
2024-10-24 前端开发问题
271

CoffeeScript 总是以匿名函数返回
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)...
2024-04-20 前端开发问题
13

getFullYear 在一年的第一天返回前一年
getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)...
2024-04-20 前端开发问题
6

如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?
How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社...
2024-04-20 前端开发问题
6

如何在开发网站时使用coffeescript?
How to use coffeescript in developing web-sites?(如何在开发网站时使用coffeescript?)...
2024-04-20 前端开发问题
10