public MarkupPosition(Markup markup) { Contract.Requires(markup != null); Contract.Requires(!markup.Equals(Markup.Default)); Contract.Requires(markup.IsIndependent); }
public bool Equals(Markup other) { return other != null && Equals(this.Underline, other.Underline) && Equals(this.Strikethrough, other.Strikethrough) && Equals(this.Foreground, other.Foreground) && Equals(this.Background, other.Background); }
/// <summary> Creates a new glyph object summarizing the information on a glyph. </summary> /// <param name="index"> The index in the glyph run of the represented glyph.</param> /// <param name="character"> The character represented by this glyph. </param> /// <param name="markup"> The markup of this glyph. </param> /// <param name="fontSize"> The size of this glyph. </param> public Glyph(ushort index, char character, double fontSize, Markup markup, int palpableIndex) { Contract.Requires(fontSize > 0); Contract.Requires(markup != null); this.Index = index; this.Character = character; this.Size = fontSize; this.Markup = markup; this.PalpableIndex = palpableIndex; }
private static NameInstance ToNameInstance(char c, Markup markup, LinearPosition position) { var glyphNameInstance = CharacterVariationsTranslation.ToNameInstance(c, markup); //either the glyph name has markup or diacritics, in which case it is a CNI, which should be encapsulated in the linear position //otherwise, a name instance with dummy linear position is returned, whose dummy value should be replaced with the palpable index if (glyphNameInstance is CompositeNameInstance) return new CompositeNameInstance(glyphNameInstance.ToSingletonList(), position); else return new AtomicNameInstance(c, position); }