Microsoft Visual TrueType(VTT) command line compile tool.

Related tags

CLI VisualTrueType
Overview

Project

Microsoft Visual TrueType(VTT) is a professional-level tool for graphically instructing TrueType and OpenType fonts. For details on the tool visit https://docs.microsoft.com/en-us/typography/tools/vtt/.

Visual TrueType compiles binary from source formats included in the fonts that are instructed with Visual TrueType.

This repo contains source for VTTCompile which is a standalone tool can compile the high level VTT Talk source to a lower level assembler source and then can assemble that source to cooresponding binaries. Since VTT can also generate variation 'cvar' for variable fonts, VTTCompile can also compile the 'cvar' from source format. VTTCompile also includes file management functions to prepare a font for production and to strip source formats for a final 'ship' font binary.

The interface for VTTCompile is similar to VTTShell which is included in Visual TrueType download package.

The source code in the repo is mostly a subset of the source code of Visual TrueType as needed to produce VTTCompile. However not all of the source code included in the repo is necessary to produce VTTCompile but we optomized for including as complete source files as possible to make future maintenance easier.

For documentation of the Visual TrueType source formats visit https://docs.microsoft.com/en-us/typography/tools/vtt/tsi-tables.

Building

In the "vttcompile" folder, there is a Visual Studio Solution for Microsoft Visual Studio users, and an Xcode Project For Apple Xcode users.

For unix users (including Linux and Apple command-line), cd src && make should work. You can also cross-compile for 32-bit windows with cd src && make CXX=i686-w64-mingw32-c++, for 64-bit windows with cd src && make CXX=x86_64-w64-mingw32-c++; and use clang, enabling all the recommended warnings with cd src && make CXX=clang++ CXXFLAGS=-Wall. Build as 32-bit on 64-bit systems with cd src && make CXXFLAGS=-m32. You may need to do cd src && make CXXFLAGS="-std=c++14" to explicitly request support for the 2014 ISO C++ standard.

The minimum compiler requirement is support for the 2014 ISO C++ standard plus amendments.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Issues
  • linux port now on my opencompiler-port branch (the default)

    linux port now on my opencompiler-port branch (the default)

    It probably would work with mac too. native compile just do "cd src; make". For cross-compiling for windows, make CXX=i686-w64-mingw32-c++ (32-bit) or make CXX=x86_64-w64-mingw32-c++ (64-bit).

    https://github.com/HinTak/VisualTrueType

    opened by HinTak 25
  • vttcompile can't find maxp table

    vttcompile can't find maxp table

    Trying to run vttcompile -a in.ttf out.ttf where in.tff is in.zip (compiled from https://github.com/daltonmaag/ubuntu/). It seems to fail getting at the maxp table. I'm looking at https://github.com/microsoft/VisualTrueType/blob/7559fcb2d7d560cae62c195d13e5c92d4f7afabc/src/TTFont.cpp#L1929 which passes in a tag of 1835104368 (maxp) and gets back a zero.

    Compiled commit 7559fcb2d7d560cae62c195d13e5c92d4f7afabc on Fedora 34 x86_64, gcc version 11.2.1 20210728 (Red Hat 11.2.1-1)

    opened by madig 14
  • ./vttcompile -a fails on the vttdemo.ttf on linux

    ./vttcompile -a fails on the vttdemo.ttf on linux

    Just trying vttcompile on the vttdemo.tff shipped with VTT. -s -b and -c completes with success, but -a fails with:

    $ ./vttcompile -a ../Sample/vttdemo.ttf /tmp/t.ttf
    
    Microsoft Visual TrueType Command Line Interface Version 6.35 
    Copyright (C) Microsoft Corporation. Licensed under the MIT License.
    ....................
    ...............
    Glyf Pgm, glyph 341 (Unicode 0xb8), line 10: NN
    
    Can not complete compile operation! 
    

    This is after #17 and fixing #19 . Given #19 (it was surprising to see vttcompile failing on the shipped ttf with the maxp error, and that turns out to be a genuine bug), I'd assume the vtt shipped vttdemo.ttf should be valid and can be used as input to vttcompile for all operations. If it isn't, it should - that's still a bug, but a bug in the font, so the issue should still be reported.

    opened by HinTak 8
  • Add Markdown formatted docx documents

    Add Markdown formatted docx documents

    This PR adds Markdown formatted documentation for the current docx content. This was a pandoc conversion to GFM with Markdown / HTML manual edits for consistent code blocks across the docx and md documents. There were no content edits.

    opened by chrissimpkins 7
  • Fixes for misc bugs and warnings

    Fixes for misc bugs and warnings

    Mostly these are fixes for compiler warnings; the changes in getopt.h looks large, but actually just for correcting misleading indentations.

    There is a bug fix for error reporting on failing to open files - the code keeps a reason, in the GUI probably would be caused a pop-up, but the command-line tool just throws it away; this is now corrected, and failure-to-open reasons are printed on the console.

    This is the final part of the open compiler changes, I think.

    opened by HinTak 5
  • different outcomes between vttcompile and vttshell, on vttdemo.ttf

    different outcomes between vttcompile and vttshell, on vttdemo.ttf

    -g0 -r100:

    @@ -471,7 +471,7 @@
       </OS_2>
     
       <hmtx>
    -    <mtx name=".notdef" width="1322" lsb="0"/>
    +    <mtx name=".notdef" width="197" lsb="0"/>
         <mtx name="A" width="1321" lsb="24"/>
         <mtx name="AE" width="1762" lsb="24"/>
         <mtx name="Aacute" width="1321" lsb="24"/>
    @@ -747,7 +747,7 @@
         <mtx name="seven" width="1104" lsb="98"/>
         <mtx name="six" width="1104" lsb="111"/>
         <mtx name="slash" width="798" lsb="1"/>
    -    <mtx name="space" width="561" lsb="0"/>
    +    <mtx name="space" width="197" lsb="0"/>
         <mtx name="sterling" width="1104" lsb="120"/>
         <mtx name="t" width="694" lsb="43"/>
         <mtx name="tbar" width="694" lsb="43"/>
    

    -g200 -r300:

    @@ -767,7 +767,7 @@
         <mtx name="uhungarumlaut" width="1159" lsb="144"/>
         <mtx name="umacron" width="1159" lsb="144"/>
         <mtx name="underscore" width="850" lsb="50"/>
    -    <mtx name="uni000D" width="199" lsb="0"/>
    +    <mtx name="uni000D" width="156" lsb="0"/>
         <mtx name="uni00AD" width="819" lsb="144"/>
         <mtx name="uni00B2" width="995" lsb="0"/>
         <mtx name="uni00B3" width="995" lsb="0"/>
    

    -b, -c, -s, and also no arguments:

    @@ -471,7 +471,7 @@
       </OS_2>
     
       <hmtx>
    -    <mtx name=".notdef" width="1322" lsb="0"/>
    +    <mtx name=".notdef" width="197" lsb="0"/>
         <mtx name="A" width="1321" lsb="24"/>
         <mtx name="AE" width="1762" lsb="24"/>
         <mtx name="Aacute" width="1321" lsb="24"/>
    

    So the summary is that -a gives identical results (other than checksums and dates), most other switches (including no passing any) disgrees by the width of .notdef, and with -g... -r..., not only .notdef, but also space and uni000D (carriage return). @paullinnerud : this looks like another issue along the line of "rasterizer removal"?

    opened by HinTak 4
  • Fix three bugs found in issue 20

    Fix three bugs found in issue 20

    The test case in issue 20 uncovers 3 problems:

    • Microsoft compiler treats %s passed to wprintf(), different from everybody else. So we need to special-case Microsoft compiler with one wide-string-format specifier, and everybody else with a different one. (and vice versa for narrow string - but there is only one case, in main()).

    • After fixing the truncation, I found a missing null termination problem with the previous work-around for unix systems lacking a wctime() function (and need to call ctime() then convert from narrow to wide).

    • and a similar problem with earlier long to int32_t, needs to replace a lot of %li by %i to not implicit convert to 64-bit long.

    I only replaced %li in TTEngine.cpp ; the other seems to affect user messages (if error) and not critical.

    opened by HinTak 4
  • Can‘t install with PIP on M1 MacBook

    Can‘t install with PIP on M1 MacBook

    Hi! It seems that installation process fails when I try to install on my Macbook M1 MacOs Monterrey.

    DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
    Requirement already satisfied: pip in /opt/homebrew/lib/python3.9/site-packages (22.1.2)
    Requirement already satisfied: install in /opt/homebrew/lib/python3.9/site-packages (1.3.5)
    Collecting vttcompilepy
      Using cached vttcompilepy-0.0.1.4.zip (217 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      error: subprocess-exited-with-error
    
      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> [16 lines of output]
          Traceback (most recent call last):
            File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
              main()
            File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
            File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
              return hook(config_settings)
            File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
              return self._get_build_requires(
            File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
              self.run_setup()
            File "/opt/homebrew/Cellar/[email protected]/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup
              exec(compile(code, __file__, 'exec'), locals())
            File "setup.py", line 12, in <module>
              with open(os.path.join(here, 'pypi.md'), encoding='utf-8') as f:
          FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/b_/wzl4jsl97mz4mvk2bj0363x40000gn/T/pip-install-94e_fpdi/vttcompilepy_e11fbc250c4245a481ad1e46771024ab/pypi.md'
          [end of output]
    
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    
    [notice] A new release of pip available: 22.1.2 -> 22.2.1
    [notice] To update, run: python3.9 -m pip install --upgrade pip
    
    opened by guidoferreyra 3
  • illegal → invalid

    illegal → invalid

    A minor thing that always bothers me in software mostly coming from the US: It's the constant mis-use of 'illegal' where it should be 'invalid' instead.

    I thus ask that you do such a replacement :-)

    opened by lemzwerg 3
  • include test files and tests in the bundle.

    include test files and tests in the bundle.

    I have included all the non-executable files (the release notes, the chm files also, plus the sample ttf and templates) in my opencompiler-port, but it would be better if Microsoft staff do it officially.

    Found one bug while testing; the fix is in the pull.

    opened by HinTak 3
  • Changes

    Changes "illegal" to "invalid", "legal" to "valid", and preserving ca…

    …se-variants

    Done with: sed -i -e 's/Illegal/Invalid/g' *.cpp *.h sed -i -e 's/illegal/invalid/g' *.cpp *.h sed -i -e 's/ILLEGAL/INVALID/g' *.cpp *.h sed -i -e 's/legal/valid/g' .cpp .h sed -i -e 's/Illegal/Invalid/g' doc//.html

    Fixes https://github.com/microsoft/VisualTrueType/issues/24

    opened by HinTak 2
  • Test infrastructure needed

    Test infrastructure needed

    Build a Python test infrastructure to test built VTTCompile output against known good state.

    Include open sourced Selawik font and use fonttools TTX to dump relevant tables then use built VTTCompile to rebuild all and dump relevant tables to compare with original.

    enhancement 
    opened by paullinnerud 1
Releases(v0.0.5)
  • v0.0.5(Jul 30, 2022)

    What's Changed

    • Sync TSIC with fvar changes by @paullinnerud in https://github.com/microsoft/VisualTrueType/pull/35

    Full Changelog: https://github.com/microsoft/VisualTrueType/compare/v0.0.4...v0.0.5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Jun 10, 2022)

  • v0.0.3(Jun 1, 2022)

    What's Changed

    • Compile options to diable variation composite guard and enable legacy… by @paullinnerud in https://github.com/microsoft/VisualTrueType/pull/31

    Full Changelog: https://github.com/microsoft/VisualTrueType/compare/v0.0.2...v0.0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(Jan 6, 2022)

    What's Changed

    • Update usage documentation with new binary path vttcompile by @chrissimpkins in https://github.com/microsoft/VisualTrueType/pull/7
    • Case sensitivity by @HinTak in https://github.com/microsoft/VisualTrueType/pull/10
    • Use mixed-case "Memory.h" by @HinTak in https://github.com/microsoft/VisualTrueType/pull/13
    • Add VTT Language Reference by @jenskutilek in https://github.com/microsoft/VisualTrueType/pull/12
    • Remove dead code by @simoncozens in https://github.com/microsoft/VisualTrueType/pull/14
    • Support for opencompilers by @HinTak in https://github.com/microsoft/VisualTrueType/pull/15
    • Fixes for misc bugs and warnings by @HinTak in https://github.com/microsoft/VisualTrueType/pull/17
    • Fix three bugs found in issue 20 by @HinTak in https://github.com/microsoft/VisualTrueType/pull/22
    • Fix composite glyph hmtx metrics bug introduced in rasterizer removal. by @paullinnerud in https://github.com/microsoft/VisualTrueType/pull/21
    • Changes "illegal" to "invalid", "legal" to "valid", and preserving ca… by @HinTak in https://github.com/microsoft/VisualTrueType/pull/25
    • Additional documentation by @paullinnerud in https://github.com/microsoft/VisualTrueType/pull/26
    • Add res hinting implementation guide by @robmck-ms in https://github.com/microsoft/VisualTrueType/pull/27
    • Add Markdown formatted docx documents by @chrissimpkins in https://github.com/microsoft/VisualTrueType/pull/28
    • Python extension interface by @paullinnerud in https://github.com/microsoft/VisualTrueType/pull/29

    New Contributors

    • @chrissimpkins made their first contribution in https://github.com/microsoft/VisualTrueType/pull/7
    • @HinTak made their first contribution in https://github.com/microsoft/VisualTrueType/pull/10
    • @jenskutilek made their first contribution in https://github.com/microsoft/VisualTrueType/pull/12
    • @simoncozens made their first contribution in https://github.com/microsoft/VisualTrueType/pull/14
    • @paullinnerud made their first contribution in https://github.com/microsoft/VisualTrueType/pull/21
    • @robmck-ms made their first contribution in https://github.com/microsoft/VisualTrueType/pull/27

    Full Changelog: https://github.com/microsoft/VisualTrueType/commits/v0.0.2

    Source code(tar.gz)
    Source code(zip)
    release_binary.zip(187.06 KB)
Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material.

pbr2gltf2 is a command line tool for converting PBR images to a glTF 2.0 material. The tool is detecting depending on the filename, which PBR information is stored. It swizzles the images and does reassign the channels to a glTF 2.0 image. The tool stores the images plus a minimal, valid glTF 2.0 file containing the required material, textures and images.

UX3D GmbH 23 Jul 31, 2022
A command-line tool to display colorful distro information.

sjfetch A command-line tool to display colorful distro information.

Fikret Musk 6 Apr 6, 2022
Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

Simple command line tool that processes image files using the FidelityFX Super Resolution (FSR) or Contrast Adaptive Sharpening (CAS) shader systems.

GPUOpen Effects 176 Jul 29, 2022
A command line tool with no external dependencies to print information about an X server instance.

xinfo A command line tool with no external dependencies to print information about an X server instance. Building and running To build the code in thi

Jean-Michel Gorius 6 Jan 13, 2022
A command line tool for numerically computing Out-of-time-ordered correlations for N=4 supersymmetric Yang-Mills theory and Beta deformed N=4 SYM.

A command line tool to compute OTOC for N=4 supersymmetric Yang–Mills theory This is a command line tool to numerically compute Out-of-time-ordered co

Gaoli Chen 1 Oct 16, 2021
A command-line tool to extract dylib files from the dyld shared cache file.

DyldExtractor A command-line tool to extract dylib files from the dyld shared cache file. Starting with macOS 11, standalone binaries of system librar

Cyandev 8 Mar 12, 2022
A command-line tool to generate Linux manual pages from C source code.

mangen A command-line tool to generate Linux manual pages from C source code. Description mangen is, as said above, a program to generate Linux manual

null 2 Nov 15, 2021
brn is a command line tool similar to vimv.

brn is a command line tool similar to vimv. It can be used to easily mass-rename files in your preferred text editor (i.e. vim).

Nimai Patel 11 Jul 29, 2022
This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied.

stereodemux This command-line tool converts an FM broadcast signal into stereo sound with de-emphasis applied. It expects 16-bit signed-integer MPX (F

Oona Räisänen 10 Aug 7, 2022
nicegraf-shaderc is a command-line tool that transforms HLSL code into shaders for various graphics APIs.

User Manual Table of Contents Introduction Project Status Obtaining the Source Code and Building Running Defining Techniques Generated Header File Pip

nicebyte 90 Jul 28, 2022
A simple to use, composable, command line parser for C++ 11 and beyond

Clara v1.1.5 !! This repository is unmaintained. Go here for a fork that is somewhat maintained. !! A simple to use, composable, command line parser f

Catch Org 652 Jul 27, 2022
A library for interactive command line interfaces in modern C++

cli A cross-platform header only C++14 library for interactive command line interfaces (Cisco style) Features Header only Cross-platform (linux and wi

Daniele Pallastrelli 826 Aug 3, 2022
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.

CLI11: Command line parser for C++11 What's new • Documentation • API Reference CLI11 is a command line parser for C++11 and beyond that provides a ri

null 2.2k Aug 15, 2022
Lightweight C++ command line option parser

Release versions Note that master is generally a work in progress, and you probably want to use a tagged release version. Version 3 breaking changes I

null 3.2k Aug 8, 2022
A simple to use, composable, command line parser for C++ 11 and beyond

Lyra A simple to use, composing, header only, command line arguments parser for C++ 11 and beyond. Obtain License Standards Stats Tests License Distri

Build Frameworks Group 350 Aug 4, 2022
A single header C++ library for parsing command line arguments and options with minimal amount of code

Quick Arg Parser Tired of unwieldy tools like getopt or argp? Quick Arg Parser is a single header C++ library for parsing command line arguments

null 46 Aug 10, 2022
CLIp is a clipboard emulator for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.

CLIp v2 About CLIp is a powerful yet easy to use and minimal clipboard manager for a command line environment, with no dependencies or bloat. Usage Sy

A.P. Jo. 12 Sep 18, 2021
null 76 Apr 18, 2022
LwSHELL is lightweight, platform independent, command line shell for embedded systems.

LwSHELL is lightweight, platform independent, command line shell for embedded systems. It targets communication with embedded systems from remote terminal to quickly send commands and the retrieve data from the device.

Tilen Majerle 64 Jul 21, 2022