diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43cc2ce..e43b7f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,11 +120,11 @@ jobs: pacman --noconfirm -S make gcc cd depend ./build_ms.sh - + - name: Build all run: | git fetch --tags --force - git describe --always --long --dirty --abbrev=10 --tags | ./tools/awk/awk.exe '{print \"\\\"\"$0\"\\\"\"}' > git_tag.inc + git describe --always --long --abbrev=10 --tags | ./tools/awk/awk.exe '{print \"\\\"\"$0\"\\\"\"}' > git_tag.inc ./tools/sed/sed.exe -i "s/git_tag.inc/git_tag.ci.inc/g" TTFviewer.pro ./tools/sed/sed.exe -i "s/QT_DIR=C:\/Qt\/Qt5.12.8\/5.12.8\/mingw73_32\/bin/QT_DIR=%Qt5_Dir%/g" ./build_setup.bat ./tools/sed/sed.exe -i "s/QT_TOOLS_DIR=C:\/Qt\/Qt5.12.8\/Tools\/mingw730_32\/bin/QT_TOOLS_DIR=C:\/ProgramData\/Chocolatey\/lib\/mingw\/tools\/install\/mingw64\/x86_64-w64-mingw32\/bin/g" ./build_setup.bat diff --git a/README.md b/README.md index 251888b..6030f4c 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,34 @@ +[![CI](https://github.com/QQxiaoming/TTFviewer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/QQxiaoming/TTFviewer/actions/workflows/ci.yml) +[![CodeFactor](https://www.codefactor.io/repository/github/qqxiaoming/ttfviewer/badge)](https://www.codefactor.io/repository/github/qqxiaoming/ttfviewer) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/QQxiaoming/TTFviewer.svg)](https://github.com/QQxiaoming/TTFviewer/releases) +[![GitHub All Releases](https://img.shields.io/github/downloads/QQxiaoming/TTFviewer/total.svg)](https://github.com/QQxiaoming/TTFviewer/releases) +[![GitHub stars](https://img.shields.io/github/stars/QQxiaoming/TTFviewer.svg)](https://github.com/QQxiaoming/TTFviewer) + # TTFviewer -TTFviewer一款用于开发人员查看预览各种ttf字体/图标图像格式的小工具,其基于Qt,部分代码来源自项目: https://github.com/donbright/font_to_svg 和 https://github.com/QQxiaoming/YUVviewer ,支持windows/linux/macos,界面简单清晰,操作便携,主界面如下: +English | [简体中文](./README_zh_CN.md) + +TTFviewer is a small tool for developers to view and preview various ttf font/icon image formats. It is based on Qt, and some of the code comes from the project: https://github.com/donbright/font_to_svg and https://github.com/QQxiaoming/YUVviewer , supports windows/linux/macos, the interface is simple and clear, and the operation is portable. The main interface is as follows: -(待补充) +![img0](./img/docimg0.png) -## 功能描述 +## Feature -1. 主界面选择参数。 -2. 点击打开文件或文件夹将进行图像数据解析并显示图像。 -3. 图像显示界面中使用 - - 滚轮放大缩小图像, - - 使用左键可拖动图像, - - 双击左键保存图像为png格式, - - 单击右键复位图像大小和位置, - - 单击中键显示图像原始大小。 +1. Select parameters on the main interface. +2. Click Open File or Folder to parse the image data and display the image. +3. Used in the image display interface + - scroll wheel to zoom in and out of the image, + - use the left button to drag the image, + - Double click the left button to save the image as png format, + - Right click to reset image size and position, + - Middle click to display the original size of the image. -## 格式支持 +## Format -目前支持格式包括: +Currently supported formats include: ttf -## 编译说明 +## Build -(待补充) +(TODO) diff --git a/README_zh_CN.md b/README_zh_CN.md new file mode 100644 index 0000000..516d286 --- /dev/null +++ b/README_zh_CN.md @@ -0,0 +1,34 @@ +[![CI](https://github.com/QQxiaoming/TTFviewer/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/QQxiaoming/TTFviewer/actions/workflows/ci.yml) +[![CodeFactor](https://www.codefactor.io/repository/github/qqxiaoming/ttfviewer/badge)](https://www.codefactor.io/repository/github/qqxiaoming/ttfviewer) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/QQxiaoming/TTFviewer.svg)](https://github.com/QQxiaoming/TTFviewer/releases) +[![GitHub All Releases](https://img.shields.io/github/downloads/QQxiaoming/TTFviewer/total.svg)](https://github.com/QQxiaoming/TTFviewer/releases) +[![GitHub stars](https://img.shields.io/github/stars/QQxiaoming/TTFviewer.svg)](https://github.com/QQxiaoming/TTFviewer) + +# TTFviewer + +[English](./README.md) | 简体中文 + +TTFviewer一款用于开发人员查看预览各种ttf字体/图标图像格式的小工具,其基于Qt,部分代码来源自项目: https://github.com/donbright/font_to_svg 和 https://github.com/QQxiaoming/YUVviewer ,支持windows/linux/macos,界面简单清晰,操作便携,主界面如下: + +![img0](./img/docimg0.png) + +## 功能描述 + +1. 主界面选择参数。 +2. 点击打开文件或文件夹将进行图像数据解析并显示图像。 +3. 图像显示界面中使用 + - 滚轮放大缩小图像, + - 使用左键可拖动图像, + - 双击左键保存图像为png格式, + - 单击右键复位图像大小和位置, + - 单击中键显示图像原始大小。 + +## 格式支持 + +目前支持格式包括: + +ttf + +## 编译说明 + +(待补充) diff --git a/TTFviewer.pro b/TTFviewer.pro index 07f08d9..26e52df 100644 --- a/TTFviewer.pro +++ b/TTFviewer.pro @@ -69,7 +69,7 @@ win32:{ INCLUDEPATH += $${FREETPE2_DIR}\include\freetype2 \ $${FREETPE2_DIR}\include - LIBS += $${FREETPE2_DIR}\lib\libfreetype.dll.a + LIBS += $${FREETPE2_DIR}\lib\libfreetype.a VERSION = $${YVYVIEWER_VERSION}.000 QMAKE_TARGET_PRODUCT = "TTFviewer" diff --git a/depend/build.sh b/depend/build.sh index c87e5af..9461383 100755 --- a/depend/build.sh +++ b/depend/build.sh @@ -7,3 +7,4 @@ cd $SHELL_FOLDER/freetype-2.3.5 ./configure --prefix=/usr/local/ttfviewer --disable-shared --without-zlib make -j4 make install +rm -rf $SHELL_FOLDER/freetype-2.3.5 diff --git a/depend/build_ms.sh b/depend/build_ms.sh index 8d9fd1b..5388a12 100755 --- a/depend/build_ms.sh +++ b/depend/build_ms.sh @@ -10,3 +10,4 @@ cd $SHELL_FOLDER/freetype-2.3.5 --without-zlib make -j4 make install +rm -rf $SHELL_FOLDER/freetype-2.3.5 diff --git a/img/docimg0.png b/img/docimg0.png index ac009ea..c1945f2 100644 Binary files a/img/docimg0.png and b/img/docimg0.png differ diff --git a/src/TTFviewer.cpp b/src/TTFviewer.cpp index 4c4eee7..a234965 100644 --- a/src/TTFviewer.cpp +++ b/src/TTFviewer.cpp @@ -300,7 +300,6 @@ bool TTFviewer::updateConfig(void) QMessageBox::critical(this, "Error", "frameSize invalid!!", QMessageBox::Ok); return false; } - } bool TTFviewer::imgView(QStringList openfile_list) diff --git a/src/font_to_svg.hpp b/src/font_to_svg.hpp index adfaa5c..8394438 100644 --- a/src/font_to_svg.hpp +++ b/src/font_to_svg.hpp @@ -104,7 +104,6 @@ class ttf_file debug << "\nFree library. error code: " << error; debug << "\n-->\n"; } - };