FAQ

What is TEXDraw?

Preview TEXDraw is a Component that makes a plain text can be converted into a graphical representation of mathematical formulas. TEXDraw renders mathematical formulas using the similar approach introduced in LaTeX writing system. The result is in form of a 3D mesh that can be used inside Unity’s UI or other mesh-based rendering systems.

How it does work and why it is different?

TEXDraw, just like many other text generators, is designed to render strings to display screen. TEXDraw however, adds some functionality to render any kind of mathematical expressions that are used in various apps like educational software, scientific simulations, and many more. With the power of Unity’s built-in UI System and dynamic text support, generating math expressions are so easier and seamlessly than ever!

What’s the Benefit of TEXDraw compared than Standard UI Text?

A lot, including:

  • LaTeX syntax, which has more clean typos and flexible features than standard HTML markup
  • Rich math expressions, including fractions, root, matrix, scripts, straight lines, tables, etc.,
  • Resizable delimiters or brackets, which is essential for writing complex math.
  • Dedicated UI layout system (No need external Horizontal/Vertical Layout).
  • +600 symbols included, or add your own symbol sets.
  • +40 distict expressions, including custom text font, size, color, background, borders, etc.
  • Import and use Sprites just like inserting font characters (aka. Inline sprites).
  • First class text features, including word wrap, justify alignment, and best fit mode.
  • Built-in support for rendering into Unity’s UI rendering, MeshFilter, or NGUI.
  • Built-in integration with TextMeshPro SDF Rendering
  • Dedicated editor GUI for customizing TEXDraw in many aspect.
  • Open source, no precompiled library, compatible to all platform.
  • Optimized codebase, work fast on mobiles.
  • Highly extensible extension (supplements), which enables:
  • RTL + Bidirectional input, WYSIWYG input editor, Link highlights, HTML + Markdown parsing, warping + WordArt effects, colour/gradient effects, bind to other UI (eg. inline images), etc.
  • And much other stuff you can think of…

How easily I can make it work on my project?

Soon after you importing TEXDraw into your project, You can create a TEXDraw Object in GameObject -> UI -> TEXDraw, and start to typing on it. Also, don’t forget check out sample scenes in Assets/TEXDraw/Sample/Scenes.

HA()

Will this work on all platform? Any performance issues?

This package has been tested on runtime builds, including mobiles and web build. We always considering performance when we write new features. This asset halts your game performance? Tell us.

Do this package provide support for other External Asset?

Yes, TEXDraw supports drawing text into NGUI environment or using the benefit of SDF Rendering from TextMeshPro. Click here for instruction setup.

Can TEXDraw receive User Input?

Yes, There are two kind of input: TEXLink and TEXInput. Both adds interactivity to TEXDraw. You can see the details by visiting at either link.

I have other trouble. Any suggestion for me?

See troubleshoot page for common problems.

TEXDraw Component

This component is available under Unity’s UI Canvas object. This component has been made simple, so you can keep your focus on what you’ll type into.

Aside from Text, there are other optional properties that are quite useful for handling display output. Below is Description of each property inside this Component:

Text A plain text that you want input to.
  See here for practical guide to write, and here for scripting instruction.
Size Size of generated graphics
  The font texture size will automatically resized based on Canvas configuration.
Font Index Index of used default font (-1 to follow default typeface rules)
  In scripting, you can set this as integer value. Each number represents an index of font that registered in the Font Stack.
Auto Fit How final graphic is scaled when it’s render is out of the rectangle bound
  See here for available options
Auto Wrap Horizontal wrapping mode if a line is beyond rectangle’s horizontal bound
  See here for available options
Alignment The horizontal and vertical alignment of the text.
  In scripting, this is a Vector2 property. A value of {0, 0} represent left-bottom alignment
Color The main color for generated graphics
  Use \color if you want to write specific color
Material Assign a Custom Material for This component
  If none assigned, the default material (from Resource) will be used for rendering
Filling Optional options for manipulating UV2 data
  Used in conjunction with custom Material effects, choose the way when font characters are overlaid with some shader graphics

Other TEXDraw Variants

For any non-UI user or those who don’t want UI Canvas dependency, may use TEXDraw 3D. It’s a great alternative to using this component rather than standard one. You can add TEXDraw 3D to your scene by navigating to GameObject > 3D Object > TEXDraw 3D or attach this to your Game Object located in TEXDraw > TEXDraw 3D. You also can attach RectTransform (yes, it’s still work on outside Canvas) if you prefer.

Alternatively, for those who already use NGUI can use the NGUI variant. This kind of variant doesn’t available without importing the NGUI extension for TEXDraw first. This extension is packed as a .unitypackage file that can be found in TEXDraw root folder. To import it, simply open the package. To add this component to your scene, hit the NGUI menu located in NGUI > Create > TEXDraw

Those three variants have the similar functionality and properties. What you type inside in either text will yield the same result.

Either these three components, they can be Integrated seamlessly into TextMeshPro’s SDF Rendering. If you have TextMeshPro in the project, SDF Rendering in TEXDraw can be activated by Declaring scripting symbol TEXDRAW_TMP in Player settings and importing required shaders, which explained in detail here

Enumeration Choices

Auto Fit is used for what happens to the whole text when generated text is out of the given rectangle layout. The choices are…

Off Turn off rescaling. Text can generated beyond it’s rectangle
Down Size Scale text down if it oversized
Rect Size Force the rectangle to follow the generated text size
Height Only Adjust the height of the rectangle automatically
Scale Scale the generated text until fit on the rectangle
Best Fit Attempt to find the largest possible size (caution: potentially expensive)

Auto Wrap is used for what happens to each line of generated text when it’s horizontal line is beyond than given rectangle width. Auto Wrap is always be calculated first before Auto Fit.

No Wrap No wrapping applied
Letter Wrap Wrap (Move to below) any character if it oversized
Word Wrap Wrap any word if it oversized
Word Wrap Justified Wrap any word, then stretch space sizes to rectangle edges

Auto Fill is useful only if you use a custom material which requires UV1 vectors like Gradient and Texture Overlay shaders. This is about how texts are UV-mapped, in automatic-way.

None Don’t attempt to fill any UV1 values (Faster)
Rectangle Interpolate according to Rectangle Bound (Scaling will take effect)
Whole Text Interpolate to the generated text rectangle (Scaling isn’t taken into effect)
Whole Text Squared Interpolate like Whole text, but keep at ratio size of 1:1 (prevent stretches)
Per Line Interpolate text line-by-line
Per Character Generated Character Quads will always either have (0,0) or (1,1) coordinate.
Per Character Squared Like per-character, but keep it’s aspect ratio at 1:1.
Local Continous All characters UV is mapped based on their local position
World Continous All characters is mapped based on their world position, interactively.