/// <summary> /// Convert a rendering mode number to an enum value /// </summary> public static FontRenderingMode GetRenderingMode(CObject number) { var mode = (int)PdfUtilities.GetDouble(number); FontRenderingMode fontRenderingMode = FontRenderingMode.Unknown; switch (mode) { case 0: fontRenderingMode = FontRenderingMode.Fill; break; case 1: fontRenderingMode = FontRenderingMode.Stroke; break; case 2: fontRenderingMode = FontRenderingMode.FillAndStroke; break; default: fontRenderingMode = FontRenderingMode.Fill; break; } return(fontRenderingMode); }
public override void DrawEditor() { fontSize = Mathf.Clamp(EditorGUILayout.IntField("Font Size", fontSize), 1, 500); fontRenderingMode = (FontRenderingMode)EditorGUILayout.EnumPopup("Rendering Mode", fontRenderingMode); fontTextureCase = (FontTextureCase)EditorGUILayout.EnumPopup("Character", fontTextureCase); if (fontTextureCase == FontTextureCase.Dynamic) { includeFontData = EditorGUILayout.Toggle("Incl. Font Data", includeFontData); } else if (fontTextureCase == FontTextureCase.CustomSet) { EditorGUILayout.PrefixLabel("Custom Chars"); EditorGUI.BeginChangeCheck(); customCharacters = EditorGUILayout.TextArea(customCharacters, GUILayout.MinHeight(32f)); if (EditorGUI.EndChangeCheck()) { customCharacters = new string(customCharacters.Distinct().ToArray()).Replace("\n", string.Empty).Replace("\r", string.Empty); } } }