使用“fontspec”包从外部选择字体有什么问题?

使用“fontspec”包从外部选择字体有什么问题?

我想使用该fontspec包为我的文档选择一些从互联网上下载的字体,但我不断收到此使用错误:

Undefined control sequence.
<argument> ...ntspec_fontopts_clist ,,Path=\Users \BurakK \Downloads \Almond...
l.7 ...[Path=\Users\BurakK\Downloads\AlmondNougat]XeLaTeX compiler on TeXworks software.

当我尝试使用编译此代码时西拉特克斯特克斯沃克斯

\documentclass{article}
\usepackage{fontspec}
\setmainfont{AlmondNougat.ttf}[path=/Users/BurakK/Downloads/AlmondNougat]
\begin{document}
This is a test sentence to check font feature.
\end{document}

我尝试了很多其他方法,比如将文件名改为更简单的小写形式,使用 .otf 和 .ttf 文件扩展名等,但仍然无济于事。我甚至阅读了软件包手册中的外部字体选择部分,但我不知道我在这里做错了什么以及如何解决这个问题。

编辑:

为了响应评论部分的建议,即在文件路径中使用正斜杠而不是反斜杠,这次我收到了这样的错误:

Errors: 116, Warnings: 0, Bad boxes: 0


OT.mf
39
Transform components aren't all known.

<to be read again> 

                   ;

set_black_circle->...circle.scaled.line_thickness;

                                                  lft.x1=1/22size;y1=1/2size...

l.39 set_black_circle

OT.mf
39
Undefined x coordinate has been replaced by 0.

<to be read again> 

                   ..

set_black_circle->...size;y2=1/2size;filldraw.z1..

                                                  z2..cycle;black_circle:=cu...

l.39 set_black_circle

OT.mf
39
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

set_black_circle->...size;y2=1/2size;filldraw.z1..

                                                  z2..cycle;black_circle:=cu...

l.39 set_black_circle

OT.mf
39
Undefined x coordinate has been replaced by 0.

<to be read again> 

                   ..

set_black_circle->...;y2=1/2size;filldraw.z1..z2..

                                                  cycle;black_circle:=curren...

l.39 set_black_circle

OT.mf
39
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

set_black_circle->...;y2=1/2size;filldraw.z1..z2..

                                                  cycle;black_circle:=curren...

l.39 set_black_circle

OT.mf
47
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.47 beginchar(0,24/22size#,23/22size#,1/22size#)

OT.mf
47
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.47 beginchar(0,24/22size#,23/22size#,1/22size#)

OT.mf
47
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.47 beginchar(0,24/22size#,23/22size#,1/22size#)

OT.mf
49
Transform components aren't all known.

<to be read again> 

                   ;

l.49   pickup pencircle scaled line_thickness;

OT.mf
67
Undefined x coordinate has been replaced by 0.

<to be read again> 

                   ..

l.67   filldraw z5..

OT.mf
67
Undefined x coordinate has been replaced by 0.

<to be read again> 

                   ..

l.67   filldraw z5..z6..

OT.mf
79
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.79 beginchar(1,24/22size#,23/22size#,1/22size#)

OT.mf
79
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.79 beginchar(1,24/22size#,23/22size#,1/22size#)

OT.mf
79
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.79 beginchar(1,24/22size#,23/22size#,1/22size#)

OT.mf
81
Transform components aren't all known.

<to be read again> 

                   ;

l.81   pickup pencircle scaled line_thickness;

OT.mf
105
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.105 beginchar(2,24/22size#,23/22size#,1/22size#)

OT.mf
105
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.105 beginchar(2,24/22size#,23/22size#,1/22size#)

OT.mf
105
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.105 beginchar(2,24/22size#,23/22size#,1/22size#)

OT.mf
107
Transform components aren't all known.

<to be read again> 

                   ;

l.107   pickup pencircle scaled line_thickness;

OT.mf
119
Transform components aren't all known.

<to be read again> 

                   ;

l.119 ...p pencircle scaled border_line_thickness;

OT.mf
133
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.133 beginchar(3,24/22size#,23/22size#,1/22size#)

OT.mf
133
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.133 beginchar(3,24/22size#,23/22size#,1/22size#)

OT.mf
133
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.133 beginchar(3,24/22size#,23/22size#,1/22size#)

OT.mf
135
Transform components aren't all known.

<to be read again> 

                   ;

l.135   pickup pencircle scaled line_thickness;

OT.mf
147
Transform components aren't all known.

<to be read again> 

                   ;

l.147 ...p pencircle scaled border_line_thickness;

OT.mf
161
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.161 beginchar(4,24/22size#,23/22size#,1/22size#)

OT.mf
161
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.161 beginchar(4,24/22size#,23/22size#,1/22size#)

OT.mf
161
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.161 beginchar(4,24/22size#,23/22size#,1/22size#)

OT.mf
163
Transform components aren't all known.

<to be read again> 

                   ;

l.163 ...p pencircle scaled border_line_thickness;

OT.mf
175
Transform components aren't all known.

<to be read again> 

                   ;

l.175   pickup pencircle scaled line_thickness;

OT.mf
189
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.189 beginchar(5,24/22size#,23/22size#,1/22size#)

OT.mf
189
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.189 beginchar(5,24/22size#,23/22size#,1/22size#)

OT.mf
189
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.189 beginchar(5,24/22size#,23/22size#,1/22size#)

OT.mf
191
Transform components aren't all known.

<to be read again> 

                   ;

l.191 ...p pencircle scaled border_line_thickness;

OT.mf
203
Transform components aren't all known.

<to be read again> 

                   ;

l.203   pickup pencircle scaled line_thickness;

OT.mf
217
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.217 beginchar(6,24/22size#,23/22size#,1/22size#)

OT.mf
217
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.217 beginchar(6,24/22size#,23/22size#,1/22size#)

OT.mf
217
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.217 beginchar(6,24/22size#,23/22size#,1/22size#)

OT.mf
219
Transform components aren't all known.

<to be read again> 

                   ;

l.219 ...p pencircle scaled border_line_thickness;

OT.mf
233
Transform components aren't all known.

<to be read again> 

                   ;

l.233 ...up penrazor scaled border_line_thickness;

OT.mf
239
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.239   draw z5..

OT.mf
239
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.239   draw z5..z6;

OT.mf
251
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.251 beginchar(7,24/22size#,23/22size#,1/22size#)

OT.mf
251
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.251 beginchar(7,24/22size#,23/22size#,1/22size#)

OT.mf
251
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.251 beginchar(7,24/22size#,23/22size#,1/22size#)

OT.mf
253
Transform components aren't all known.

<to be read again> 

                   ;

l.253 ...p pencircle scaled border_line_thickness;

OT.mf
267
Transform components aren't all known.

<to be read again> 

                   ;

l.267 ...up penrazor scaled border_line_thickness;

OT.mf
273
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.273   draw z5..

OT.mf
273
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.273   draw z5..z6;

OT.mf
285
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.285 beginchar(8,24/22size#,23/22size#,1/22size#)

OT.mf
285
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.285 beginchar(8,24/22size#,23/22size#,1/22size#)

OT.mf
285
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.285 beginchar(8,24/22size#,23/22size#,1/22size#)

OT.mf
287
Transform components aren't all known.

<to be read again> 

                   ;

l.287 ...p pencircle scaled border_line_thickness;

OT.mf
301
Transform components aren't all known.

<to be read again> 

                   ;

l.301 ...up penrazor scaled border_line_thickness;

OT.mf
307
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.307   draw z5..

OT.mf
307
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.307   draw z5..z6;

OT.mf
319
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.319 beginchar(9,24/22size#,23/22size#,1/22size#)

OT.mf
319
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.319 beginchar(9,24/22size#,23/22size#,1/22size#)

OT.mf
319
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.319 beginchar(9,24/22size#,23/22size#,1/22size#)

OT.mf
321
Transform components aren't all known.

<to be read again> 

                   ;

l.321 ...p pencircle scaled border_line_thickness;

OT.mf
335
Transform components aren't all known.

<to be read again> 

                   ;

l.335 ...up penrazor scaled border_line_thickness;

OT.mf
341
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.341   draw z5..

OT.mf
341
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.341   draw z5..z6;

OT.mf
353
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.353 ...nchar(10,24/22size#,23/22size#,1/22size#)

OT.mf
353
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.353 ...nchar(10,24/22size#,23/22size#,1/22size#)

OT.mf
353
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.353 ...nchar(10,24/22size#,23/22size#,1/22size#)

OT.mf
355
Transform components aren't all known.

<to be read again> 

                   ;

l.355   pickup pencircle scaled line_thickness;

OT.mf
383
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.383 ...nchar(11,24/22size#,23/22size#,1/22size#)

OT.mf
383
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.383 ...nchar(11,24/22size#,23/22size#,1/22size#)

OT.mf
383
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.383 ...nchar(11,24/22size#,23/22size#,1/22size#)

OT.mf
385
Transform components aren't all known.

<to be read again> 

                   ;

l.385   pickup pencircle scaled line_thickness;

OT.mf
397
Transform components aren't all known.

<to be read again> 

                   ;

l.397 ...p pencircle scaled border_line_thickness;

OT.mf
415
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.415 ...nchar(12,24/22size#,23/22size#,1/22size#)

OT.mf
415
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.415 ...nchar(12,24/22size#,23/22size#,1/22size#)

OT.mf
415
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.415 ...nchar(12,24/22size#,23/22size#,1/22size#)

OT.mf
417
Transform components aren't all known.

<to be read again> 

                   ;

l.417   pickup pencircle scaled line_thickness;

OT.mf
429
Transform components aren't all known.

<to be read again> 

                   ;

l.429 ...p pencircle scaled border_line_thickness;

OT.mf
447
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.447 ...nchar(13,24/22size#,23/22size#,1/22size#)

OT.mf
447
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.447 ...nchar(13,24/22size#,23/22size#,1/22size#)

OT.mf
447
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.447 ...nchar(13,24/22size#,23/22size#,1/22size#)

OT.mf
449
Transform components aren't all known.

<to be read again> 

                   ;

l.449 ...p pencircle scaled border_line_thickness;

OT.mf
461
Transform components aren't all known.

<to be read again> 

                   ;

l.461   pickup pencircle scaled line_thickness;

OT.mf
479
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.479 ...nchar(14,24/22size#,23/22size#,1/22size#)

OT.mf
479
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.479 ...nchar(14,24/22size#,23/22size#,1/22size#)

OT.mf
479
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.479 ...nchar(14,24/22size#,23/22size#,1/22size#)

OT.mf
481
Transform components aren't all known.

<to be read again> 

                   ;

l.481 ...p pencircle scaled border_line_thickness;

OT.mf
493
Transform components aren't all known.

<to be read again> 

                   ;

l.493   pickup pencircle scaled line_thickness;

OT.mf
511
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.511 ...nchar(15,24/22size#,23/22size#,1/22size#)

OT.mf
511
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.511 ...nchar(15,24/22size#,23/22size#,1/22size#)

OT.mf
511
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.511 ...nchar(15,24/22size#,23/22size#,1/22size#)

OT.mf
513
Transform components aren't all known.

<to be read again> 

                   ;

l.513 ...p pencircle scaled border_line_thickness;

OT.mf
527
Transform components aren't all known.

<to be read again> 

                   ;

l.527 ...up penrazor scaled border_line_thickness;

OT.mf
533
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.533   draw z5..

OT.mf
533
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.533   draw z5..z6;

OT.mf
549
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.549 ...nchar(16,24/22size#,23/22size#,1/22size#)

OT.mf
549
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.549 ...nchar(16,24/22size#,23/22size#,1/22size#)

OT.mf
549
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.549 ...nchar(16,24/22size#,23/22size#,1/22size#)

OT.mf
551
Transform components aren't all known.

<to be read again> 

                   ;

l.551 ...p pencircle scaled border_line_thickness;

OT.mf
565
Transform components aren't all known.

<to be read again> 

                   ;

l.565 ...up penrazor scaled border_line_thickness;

OT.mf
571
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.571   draw z5..

OT.mf
571
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.571   draw z5..z6;

OT.mf
587
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.587 ...nchar(17,24/22size#,23/22size#,1/22size#)

OT.mf
587
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.587 ...nchar(17,24/22size#,23/22size#,1/22size#)

OT.mf
587
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.587 ...nchar(17,24/22size#,23/22size#,1/22size#)

OT.mf
589
Transform components aren't all known.

<to be read again> 

                   ;

l.589 ...p pencircle scaled border_line_thickness;

OT.mf
603
Transform components aren't all known.

<to be read again> 

                   ;

l.603 ...up penrazor scaled border_line_thickness;

OT.mf
609
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.609   draw z5..

OT.mf
609
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.609   draw z5..z6;

OT.mf
625
Internal quantity `charwd' must receive a known value.

<to be read again> 

                   ;

beginchar->...byte(EXPR0)else:0fi;charwd:=(EXPR1);

                                                  charht:=(EXPR2);chardp:=(E...

l.625 ...nchar(18,24/22size#,23/22size#,1/22size#)

OT.mf
625
Internal quantity `charht' must receive a known value.

<to be read again> 

                   ;

beginchar->...0fi;charwd:=(EXPR1);charht:=(EXPR2);

                                                  chardp:=(EXPR3);w:=hround(...

l.625 ...nchar(18,24/22size#,23/22size#,1/22size#)

OT.mf
625
Internal quantity `chardp' must receive a known value.

<to be read again> 

                   ;

beginchar->...R1);charht:=(EXPR2);chardp:=(EXPR3);

                                                  w:=hround(charwd*hppp);h:=...

l.625 ...nchar(18,24/22size#,23/22size#,1/22size#)

OT.mf
627
Transform components aren't all known.

<to be read again> 

                   ;

l.627 ...p pencircle scaled border_line_thickness;

OT.mf
641
Transform components aren't all known.

<to be read again> 

                   ;

l.641 ...up penrazor scaled border_line_thickness;

OT.mf
647
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ..

l.647   draw z5..

OT.mf
647
Undefined y coordinate has been replaced by 0.

<to be read again> 

                   ;

l.647   draw z5..z6;

test.tex
7
Package fontspec Error: The font "abc" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.7 ...{abc.ttf}[path=/Users/BurakK/Downloads/abc]

答案1

这对我有用:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{AlmondNougat.otf}
\begin{document}
\LARGE This is a test sentence to check the font feature. It's nuts!
\end{document}

在此处输入图片描述

我从这里下载了字体:https://www.dafont.com/almond-nougat.font并将其重命名为 AlmondNougat.otf(=从文件名中删除空格)当前目录,即也包含您的.tex 文件。

答案2

我使用来自您的文档的完整路径或相对路径../myfont/NeoSt/

就你的情况来说

\setmainfont[%
Path=C:/Users//BurakK/Downloads/ ,
UprightFont = * ,
Extension = .ttf
]{AlmondNougat}

(将文件重命名为 AlmondNougat.ttf,名称中不带空格。另请注意需要使用Path而不是path

对于系统字体,您需要使用 Properties 获取文件的真实名称,而不是主字体目录中显示的名称。斜体字体的文件名为 ,timesi.ttf粗体字体的文件名为timesbf.ttf

% !TeX TS-program = xelatex

\documentclass{article}
\usepackage{fontspec}

%\setmainfont{AlmondNougat.ttf}[path=/Users/BurakK/Downloads/AlmondNougat]

\setmainfont[% OK7
Path = c:/windows/fonts/ ,
UprightFont = * ,
BoldFont = *bd ,
ItalicFont = *i ,
Extension = .ttf
]{times} % 


\begin{document}
    This is a \emph{test} sentence to \textbf{check} font feature.
\end{document}

在此处输入图片描述

使用 Almond Nougat(粗体字体)

杏仁

相关内容