-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented parsing of almost all richtext tags recognized by Unity U…
…I and TextMeshPro. (#36) Richtext values are placed in TextConfiguration. Many of them in a stack (as done by TextMeshPro), which enables enable nesting. It is up to the layout engine to use these metrics correctly when generating the glyphs, lines, and pages. Adopting the layout engine of TextMeshPro would be several thousand lines of code and is not done in this pull request.
- Loading branch information
Showing
46 changed files
with
2,533 additions
and
1,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Unity.Collections; | ||
|
||
namespace Latios.Calligraphics | ||
{ | ||
|
||
public struct FixedStack64Bytes<T> where T : unmanaged | ||
{ | ||
FixedList64Bytes<T> m_buffer; | ||
public bool IsEmpty => m_buffer.IsEmpty; | ||
public void Add(in T item) => m_buffer.Add(in item); | ||
public T Pop() | ||
{ | ||
var result = m_buffer[m_buffer.Length - 1]; | ||
m_buffer.RemoveAt(m_buffer.Length - 1); | ||
return result; | ||
} | ||
public T Peek() | ||
{ | ||
var result = m_buffer[m_buffer.Length - 1]; | ||
return result; | ||
} | ||
/// <summary> Function to pop stack, and return the new resulting last item. Will not pop root.</summary> | ||
public T RemoveExceptRoot() | ||
{ | ||
if (m_buffer.Length > 1) | ||
Pop(); | ||
return Peek(); | ||
} | ||
} | ||
} | ||
|
2 changes: 1 addition & 1 deletion
2
...Text/RichTextInfluenceEnumeration.cs.meta → ...hics/Components/FixedStack64Bytes.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.