gpt4 book ai didi

ios - PDF 中的 Times-Roman 字体缺少宽度

转载 作者:行者123 更新时间:2023-11-29 10:26:21 26 4
gpt4 key购买 nike

我有一个 pdf其中包含一些字符,如第 8 页上的破折号和双引号,宽度为 0。它有 Times-Roman 字体。
我曾尝试使用 AFM 文件为 Times-Roman 字体找到宽度,但没有成功。
如何找到这些字符的宽度?

谢谢。

最佳答案

Times Roman 是Standard 14 Fonts 之一。这些字体通常是有关所需数据的 PDF 规范中的异常(exception),例如

Widths array (Required except for the standard 14 fonts;...

(Table 111 – Entries in a Type 1 font dictionary - ISO 32000-1)

关于这些字体的部分解释了从哪里获取信息:

The PostScript names of 14 Type 1 fonts, known as the standard 14 fonts, are as follows: Times-Roman, Helvetica, Courier, Symbol, Times-Bold, Helvetica-Bold, Courier-Bold, ZapfDingbats, Times-Italic, HelveticaOblique, Courier-Oblique, Times-BoldItalic, Helvetica-BoldOblique, Courier-BoldOblique

These fonts, or their font metrics and suitable substitution fonts, shall be available to the conforming reader.

NOTE The character sets and encodings for these fonts are listed in Annex D. The font metrics files for the standard 14 fonts are available from the ASN Web site (see the Bibliography). For more information on font metrics, see Adobe Technical Note #5004, Adobe Font Metrics File Format Specification.

(section 9.6.2.2 - Standard Type 1 Fonts (Standard 14 Fonts) - ISO 32000-1)

点击 Adob​​e 网站后,字体指标目前可在 ftp://ftp.adobe.com/pub/adobe/type/ 获得。


OP 在评论中澄清了他的问题:

I have tried Adobe's Font metric file to get width value char \x93,\x94,\x96,\x97,\x98. However these values are not present in AFM file. How can I find widths of these values?

首先,您必须查找这些值的含义。

您提到问题出现在第 8 页 并且字体为 Times-Roman。第 8 页上有 Times-Roman 字体 F28F46,还有 Fimes-Bold 字体F43。其他字体是 CourierCMSY10(TeX Computer Modern Symbol?)。 F28F43F46 具有相同的编码 条目:

163 0 obj
<</Differences
[0/.notdef 1/dotaccent/fi/fl/fraction/hungarumlaut/Lslash/lslash/ogonek/ring 10/.notdef 11/breve/minus 13/.notdef 14/Zcaron/zcaron/caron/dotlessi/dotlessj/ff/ffi/ffl 22/.notdef 30/grave/quotesingle/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde 127/.notdef 130/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE 141/.notdef 147/quotedblleft/quotedblright/bullet/endash/emdash/tilde/trademark/scaron/guilsinglright/oe 157/.notdef 159/Ydieresis 160/.notdef 161/exclamdown/cent/sterling/currency/yen/brokenbar/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]
/Type/Encoding>>
endobj

您正在寻找 \x93,\x94,\x96,\x97,\x98,即(十进制)147、148、150、151、152。根据 Encoding 上面,尤其是这个差异部分:

147/quotedblleft/quotedblright/bullet/endash/emdash/tilde

这意味着 quotedblleftquotedblrightendashemdashtilde .在字体规范文件中搜索这些名称会得到:

C 170 ; WX 444 ; N quotedblleft ; B 43 433 414 676 ;
C 186 ; WX 444 ; N quotedblright ; B 30 433 401 676 ;
C 177 ; WX 500 ; N endash ; B 0 201 500 250 ;
C 208 ; WX 1000 ; N emdash ; B 0 201 1000 250 ;
C 196 ; WX 333 ; N tilde ; B 1 532 331 638 ;

这里是字符的指标,尤其是宽度。

关于ios - PDF 中的 Times-Roman 字体缺少宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32010814/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com