Example #1
0
        /// <summary>
        /// Prepare the given font to render our characters and build our mesh.
        /// </summary>
        /// <param name="mesh">The FontAtlasMesh to build.</param>
        /// <param name="font">The font to use.</param>
        /// <param name="fontSize">The fontsize to set.</param>
        /// <param name="input">The input string.</param>
        /// <param name="mat">The material to use for this font.</param>
        /// <param name="verticalAdjust">Vertical offset.</param>
        void SetupFontAndMesh(FontAtlasMesh mesh, Font font, int fontSize, string input, Material mat, int verticalAdjust)
        {
            font.RequestCharactersInTexture(input, fontSize);
            font.material.mainTexture.filterMode = FilterMode.Point;
            mat.mainTexture = font.material.mainTexture;
            mat.color       = textColor_;

            mesh.AddCharactersToMesh(input, font, fontSize, 16, glyphDimensions_, verticalAdjust);
        }