# Technical Documentation: snowie2000/mactype

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/snowie2000/mactype)

### Overview (`README.md`)

MacType
========================
[日本語](./README_ja-JP.md)

Better font rendering for Windows.

Latest build
------------------

[Download](https://github.com/snowie2000/mactype/releases/latest)

Official site
------------------

MacType official site: 

http://www.mactype.net (An archived version is restored)

What's new?
------------------

- Win11 compatible
- CET compatible
- Updated FreeType
- Support for color fonts :sunglasses:
- New installer
- Lots of bug fixes
- Updates for multi-monitor support
- Tray app can intercept explorer in Service Mode now
- Tweaks for diacritics
- Updates to EasyHook
- Lower CPU in Tray Mode
- Better DirectWrite support thanks to [しらいと](http://silight.hatenablog.jp)
- Separate DirectWrite parameter adjustment
- Traditional Chinese localization greatly improved thanks to GT Wang
- English localization improved
- Added Korea localization, thanks to 조현희
- MultiLang system improved

Donation
------------------

MacType now accepts donations. 

Please visit http://www.mactype.net and keep an eye on the bottom right corner :heart:

Thank you for your support! Your donations will keep the server running, keep me updating, and buy more coffees :coffee:

Known issues
---------------

- Please backup your profiles before upgrading!

- Only Chinese simplified/Traditional and English are fully localized, some options may missing in MacType Tuner due to the strings missing in the language file. You can help with translations!

- If you want to use MacType-patch together with MacType official release, remember to add DirectWrite=0 to your profile or you will have mysterious problems

- If you're running 64 bit Windows, antimalware/antivirus software may conflict with MacType, because it sees MacType trying to modify running software. One possible workaround is to try running in Service Mode (recommended), or add HookChildProcesses=0 to your profile. See https://github.com/snowie2000/mactype/wiki/HookChildProcesses for an explanation

- Office 2013 does not use DirectWrite or GDI (it uses its own custom rendering), so Office 2013 doesn't work with MacType. If this bothers you you can use Office 2010 which uses GDI or Office 2016+ which uses DirectWrite.

- WPS has a built in defense that **UNLOADS** MacType automatically. The latest version has a workaround [here](https://github.com/snowie2000/mactype/wiki/WPS) thanks to wmjordan.

How to get registry mode back
-------------

It is no longer possible to enable registry mode via the wizard in Windows 10. 

We have a detailed guide on how you can enable the registry mode manually in [wiki](https://github.com/snowie2000/mactype/wiki/Enable-registry-mode-manually), get your screwdrivers ready before you head over to it.

How to build
-------------

Check how to build [document](https://github.com/snowie2000/mactype/blob/directwrite/doc/HOWTOBUILD.md)

---

### Doc HOWTOBUILD (`doc/HOWTOBUILD.md`)

# How to build

 1. **Compiler / IDE**

    Visual Studio 2019 with v142 toolkit has been tested and is working. Toolkits down to v120 should be able to compile the code, but be aware that the `_xp` ones might refuse to use the Windows 10 SDK.

 2. **Dependencies**

    Mactype depends on
     - [Freetype](https://www.freetype.org/download.html)
       - For the lastest version of Mactype, a customized version of FreeType is required, which can be obtained from https://github.com/snowie2000/freetype    
     - [EasyHook](http://easyhook.github.io/) / [Detours](https://github.com/microsoft/Detours)
     - [IniParser (fork)](https://github.com/snowie2000/IniParser)
     - [wow64ext (fork)](https://github.com/snowie2000/rewolf-wow64ext)
     - Windows SDK (10.0.14393.0 or later)

 3. **Building dependencies**

    - FreeType

        Apply `glyph_to_bitmapex.diff` before building.

        Always build multi-thread release.

        Remember to enable options you want in ftoptions.h

        Compile freetype as freetype.lib for x86 and freetype64.lib for x64

        Static library is preferred, you are free to build freetype as independent dlls with better interchangeability but you will lose some compatibility in return, for some programs are delivered with their own copies of freetype which will conflict with your file.

        Set `FREETYPE_PATH` environment variable to root of freetype source.

    - iniParser

        Build as iniparser.lib and iniparser64.lib. Set `INI_PARSER_PATH` environment variable to root of IniParser project.

    - wow64ext

        Build as wow64ext.lib. x64 library is not required. Shared library also works if you prefer that.

    - EasyHook

        Only EasyHookDll project is required.

        Build it as easyhook32.lib and easyhook64.lib, or get the binary distributions.

        Dll filename is not important but you'd better give it a special name to avoid dll confliction as stated above. Do not forget to modify filename in `hook.cpp` of MacType.

    - Detours

        Since Microsoft Detours is now free and opensource, it is back to be supported and recommended.

        Follow the official guide to build detours.lib and detours64.lib and put them in the root of MacType.

        Detours lib are static libraries, so name confiction is not a thing.

    - Windows SDK

        Actually it's not something you need to build, but the installation is tricky.

        One word to rule them all: download **ALL COMPONENTS**  in the installation list! Unless you want to waste several hours looking for these mysterious dependencies it pops to you. Don't worry, you will have a second chance to choose which component you want to install after download.

 4. **Build**

    Last but easiest step: Put all `.lib` files you built earlier into a `lib` folder in the root of MacType, click build and enjoy.

## FAQ

Q: Where are the sources of loader and tuner in the repo?

A: I'm sorry, but they are still closed-source right now. Since you have the mactype source and will surely have a good understanding of how mactype works, I believe it's not a big challenge to write a loader for it.
If you wrote a great loader or something else wonderful, please post an issue or a pull request. Hope we can make MacType better!

---

--- METRICS ---
- Files Extracted: 2
- Estimated Token Budget: ~1578 tokens
- Canonical Reference: https://codewiki.google/github.com/snowie2000/mactype
