Python에서 EOT 폰트 작업 방법
EOT(Embedded OpenType)는 주로 레거시 Internet Explorer 호환성을 위해 사용되는 압축된 글꼴 포맷입니다. Aspose.Font Python용 FOSS는 FontLoader.open()를 통해 EOT 글꼴을 로드하고 TTF 또는 WOFF2와 같은 최신 포맷으로 변환할 수 있습니다.
단계별 가이드
1단계: 패키지 설치
git clone https://github.com/aspose-font-foss/Aspose.Font-FOSS-for-Python.git
cd Aspose.Font-FOSS-for-Python
pip install -e .2단계: 필요한 클래스 가져오기
from aspose_font import FontLoader
from aspose_font.converter import FontConverter # internal API — may change between releases
from aspose_font import FontType3단계: EOT 글꼴 로드
font = FontLoader.open("MyFont.eot")
print(font.font_name)
print(font.num_glyphs)단계 4: EOT를 WOFF2로 변환
from aspose_font import FontLoader
from aspose_font.converter import FontConverter # internal API — may change between releases
from aspose_font import FontType
font = FontLoader.open("MyFont.eot")
woff2 = FontConverter.convert(font, FontType.WOFF2)일반적인 문제 및 해결 방법
FontType 인식되지 않음 — 가져오기 FontType 최상위 패키지에서: from aspose_font import FontType.
EOT 파일을 로드하지 못했습니다 — 파일에 유효한 EOT 헤더가 있는지 확인하십시오. 손상되었거나 잘린 EOT 파일은 발생시킵니다 FontLoadException.
자주 묻는 질문
EOT를 OTF로 변환할 수 있나요?
먼저 FontConverter.convert(font, FontType.TTF)을(를) 사용해 EOT를 TTF로 변환하고, 필요하면 출력 파일의 확장자를 .otf로 바꾸세요 — OTF와 TTF는 동일한 바이너리 컨테이너를 공유합니다.
라이브러리가 EOT 파일을 작성합니까?
FontConverter.convert()은 EOT 출력을 생성하지 않습니다. EOT는 Aspose.Font FOSS에서 읽기 전용입니다.