메타폰트

벡터 글꼴을 정의하는 데 사용되는 설명 언어 중 하나

메타폰트(Metafont)는 벡터 글꼴을 정의하는 데 사용되는 설명 언어 중 하나이다. 메타폰트 코드를 실행하는 인터프리터의 이름이기도 한데, 예를 들어 포스트스크립트(PostScript)에 임베디드할 수 있는 비트맵 글꼴을 생성한다. 메타폰트는 도널드 커누스(Donald Knuth)에 의해 TeX 조판 시스템 상에서 작동되도록 고안되었다.

메타폰트
개발자도널드 커누스
안정화 버전
2.71828182 / 2021년 1월(3년 전)(2021-01)
운영 체제크로스 플랫폼
종류컴퓨터 언어
라이선스퍼미시브

메타폰트의 특징 중 하나는 글리프(자체)의 모든 모양이 기하학적 방정식으로 정의된다는 것이다. 특히, 주어진 점을 선분과 베지어 곡선의 교점으로 정의할 수 있다.

편집

다음 예제는 글꼴의 문자 "B"에 대해 눕혀지고 닫힌 모양을 만든다.

%file name: beta.mf
%mode_setup;
% Define a beanlike shape for the character B
beginchar("B",11pt#,11pt#,0);
  % Setup coordinates as an equation system
  y1=y2=y3=0;
  y4=y5=y6=h;
  x1=x4=0;
  x2=x5=w;
  x3=x6=2*w;

  % Define pen
  pickup pencircle xscaled 0.2w yscaled 0.04w rotated 45;

  % Draw the character curve
  draw z1..z3..z6{z2-z6}..z5..{z4-z2}z4..cycle;
endchar;

end

그러면 다음과 같은 글리프가 생성된다.

 

위의 예제는 다음과 같은 명령 행을 사용하여 처리된다.[1]

mf '\mode=ljfour; mode_setup; input beta.mf'; gftopk beta.600gf beta.600pk

그런 다음 다음과 같은 LaTeX 파일에서 사용할 수 있다.(모든 파일은 같은 디렉토리에 있어야한다. 또는 적절한 방법을 사용하여 TeX 시스템이 이 정보를 참조할 수 있게해야 한다)

\documentclass{article}

\newfont{\letterbeta}{beta}
\newcommand{\otherbeta}{{\letterbeta B}}

\begin{document}
Let’s try having a strange \otherbeta\ here.
\end{document}

결과 PDF 파일은 다음과 같을 것이다.

 

같이 보기 편집

참고 자료 편집

  • 도널드 커누스(Donald Knuth): Metafont: The Program, Addison-Wesley 1986. ISBN 0-201-13438-1
  • Donald Knuth: The Metafontbook, Addison-Wesley 1986. ISBN 0-201-13444-6 . The source code of the book in TeX (and a needed macro) is available online on CTAN.
  • Donald Knuth: The Metafont source code is written in the WEB programming language, and includes very extensive documentation about the algorithms used in Metafont.
  • Yannis Haralambous, "Fonts and Encodings", O'Reilly 2007, ISBN 0-596-10242-9, Appendix F: "METAFONT and its derivatives"
  • K. Píška, "Creating Type 1 fonts from Metafont sources: comparison of tools, techniques and results", in TeX, XML, and Digital Typography (Springer-Verlag, Berlin, 2004), Lect. Notes Comput. Sci., Vol. 3130, pp. 240–56. preprint
  • Hofstadter, Douglas R., "Metafont, Metamathematics, and Metaphysics: Comments on Donald Knuth's Article 'The Concept of a Meta-Font'" Visible Language, Vol. XVI no. 4, pp. 309–338 (republished in Hofstadter's book Metamagical Themas, NY: Basic Books, 1985)

각주 편집

  1. Christophe Grandsir. “METAFONT Tutorial”.