diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore index f1f1ac1..74e81a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,15 @@ -Debug/ -Release/ -Debug Library/ -Release Library/ -x86/ -x64/ +/build/ +/Debug/ +/Release/ +/Debug Library/ +/Release Library/ +/x86/ +/x64/ +.vs/ +.vscode/ +.DS_Store *.exe +*.zip *.user *.sdf *.pdb @@ -13,9 +18,8 @@ x64/ *.suo *.VC.opendb *.VC.db -bin/msdf-atlas-gen -bin/*.lib +/bin/*.lib +/bin/msdf-atlas-gen output.png out/ -build/ /cmake-gen.bat diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d4480..08b970e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,22 @@ +## Version 1.3 (forthcoming) + +- Updated to MSDFgen 1.10 +- Switched to vcpkg as the primary dependency management system +- Removed Visual Studio solution and Makefile - now has to be generated by CMake +- CMake configuration overhaul, added installation configuration +- Switched to libpng as the primary PNG file encoder +- Fixed a bug that prevented glyph 0 to be specified in a glyphset + +### Version 1.2.2 (2021-09-06) + +- CMake support +- Conan package manager support + +### Version 1.2.1 (2021-07-09) + +- Updated to MSDFgen 1.9.1 + ## Version 1.2 (2021-05-29) - Updated to MSDFgen 1.9. diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a3bb34..c9a2f7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,52 +1,135 @@ cmake_minimum_required(VERSION 3.15) +include(cmake/version.cmake) -option(MSDF_ATLAS_GEN_BUILD_STANDALONE "Build the msdf-atlas-gen standalone executable" ON) -option(MSDF_ATLAS_GEN_MSDFGEN_EXTERNAL "Do not build the msdfgen submodule but find it as an external package" OFF) -if(NOT MSDF_ATLAS_GEN_MSDFGEN_EXTERNAL) +option(MSDF_ATLAS_BUILD_STANDALONE "Build the msdf-atlas-gen standalone executable" ON) +option(MSDF_ATLAS_USE_VCPKG "Use vcpkg package manager to link project dependencies" ON) +option(MSDF_ATLAS_USE_SKIA "Build with the Skia library" ON) +option(MSDF_ATLAS_MSDFGEN_EXTERNAL "Do not build the msdfgen submodule but find it as an external package" OFF) +option(MSDF_ATLAS_INSTALL "Generate installation target" OFF) +option(MSDF_ATLAS_DYNAMIC_RUNTIME "Link dynamic runtime library instead of static" OFF) +option(BUILD_SHARED_LIBS "Generate dynamic library files instead of static" OFF) + +if(NOT MSDF_ATLAS_MSDFGEN_EXTERNAL) + set(MSDFGEN_CORE_ONLY OFF CACHE INTERNAL "Only build the core msdfgen library with no dependencies (disabled for msdf-atlas-gen)" FORCE) set(MSDFGEN_BUILD_STANDALONE OFF CACHE BOOL "Build the msdfgen standalone executable") - set(MSDFGEN_USE_OPENMP OFF CACHE INTERNAL "Build with OpenMP support for multithreaded code (disabled for atlas gen)" FORCE) - set(MSDFGEN_USE_CPP11 ON CACHE INTERNAL "Build with C++11 enabled (always enabled for atlas gen)" FORCE) - set(MSDFGEN_INSTALL OFF CACHE BOOL "Generate installation target for msdfgen") + set(MSDFGEN_USE_VCPKG ${MSDF_ATLAS_USE_VCPKG} CACHE INTERNAL "Use vcpkg package manager to link msdfgen project dependencies" FORCE) + set(MSDFGEN_USE_OPENMP OFF CACHE INTERNAL "Build with OpenMP support for multithreaded code (disabled for msdf-atlas-gen)" FORCE) + set(MSDFGEN_USE_CPP11 ON CACHE INTERNAL "Build with C++11 enabled (always enabled for msdf-atlas-gen)" FORCE) + set(MSDFGEN_USE_SKIA ${MSDF_ATLAS_USE_SKIA} CACHE INTERNAL "Build msdfgen with the Skia library" FORCE) + set(MSDFGEN_INSTALL ${MSDF_ATLAS_INSTALL} CACHE INTERNAL "Generate installation target for msdfgen" FORCE) + set(MSDFGEN_DYNAMIC_RUNTIME ${MSDF_ATLAS_DYNAMIC_RUNTIME} CACHE INTERNAL "Link dynamic runtime library instead of static for msdfgen" FORCE) endif() -project(msdf-atlas-gen VERSION 1.2 LANGUAGES CXX) +get_property(MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(NOT MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE) + message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Release") + set(CMAKE_BUILD_TYPE Release) +endif() -find_package(Threads REQUIRED) +if(MSDF_ATLAS_DYNAMIC_RUNTIME) + set(MSDF_ATLAS_MSVC_RUNTIME "MultiThreaded$<$:Debug>DLL") +else() + set(MSDF_ATLAS_MSVC_RUNTIME "MultiThreaded$<$:Debug>") +endif() -if(MSDF_ATLAS_GEN_MSDFGEN_EXTERNAL) - find_package(msdfgen REQUIRED) +if(BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +if(MSDF_ATLAS_USE_VCPKG) + # Make sure that vcpkg toolchain file is set + if(NOT CMAKE_TOOLCHAIN_FILE) + if(DEFINED ENV{VCPKG_ROOT}) + set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") + else() + message(SEND_ERROR "Vcpkg toolchain not configured. Either set VCPKG_ROOT environment variable or pass -DCMAKE_TOOLCHAIN_FILE=VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake to cmake") + endif() + endif() + # Default to statically linked vcpkg triplet on Windows + if(WIN32 AND NOT VCPKG_TARGET_TRIPLET AND NOT MSDF_ATLAS_DYNAMIC_RUNTIME) + if(CMAKE_GENERATOR_PLATFORM MATCHES "64$" AND NOT CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64") + set(VCPKG_TARGET_TRIPLET "x64-windows-static") + elseif(CMAKE_GENERATOR_PLATFORM MATCHES "32$" OR CMAKE_GENERATOR_PLATFORM STREQUAL "x86") + set(VCPKG_TARGET_TRIPLET "x86-windows-static") + else() + if(CMAKE_GENERATOR_PLATFORM) + message(WARNING "Vcpkg triplet not explicitly specified and could not be deduced. Recommend using -DVCPKG_TARGET_TRIPLET=x64-windows-static or similar") + else() + message(WARNING "Vcpkg triplet not explicitly specified and could not be deduced. Recommend using -A to explicitly select platform (Win32 or x64)") + endif() + endif() + endif() + # Select project features + if(NOT MSDF_ATLAS_VCPKG_FEATURES_SET) + set(VCPKG_MANIFEST_NO_DEFAULT_FEATURES ON) + if(MSDF_ATLAS_USE_SKIA) + list(APPEND VCPKG_MANIFEST_FEATURES "geometry-preprocessing") + endif() + endif() + set(MSDFGEN_VCPKG_FEATURES_SET ON) +endif() + +# Version is specified in vcpkg.json +project(msdf-atlas-gen VERSION ${MSDF_ATLAS_VERSION} LANGUAGES CXX) + +if(MSDF_ATLAS_MSDFGEN_EXTERNAL) + if(NOT TARGET msdfgen::msdfgen) + find_package(msdfgen REQUIRED) + endif() else() add_subdirectory(msdfgen) endif() +find_package(Threads REQUIRED) +if(NOT TARGET PNG::PNG) + find_package(PNG REQUIRED) +endif() -file(GLOB_RECURSE MSDF_ATLAS_GEN_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "msdf-atlas-gen/*.h" "msdf-atlas-gen/*.hpp") -file(GLOB_RECURSE MSDF_ATLAS_GEN_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "msdf-atlas-gen/*.cpp") +file(GLOB_RECURSE MSDF_ATLAS_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "msdf-atlas-gen/*.h" "msdf-atlas-gen/*.hpp") +file(GLOB_RECURSE MSDF_ATLAS_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "msdf-atlas-gen/*.cpp") # msdf-atlas-gen library -add_library(msdf-atlas-gen ${MSDF_ATLAS_GEN_HEADERS} ${MSDF_ATLAS_GEN_SOURCES}) +add_library(msdf-atlas-gen ${MSDF_ATLAS_HEADERS} ${MSDF_ATLAS_SOURCES}) add_library(msdf-atlas-gen::msdf-atlas-gen ALIAS msdf-atlas-gen) -set_target_properties(msdf-atlas-gen PROPERTIES PUBLIC_HEADER "${MSDF_ATLAS_GEN_HEADERS}") +set_target_properties(msdf-atlas-gen PROPERTIES PUBLIC_HEADER "${MSDF_ATLAS_HEADERS}") +set_property(TARGET msdf-atlas-gen PROPERTY MSVC_RUNTIME_LIBRARY "${MSDF_ATLAS_MSVC_RUNTIME}") +target_compile_definitions(msdf-atlas-gen PUBLIC + MSDF_ATLAS_VERSION=${MSDF_ATLAS_VERSION} + MSDF_ATLAS_VERSION_MAJOR=${MSDF_ATLAS_VERSION_MAJOR} + MSDF_ATLAS_VERSION_MINOR=${MSDF_ATLAS_VERSION_MINOR} + MSDF_ATLAS_VERSION_REVISION=${MSDF_ATLAS_VERSION_REVISION} + MSDF_ATLAS_COPYRIGHT_YEAR=${MSDF_ATLAS_COPYRIGHT_YEAR} +) target_include_directories(msdf-atlas-gen INTERFACE + $ $ PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/msdfgen/include # for lodepng.h ${CMAKE_CURRENT_SOURCE_DIR}/artery-font-format ) - -target_compile_features(msdf-atlas-gen PUBLIC cxx_std_11) -target_link_libraries(msdf-atlas-gen PUBLIC Threads::Threads msdfgen::msdfgen) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT msdf-atlas-gen) +target_compile_features(msdf-atlas-gen PUBLIC cxx_std_11) +target_link_libraries(msdf-atlas-gen PRIVATE Threads::Threads PNG::PNG) +target_link_libraries(msdf-atlas-gen PUBLIC msdfgen::msdfgen) + +if(BUILD_SHARED_LIBS AND WIN32) + target_compile_definitions(msdf-atlas-gen PRIVATE "MSDF_ATLAS_PUBLIC=__declspec(dllexport)") + target_compile_definitions(msdf-atlas-gen INTERFACE "MSDF_ATLAS_PUBLIC=__declspec(dllimport)") +else() + target_compile_definitions(msdf-atlas-gen PUBLIC MSDF_ATLAS_PUBLIC=) +endif() + # msdf-atlas-gen standalone executable -if(MSDF_ATLAS_GEN_BUILD_STANDALONE) - set(MSDF_ATLAS_GEN_STANDALONE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/msdf-atlas-gen/main.cpp") +if(MSDF_ATLAS_BUILD_STANDALONE) + set(MSDF_ATLAS_STANDALONE_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/msdf-atlas-gen/main.cpp") if(MSVC) - set(MSDF_ATLAS_GEN_STANDALONE_SOURCES ${MSDF_ATLAS_GEN_STANDALONE_SOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/msdf-atlas-gen.rc") + set(MSDF_ATLAS_STANDALONE_SOURCES ${MSDF_ATLAS_STANDALONE_SOURCES} "${CMAKE_CURRENT_SOURCE_DIR}/msdf-atlas-gen.rc") endif() - add_executable(msdf-atlas-gen-standalone ${MSDF_ATLAS_GEN_STANDALONE_SOURCES}) + add_executable(msdf-atlas-gen-standalone ${MSDF_ATLAS_STANDALONE_SOURCES}) target_compile_definitions(msdf-atlas-gen-standalone PUBLIC MSDF_ATLAS_STANDALONE) + target_compile_definitions(msdf-atlas-gen-standalone PRIVATE MSDF_ATLAS_VERSION_UNDERLINE=${MSDF_ATLAS_VERSION_UNDERLINE}) + set_property(TARGET msdf-atlas-gen-standalone PROPERTY MSVC_RUNTIME_LIBRARY "${MSDF_ATLAS_MSVC_RUNTIME}") set_target_properties(msdf-atlas-gen-standalone PROPERTIES OUTPUT_NAME msdf-atlas-gen ARCHIVE_OUTPUT_NAME msdf-atlas-gen-standalone @@ -54,6 +137,64 @@ if(MSDF_ATLAS_GEN_BUILD_STANDALONE) ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" ) - target_link_libraries(msdf-atlas-gen-standalone PUBLIC msdf-atlas-gen::msdf-atlas-gen) + target_link_libraries(msdf-atlas-gen-standalone PRIVATE msdf-atlas-gen::msdf-atlas-gen) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT msdf-atlas-gen-standalone) endif() + +# Installation +if(MSDF_ATLAS_INSTALL) + include(GNUInstallDirs) + include(CMakePackageConfigHelpers) + set(MSDF_ATLAS_CONFIG_PATH "lib/cmake/msdf-atlas-gen") + + # install tree package config + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/msdf-atlas-gen-config-version.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY SameMajorVersion + ) + + configure_package_config_file( + cmake/msdf-atlas-gen-config.cmake.in + ${MSDF_ATLAS_CONFIG_PATH}/msdf-atlas-gen-config.cmake + INSTALL_DESTINATION ${MSDF_ATLAS_CONFIG_PATH} + NO_CHECK_REQUIRED_COMPONENTS_MACRO + ) + + # build tree package config + configure_file( + cmake/msdf-atlas-gen-config.cmake.in + msdf-atlas-gen-config.cmake + @ONLY + ) + + install(TARGETS msdf-atlas-gen EXPORT msdf-atlas-gen-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/msdf-atlas-gen + ) + if(MSVC AND BUILD_SHARED_LIBS) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + endif() + + export(EXPORT msdf-atlas-gen-targets NAMESPACE msdf-atlas-gen:: FILE "${CMAKE_CURRENT_BINARY_DIR}/msdf-atlas-gen-targets.cmake") + install(EXPORT msdf-atlas-gen-targets FILE msdf-atlas-gen-targets.cmake NAMESPACE msdf-atlas-gen:: DESTINATION ${MSDF_ATLAS_CONFIG_PATH}) + + if(MSDF_ATLAS_BUILD_STANDALONE) + install(TARGETS msdf-atlas-gen-standalone EXPORT msdf-atlas-gen-binary-targets DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(MSVC) + install(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) + endif() + export(EXPORT msdf-atlas-gen-binary-targets NAMESPACE msdf-atlas-gen-standalone:: FILE "${CMAKE_CURRENT_BINARY_DIR}/msdf-atlas-gen-binary-targets.cmake") + install(EXPORT msdf-atlas-gen-binary-targets FILE msdf-atlas-gen-binary-targets.cmake NAMESPACE msdf-atlas-gen-standalone:: DESTINATION ${MSDF_ATLAS_CONFIG_PATH}) + endif() + + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/${MSDF_ATLAS_CONFIG_PATH}/msdf-atlas-gen-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/msdf-atlas-gen-config-version.cmake" + DESTINATION ${MSDF_ATLAS_CONFIG_PATH} + ) +endif() diff --git a/LICENSE.txt b/LICENSE.txt index 83edc59..3642b9f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Viktor Chlumsky +Copyright (c) 2020 - 2023 Viktor Chlumsky Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile deleted file mode 100644 index 88acefb..0000000 --- a/Makefile +++ /dev/null @@ -1,4 +0,0 @@ - -all: - mkdir -p bin - g++ -I /usr/local/include/freetype2 -I /usr/include/freetype2 -I artery-font-format -I msdfgen/include -I msdfgen -D MSDFGEN_USE_CPP11 -D MSDF_ATLAS_STANDALONE -std=c++11 -pthread -O2 -o bin/msdf-atlas-gen msdfgen/core/*.cpp msdfgen/lib/*.cpp msdfgen/ext/*.cpp msdf-atlas-gen/*.cpp -lfreetype diff --git a/README.md b/README.md index e5f3ff6..22b242b 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,11 @@ Notes: ## Getting started This project can be used either as a library or as a standalone console program. +Examples of how to use it as a library are available at the [bottom of the page](#library-usage-examples). To start using the program immediately, there is a Windows binary available for download in the ["Releases" section](https://github.com/Chlumsky/msdf-atlas-gen/releases). -To build the project, you may use the included [Visual Studio solution](msdf-atlas-gen.sln) or the [CMake script](CMakeLists.txt). Examples of how to use it as a library are available [at the bottom](#library-usage-examples). +To build the project from source, you may use the included [CMake script](CMakeLists.txt). +In its default configuration, it requires [vcpkg](https://vcpkg.io/) as the provider for third-party library dependencies. +If you set the environment variable `VCPKG_ROOT` to the vcpkg directory, the CMake configuration will take care of fetching all required packages from vcpkg. ## Command line arguments diff --git a/artery-font-format b/artery-font-format index 00ac3d8..a3dcadb 160000 --- a/artery-font-format +++ b/artery-font-format @@ -1 +1 @@ -Subproject commit 00ac3d8f964ec00a836c2bb5aeb126235ac98234 +Subproject commit a3dcadb9df2b5d45db2691ceea84318c711cb3e1 diff --git a/cmake/msdf-atlas-gen-config.cmake.in b/cmake/msdf-atlas-gen-config.cmake.in new file mode 100644 index 0000000..8789a4a --- /dev/null +++ b/cmake/msdf-atlas-gen-config.cmake.in @@ -0,0 +1,18 @@ + +include(CMakeFindDependencyMacro) + +set(MSDF_ATLAS_STANDALONE_AVAILABLE @MSDF_ATLAS_BUILD_STANDALONE@) + +find_dependency(PNG REQUIRED) +find_dependency(msdfgen REQUIRED) + +include("${CMAKE_CURRENT_LIST_DIR}/msdf-atlas-gen-targets.cmake") + +if(MSDF_ATLAS_STANDALONE_AVAILABLE) + include("${CMAKE_CURRENT_LIST_DIR}/msdf-atlas-gen-binary-targets.cmake") + if(${CMAKE_VERSION} VERSION_LESS "3.18.0") + set_target_properties(msdf-atlas-gen-standalone::msdf-atlas-gen-standalone PROPERTIES IMPORTED_GLOBAL TRUE) + endif() + add_executable(msdf-atlas-gen::msdf-atlas-gen-run ALIAS msdf-atlas-gen-standalone::msdf-atlas-gen-standalone) + set(MSDF_ATLAS_GEN_EXECUTABLE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/msdf-atlas-gen@CMAKE_EXECUTABLE_SUFFIX@") +endif() diff --git a/cmake/version.cmake b/cmake/version.cmake new file mode 100644 index 0000000..291f632 --- /dev/null +++ b/cmake/version.cmake @@ -0,0 +1,19 @@ + +# This script reads version from vcpkg.json and sets it to ${MSDF_ATLAS_VERSION} etc. + +cmake_minimum_required(VERSION 3.15) + +file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/../vcpkg.json" MSDF_ATLAS_VCPKG_JSON) + +string(REGEX MATCH "\"version\"[ \t\n\r]*:[ \t\n\r]*\"[^\"]*\"" MSDF_ATLAS_TMP_VERSION_PAIR ${MSDF_ATLAS_VCPKG_JSON}) +string(REGEX REPLACE "\"version\"[ \t\n\r]*:[ \t\n\r]*\"([^\"]*)\"" "\\1" MSDF_ATLAS_VERSION ${MSDF_ATLAS_TMP_VERSION_PAIR}) +string(REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\1" MSDF_ATLAS_VERSION_MAJOR ${MSDF_ATLAS_VERSION}) +string(REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\2" MSDF_ATLAS_VERSION_MINOR ${MSDF_ATLAS_VERSION}) +string(REGEX REPLACE "^([0-9]*)\\.([0-9]*)\\.([0-9]*)" "\\3" MSDF_ATLAS_VERSION_REVISION ${MSDF_ATLAS_VERSION}) +string(LENGTH ${MSDF_ATLAS_VERSION} MSDF_ATLAS_VERSION_LENGTH) +string(REPEAT "-" ${MSDF_ATLAS_VERSION_LENGTH} MSDF_ATLAS_VERSION_UNDERLINE) +string(TIMESTAMP MSDF_ATLAS_COPYRIGHT_YEAR "%Y") + +unset(MSDF_ATLAS_TMP_VERSION_PAIR) +unset(MSDF_ATLAS_VERSION_LENGTH) +unset(MSDF_ATLAS_VCPKG_JSON) diff --git a/msdf-atlas-gen.aps b/msdf-atlas-gen.aps deleted file mode 100644 index 154da62..0000000 Binary files a/msdf-atlas-gen.aps and /dev/null differ diff --git a/msdf-atlas-gen.rc b/msdf-atlas-gen.rc index 49499c6..e43820b 100644 Binary files a/msdf-atlas-gen.rc and b/msdf-atlas-gen.rc differ diff --git a/msdf-atlas-gen.sln b/msdf-atlas-gen.sln deleted file mode 100644 index 2df3123..0000000 --- a/msdf-atlas-gen.sln +++ /dev/null @@ -1,61 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msdfgen", "msdfgen\msdfgen.vcxproj", "{84BE2D91-F071-4151-BE12-61460464C494}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "msdf-atlas-gen", "msdf-atlas-gen.vcxproj", "{223EDB94-5B35-45F2-A584-273DE6E45F6F}" - ProjectSection(ProjectDependencies) = postProject - {84BE2D91-F071-4151-BE12-61460464C494} = {84BE2D91-F071-4151-BE12-61460464C494} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Library|x64 = Debug Library|x64 - Debug Library|x86 = Debug Library|x86 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release Library|x64 = Release Library|x64 - Release Library|x86 = Release Library|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {84BE2D91-F071-4151-BE12-61460464C494}.Debug Library|x64.ActiveCfg = Debug Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug Library|x64.Build.0 = Debug Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug Library|x86.ActiveCfg = Debug Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug Library|x86.Build.0 = Debug Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug|x64.ActiveCfg = Debug Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug|x64.Build.0 = Debug Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug|x86.ActiveCfg = Debug Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Debug|x86.Build.0 = Debug Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Release Library|x64.ActiveCfg = Release Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Release Library|x64.Build.0 = Release Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Release Library|x86.ActiveCfg = Release Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Release Library|x86.Build.0 = Release Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Release|x64.ActiveCfg = Release Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Release|x64.Build.0 = Release Library|x64 - {84BE2D91-F071-4151-BE12-61460464C494}.Release|x86.ActiveCfg = Release Library|Win32 - {84BE2D91-F071-4151-BE12-61460464C494}.Release|x86.Build.0 = Release Library|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug Library|x64.ActiveCfg = Debug Library|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug Library|x64.Build.0 = Debug Library|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug Library|x86.ActiveCfg = Debug Library|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug Library|x86.Build.0 = Debug Library|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug|x64.ActiveCfg = Debug|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug|x64.Build.0 = Debug|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug|x86.ActiveCfg = Debug|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Debug|x86.Build.0 = Debug|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release Library|x64.ActiveCfg = Release Library|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release Library|x64.Build.0 = Release Library|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release Library|x86.ActiveCfg = Release Library|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release Library|x86.Build.0 = Release Library|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release|x64.ActiveCfg = Release|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release|x64.Build.0 = Release|x64 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release|x86.ActiveCfg = Release|Win32 - {223EDB94-5B35-45F2-A584-273DE6E45F6F}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/msdf-atlas-gen.vcxproj b/msdf-atlas-gen.vcxproj deleted file mode 100644 index 4764001..0000000 --- a/msdf-atlas-gen.vcxproj +++ /dev/null @@ -1,374 +0,0 @@ - - - - - Debug Library - Win32 - - - Debug Library - x64 - - - Debug - Win32 - - - Release Library - Win32 - - - Release Library - x64 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {223EDB94-5B35-45F2-A584-273DE6E45F6F} - msdfatlasgen - 8.1 - - - - Application - true - v140 - MultiByte - - - StaticLibrary - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - StaticLibrary - false - v140 - true - MultiByte - - - Application - true - v140 - MultiByte - - - StaticLibrary - true - v140 - MultiByte - - - Application - false - v140 - true - MultiByte - - - StaticLibrary - false - v140 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - msdf-atlas-gen - $(Configuration)\ - - - msdf-atlas-gen - $(Configuration)\ - - - msdf-atlas-gen - bin\ - - - msdf-atlas-gen - bin\ - - - msdf-atlas-gen - $(Platform)\$(Configuration)\ - - - msdf-atlas-gen - $(Platform)\$(Configuration)\ - - - msdf-atlas-gen - $(Platform)\$(Configuration)\ - - - msdf-atlas-gen - $(Platform)\$(Configuration)\ - - - - Level3 - Disabled - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreadedDebug - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;MSDF_ATLAS_STANDALONE;%(PreprocessorDefinitions) - - - Console - freetype.lib;skia.lib;msdfgen.lib;%(AdditionalDependencies) - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\$(Configuration);msdfgen\$(Configuration) Library;%(AdditionalLibraryDirectories) - - - - - Level3 - Disabled - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreadedDebug - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;%(PreprocessorDefinitions) - - - Console - freetype.lib;msdfgen.lib;%(AdditionalDependencies) - ..\msdfgen\freetype\win32;$(SolutionDir)$(Configuration) Library;%(AdditionalLibraryDirectories) - - - MachineX86 - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\debug;msdfgen\$(Configuration);%(AdditionalLibraryDirectories) - - - - - Level3 - Disabled - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreadedDebug - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;MSDF_ATLAS_STANDALONE;%(PreprocessorDefinitions) - - - Console - freetype.lib;skia.lib;msdfgen.lib;%(AdditionalDependencies) - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\$(Configuration);msdfgen\$(Platform)\$(Configuration) Library;%(AdditionalLibraryDirectories) - - - - - Level3 - Disabled - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreadedDebug - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;%(PreprocessorDefinitions) - - - Console - freetype.lib;msdfgen.lib;%(AdditionalDependencies) - ..\msdfgen\freetype\win64;$(SolutionDir)$(Platform)\$(Configuration) Library;%(AdditionalLibraryDirectories) - - - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\debug;msdfgen\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - - - - - Level3 - MaxSpeed - true - true - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreaded - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;MSDF_ATLAS_STANDALONE;%(PreprocessorDefinitions) - None - - - true - true - Console - freetype.lib;skia.lib;msdfgen.lib;%(AdditionalDependencies) - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\$(Configuration);msdfgen\bin;%(AdditionalLibraryDirectories) - false - - - - - Level3 - MaxSpeed - true - true - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreaded - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;%(PreprocessorDefinitions) - - - true - true - Console - freetype.lib;msdfgen.lib;%(AdditionalDependencies) - ..\msdfgen\freetype\win32;$(SolutionDir)bin;%(AdditionalLibraryDirectories) - - - MachineX86 - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\release;msdfgen\$(Configuration);%(AdditionalLibraryDirectories) - - - - - Level3 - MaxSpeed - true - true - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreaded - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;MSDF_ATLAS_STANDALONE;%(PreprocessorDefinitions) - None - - - true - true - Console - freetype.lib;skia.lib;msdfgen.lib;%(AdditionalDependencies) - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\$(Configuration);msdfgen\$(Platform)\$(Configuration) Library;%(AdditionalLibraryDirectories) - false - - - - - Level3 - MaxSpeed - true - true - true - msdfgen\include;msdfgen\freetype\include;msdfgen;artery-font-format;%(AdditionalIncludeDirectories) - MultiThreaded - _CRT_SECURE_NO_WARNINGS;MSDFGEN_USE_CPP11;MSDFGEN_USE_SKIA;%(PreprocessorDefinitions) - - - true - true - Console - freetype.lib;msdfgen.lib;%(AdditionalDependencies) - ..\msdfgen\freetype\win64;$(SolutionDir)$(Platform)\$(Configuration) Library;%(AdditionalLibraryDirectories) - - - msdfgen\freetype\win$(PlatformArchitecture);msdfgen\skia\win$(PlatformArchitecture)\release;msdfgen\$(Platform)\$(Configuration);%(AdditionalLibraryDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/msdf-atlas-gen.vcxproj.filters b/msdf-atlas-gen.vcxproj.filters deleted file mode 100644 index dda43f0..0000000 --- a/msdf-atlas-gen.vcxproj.filters +++ /dev/null @@ -1,184 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {ee785f45-c1cf-48ae-b864-f27237b077c1} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Template Source Files - - - Header Files - - - Header Files - - - Header Files - - - Template Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Template Source Files - - - Header Files - - - Template Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Template Source Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/msdf-atlas-gen/Charset.h b/msdf-atlas-gen/Charset.h index d0cc719..185f265 100644 --- a/msdf-atlas-gen/Charset.h +++ b/msdf-atlas-gen/Charset.h @@ -12,7 +12,7 @@ class Charset { public: /// The set of the 95 printable ASCII characters - static const Charset ASCII; + static MSDF_ATLAS_PUBLIC const Charset ASCII; /// Adds a codepoint void add(unicode_t cp); diff --git a/msdf-atlas-gen/artery-font-export.cpp b/msdf-atlas-gen/artery-font-export.cpp index e7d96b5..bd1ca82 100644 --- a/msdf-atlas-gen/artery-font-export.cpp +++ b/msdf-atlas-gen/artery-font-export.cpp @@ -58,11 +58,12 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B artery_font::StdArteryFont arfont = { }; arfont.metadataFormat = artery_font::METADATA_NONE; + arfont.variants = artery_font::StdList::Variant>(fontCount); for (int i = 0; i < fontCount; ++i) { const FontGeometry &font = fonts[i]; GlyphIdentifierType identifierType = font.getPreferredIdentifierType(); const msdfgen::FontMetrics &fontMetrics = font.getMetrics(); - artery_font::StdFontVariant fontVariant = { }; + typename artery_font::StdArteryFont::Variant &fontVariant = arfont.variants[i] = typename artery_font::StdArteryFont::Variant(); fontVariant.codepointType = convertCodepointType(identifierType); fontVariant.imageType = convertImageType(properties.imageType); fontVariant.metrics.fontSize = REAL(properties.fontSize*fontMetrics.emSize); @@ -76,7 +77,7 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B fontVariant.metrics.underlineThickness = REAL(fontMetrics.underlineThickness); const char *name = font.getName(); if (name) - fontVariant.name.string = name; + (std::string &) fontVariant.name = name; fontVariant.glyphs = artery_font::StdList >(font.getGlyphs().size()); int j = 0; for (const GlyphGeometry &glyphGeom : font.getGlyphs()) { @@ -104,7 +105,7 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B kernPair.codepoint1 = elem.first.first; kernPair.codepoint2 = elem.first.second; kernPair.advance.h = REAL(elem.second); - fontVariant.kernPairs.vector.push_back((artery_font::KernPair &&) kernPair); + ((std::vector > &) fontVariant.kernPairs).push_back((artery_font::KernPair &&) kernPair); } break; case GlyphIdentifierType::UNICODE_CODEPOINT: @@ -116,16 +117,16 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B kernPair.codepoint1 = glyph1->getCodepoint(); kernPair.codepoint2 = glyph2->getCodepoint(); kernPair.advance.h = REAL(elem.second); - fontVariant.kernPairs.vector.push_back((artery_font::KernPair &&) kernPair); + ((std::vector > &) fontVariant.kernPairs).push_back((artery_font::KernPair &&) kernPair); } } break; } - arfont.variants.vector.push_back((artery_font::StdFontVariant &&) fontVariant); } + arfont.images = artery_font::StdList::Image>(1); { - artery_font::StdImage image = { }; + typename artery_font::StdArteryFont::Image &image = arfont.images[0] = typename artery_font::StdArteryFont::Image(); image.width = atlas.width; image.height = atlas.height; image.channels = N; @@ -134,13 +135,13 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B case ImageFormat::PNG: image.encoding = artery_font::IMAGE_PNG; image.pixelFormat = artery_font::PIXEL_UNSIGNED8; - if (!encodePng(image.data.vector, atlas)) + if (!encodePng((std::vector &) image.data, atlas)) return false; break; case ImageFormat::TIFF: image.encoding = artery_font::IMAGE_TIFF; image.pixelFormat = artery_font::PIXEL_FLOAT32; - if (!encodeTiff(image.data.vector, atlas)) + if (!encodeTiff((std::vector &) image.data, atlas)) return false; break; case ImageFormat::BINARY: @@ -174,7 +175,6 @@ bool exportArteryFont(const FontGeometry *fonts, int fontCount, const msdfgen::B default: return false; } - arfont.images.vector.push_back((artery_font::StdImage &&) image); } return artery_font::writeFile(arfont, filename); diff --git a/msdf-atlas-gen/image-encode.cpp b/msdf-atlas-gen/image-encode.cpp index b34fc5a..948a7be 100644 --- a/msdf-atlas-gen/image-encode.cpp +++ b/msdf-atlas-gen/image-encode.cpp @@ -1,6 +1,98 @@ #include "image-encode.h" +#include + +#ifdef MSDFGEN_USE_LIBPNG + +#include + +namespace msdf_atlas { + +class PngGuard { + png_structp png; + png_infop info; + +public: + inline PngGuard(png_structp png, png_infop info) : png(png), info(info) { } + inline ~PngGuard() { + png_destroy_write_struct(&png, &info); + } + +}; + +static void pngIgnoreError(png_structp, png_const_charp) { } + +static void pngWrite(png_structp png, png_bytep data, png_size_t length) { + std::vector &output = *reinterpret_cast *>(png_get_io_ptr(png)); + output.insert(output.end(), data, data+length); +} + +static void pngFlush(png_structp) { } + +static bool pngEncode(std::vector &output, const byte *pixels, int width, int height, int channels, int colorType) { + if (!(pixels && width && height)) + return false; + png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, &pngIgnoreError, &pngIgnoreError); + if (!png) + return false; + png_infop info = png_create_info_struct(png); + PngGuard guard(png, info); + if (!info) + return false; + std::vector rows(height); + for (int y = 0; y < height; ++y) + rows[y] = pixels+channels*width*(height-y-1); + if (setjmp(png_jmpbuf(png))) + return false; + png_set_write_fn(png, &output, &pngWrite, &pngFlush); + png_set_IHDR(png, info, width, height, 8, colorType, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + png_set_compression_level(png, 9); + png_set_rows(png, info, const_cast(&rows[0])); + png_write_png(png, info, PNG_TRANSFORM_IDENTITY, NULL); + return true; +} + +static bool pngEncode(std::vector &output, const float *pixels, int width, int height, int channels, int colorType) { + if (!(pixels && width && height)) + return false; + int subpixels = channels*width*height; + std::vector bytePixels(subpixels); + for (int i = 0; i < subpixels; ++i) + bytePixels[i] = msdfgen::pixelFloatToByte(pixels[i]); + return pngEncode(output, bytePixels.data(), width, height, channels, colorType); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 1, PNG_COLOR_TYPE_GRAY); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 3, PNG_COLOR_TYPE_RGB); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 4, PNG_COLOR_TYPE_RGB_ALPHA); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 1, PNG_COLOR_TYPE_GRAY); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 3, PNG_COLOR_TYPE_RGB); +} + +bool encodePng(std::vector &output, const msdfgen::BitmapConstRef &bitmap) { + return pngEncode(output, bitmap.pixels, bitmap.width, bitmap.height, 4, PNG_COLOR_TYPE_RGB_ALPHA); +} + +} + +#endif + +#ifdef MSDFGEN_USE_LODEPNG + #include namespace msdf_atlas { @@ -61,3 +153,5 @@ bool encodePng(std::vector &output, const msdfgen::BitmapConstRef diff --git a/msdf-atlas-gen/msdf-atlas-gen.h b/msdf-atlas-gen/msdf-atlas-gen.h index cf24d54..e833a43 100644 --- a/msdf-atlas-gen/msdf-atlas-gen.h +++ b/msdf-atlas-gen/msdf-atlas-gen.h @@ -2,12 +2,10 @@ #pragma once /* - * MULTI-CHANNEL SIGNED DISTANCE FIELD ATLAS GENERATOR v1.2 (2021-05-29) - * --------------------------------------------------------------------- - * A utility by Viktor Chlumsky, (c) 2020 - 2021 - * - * Generates compact bitmap font atlases using MSDFGEN. - * + * MULTI-CHANNEL SIGNED DISTANCE FIELD ATLAS GENERATOR + * --------------------------------------------------- + * A utility by Viktor Chlumsky, (c) 2020 - 2023 + * Generates compact bitmap font atlases using MSDFgen */ #include @@ -38,5 +36,3 @@ #include "csv-export.h" #include "json-export.h" #include "shadron-preview-generator.h" - -#define MSDF_ATLAS_VERSION "1.2" diff --git a/msdfgen b/msdfgen index 4e8ff23..a811ef8 160000 --- a/msdfgen +++ b/msdfgen @@ -1 +1 @@ -Subproject commit 4e8ff2321ea9696801675c908a4822c4d8e71eb8 +Subproject commit a811ef8935354d3f6d767cff6c4eebeb683777f2 diff --git a/resource.h b/resource.h index d0ca059..2b80865 100644 Binary files a/resource.h and b/resource.h differ diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..81fd080 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json", + "name": "msdf-atlas-gen", + "version": "1.3.0", + "description": "Multi-channel signed distance field atlas generator", + "homepage": "https://github.com/Chlumsky/msdf-atlas-gen", + "license": "MIT", + "dependencies": [ + "freetype", + "tinyxml2", + "libpng" + ], + "default-features": [ + "geometry-preprocessing" + ], + "features": { + "geometry-preprocessing": { + "description": "Preprocessing of non-compliant vector geometry via the Skia library", + "dependencies": [ { + "name": "skia", + "default-features": false + } ] + } + } +}