# TTF字体生成到PDF **Repository Path**: hsussane/generate-ttf-font-to-pdf ## Basic Information - **Project Name**: TTF字体生成到PDF - **Description**: 使用libharu库,把“楷体”里面包含的所有的文字写入到PDF文件中,一页写300个字符,一行写15个字符。字体文件可以被替换成其他.ttf文件。 - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-24 - **Last Updated**: 2024-12-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: cmake, libharu, freetype ## README # TTF字体生成到PDF #### 介绍 使用libharu库,把“楷体”里面包含的所有的文字写入到PDF文件中,一页写300个字符,一行写15个字符。字体文件可以被替换成其他.ttf文件。 根目录下有结果pdf文件,output.pdf。 #### 步骤 1. 使用CMake,依次编译开源库zlib、libpng、libhuru,libharu的库的编译基于前二者;编译freetype库。 2. 将所需库的include、lib纳入项目文件夹,完成cmakelists配置。 3. 将动态库文件.dll放置到cmake生成的项目文件build/Debug下,与.exe同目录。 4. 编写项目逻辑。 #### 说明 1. windows环境下 版本:CMake3.24 libharu-2.4.4 zlib-1.3.1 libpng16 freetype-2.13.3 VS2017