跳至主要内容

About HQText

Introduction

Header

HQText is a Unity plugin developed in response to the growing need for accurate and comprehensive language support, including precise placement of diacritics, ligatures, and the proper handling of mixed bi-directional text elements. Although our primary focus has been on providing correct support for Arabic text within Unity, HQText is designed to accommodate most other languages just as effectively.

To achieve this, HQText employs a user-friendly and intuitive wrapper for Pango, an open-source library for laying out and rendering text. By default, HQText utilizes FreeType for font rendering, but it can also be configured to work with the native Windows (win32) backend.

While TextMeshPro is another option for supporting Arabic, it often experiences issues with diacritic placement, which can vary between fonts, and transparency artifacts arising from overlapping character ligatures. For those who find these problems unacceptable, HQText serves as an ideal alternative.

信息

HQText is optimised for rendering quality and language accuracy over speed.

Getting Started

Just add the HQText UGUI component to your UI hierarchy. That's it!

Features

  • Accurate rendering of complex text
  • Supports TTF and OTF fonts
  • Arabic, Persian/Farsi, Hebrew, Urdu and more
  • Correct rendering of diacritics and ligatures
  • Markup (Rich text) support
  • Supports ALL the render-pipelines: Built-in/URP/HDRP
  • Also works in editor (no need to enter play mode)
  • Supports visual effects via UIFX
  • Includes full C# and C++ source code

Requirements

  • Supports all Unity versions from 2019.4.0 up to Unity 6.x
  • Supports all render pipelines: Built-in, URP and HDRP
  • 64-Bit Windows only (Windows 10 & 11)

Compatibility

Unity Version6.x2023.x2022.x2021.x2020.x2019.x2018.x2017.x
Supported
PlatformWindows 64-BitmacOSLinuxAndroidiOS / tvOSWebGLPS4 / PS5XBox One
SupportedXXXXXXX
Render PipelineBuilt-inURPHDRP
Supported

Trial Version 🚀

The trial version has all the features of the full version and runs without limits, except for a watermark rendered to the text.

Download the FREE TRIAL VERSION

Use Cases

Accurate rendering of complex text

HQText primarily created to render Arabic text in Unity. Arabic text is not well supported due to being right-to-left and requiring extra features such as complex diacritic rendering. HQText solves this problem and supports many languages.

Museums & Digital Signage

HQText is not designed for general games/app and has no mobile support. We built this mainly for generating accurate text in multiple languages for apps running in museums around the world. It can also be useful for large digital signage.

High quality text rendering

Quality

HQText uses an internal text rasterization system that generates high quality text rendering. The text rendering doesn't suffer from the typical blurry text issues typically seen in Unity applications. Whether you're rendering in a very tiny or extremely large font size, HQText will draw perfectly anti-aliased text.

Usage

Markup / Rich Text

TextPreview

By checking the Use Markup property in the HQTextCore component, you will be able to add markup to your text to control how it renders. Example features include:

  • Bold, italic, oblique
  • Font size, font weight
  • Font family
  • Foreground and background color
  • Underline, overline, strikethrough
  • Subscript, superscript
  • Monospace, lowercase, uppercase, camelCase
  • Line height, letter spacing
  • Hyphenation control

Read the full list of markup tags here: Markup Reference.

Custom Fonts

There are two font rendering backends in HQText: FreeType and Win32.

By default HQText uses the FreeType backend for rendering which supports dynamic loading of fonts that aren't registered with the operating system.

To use a new font for this backend, copy the .ttf or .otf files to the Assets/StreamingAssets/HQText directory (create if necessary). Then go to Project Settings > Chocolate Dinosaur > HQText and click the Refresh Fonts button.

If you change the backend to Win32 then HQText will be able to use any font that is already registered with the operating system. In this case care must be taken to make sure the required fonts are installed on the target machines.

Text Preview

If you have the HQText gameobject selected you will be able to see a Text Preview window at the bottom of the Hierarchy window.

This will give you a detailed breakdown of your text and how HQText is building the text output. When you change settings in the components you will see them updated the text here and in the scene view.

TextPreview

UIFX Supports

UIFX

HQText is compatible with the UIFX asset which can be used to apply visual effects to HQText.

License

HQText is built on top of various open-source libraries, including GNU GPL (GNU GENERAL PUBLIC LICENSE) 2.0.

Attribution

HQText was contributed to by: Shane Marks, Kelly McCarter, Denzil Büchner, Ruan Moolman, Calvin Lichungu.

Special thanks to Dr. Mustapha Saidi, for creating the Arabic text references.

This work is made possible by Pango, licensed under LGPL-2.1-or-later. Authors: Owen Taylor, Behdad Esfahbod.