Ejemplo n.º 1
0
 public void TestAlignment(LyricTextAlignment rubyAlignment, LyricTextAlignment romajiAlignment)
 {
     // todo : this feature is not implemented.
     AddStep("Create lyric", () => setContents(() => new DefaultLyricSpriteText
     {
         RubyAlignment   = rubyAlignment,
         RomajiAlignment = romajiAlignment
     }));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new <see cref="TextBuilder"/>.
        /// </summary>
        /// <param name="store">The store from which glyphs are to be retrieved from.</param>
        /// <param name="mainTextFont">The main text's font.<paramref name="store"/>.</param>
        /// <param name="font">The font to use for glyph lookups from <paramref name="store"/>.</param>
        /// <param name="useFontSizeAsHeight">True to use the provided <see cref="font"/> size as the height for each line. False if the height of each individual glyph should be used.</param>
        /// <param name="startOffset">The offset at which characters should begin being added at.</param>
        /// <param name="spacing">The spacing between characters.</param>
        /// <param name="maxWidth">The maximum width of the resulting text bounds.</param>
        /// <param name="characterList">That list to contain all resulting <see cref="TextBuilderGlyph"/>s.</param>
        /// <param name="neverFixedWidthCharacters">The characters for which fixed width should never be applied.</param>
        /// <param name="fallbackCharacter">The character to use if a glyph lookup fails.</param>
        /// <param name="fixedWidthReferenceCharacter">The character to use to calculate the fixed width width. Defaults to 'm'.</param>
        /// <param name="relativePosition">Should be added into top or bottom.</param>
        /// <param name="alignment">Lyric text alignment.</param>
        public PositionTextBuilder(ITexturedGlyphLookupStore store, FontUsage mainTextFont, FontUsage font, float maxWidth, bool useFontSizeAsHeight = true, Vector2 startOffset = default,
                                   Vector2 spacing        = default, List <TextBuilderGlyph> characterList = null, char[] neverFixedWidthCharacters = null,
                                   char fallbackCharacter = '?', char fixedWidthReferenceCharacter         = 'm', RelativePosition relativePosition = RelativePosition.Top, LyricTextAlignment alignment = LyricTextAlignment.Auto)
            : base(store, font, maxWidth, useFontSizeAsHeight, startOffset, spacing, characterList, neverFixedWidthCharacters, fallbackCharacter, fixedWidthReferenceCharacter)
        {
            this.store             = store;
            this.mainTextFont      = mainTextFont;
            this.font              = font;
            this.startOffset       = startOffset;
            this.spacing           = spacing;
            this.fallbackCharacter = fallbackCharacter;

            this.relativePosition = relativePosition;
            this.alignment        = alignment;
        }