コード例 #1
0
ファイル: GlyphLayout.cs プロジェクト: zwcloud/ImGui
 public GlyphPlanSequence(IUnscaledGlyphPlanList glyphPlanList, int startAt, int len)
 {
     _glyphPlanList = glyphPlanList;
     this.startAt   = startAt;
     this.len       = (ushort)len;
     _isRTL         = false;
 }
コード例 #2
0
ファイル: GlyphLayout.cs プロジェクト: zwcloud/ImGui
 public GlyphPlanSequence(IUnscaledGlyphPlanList glyphPlanList)
 {
     _glyphPlanList = glyphPlanList;
     this.startAt   = 0;
     this.len       = (ushort)glyphPlanList.Count;
     _isRTL         = false;
 }
コード例 #3
0
        public virtual void GenerateGlyphPlan(
            char[] textBuffer,
            int startAt,
            int len,
            IUnscaledGlyphPlanList unscaledGlyphPlan)
        {
            GlyphLayout glyphLayout = this.GlyphLayoutMan;

            glyphLayout.Layout(textBuffer, startAt, len);
            glyphLayout.GenerateUnscaledGlyphPlans(unscaledGlyphPlan);
        }
コード例 #4
0
        //
        public float CalculateWidth()
        {
            if (_glyphBuffer == null)
            {
                return(0);
            }
            //
            IUnscaledGlyphPlanList plans = _glyphBuffer;
            int   end   = startAt + len;
            float width = 0;

            for (int i = startAt; i < end; ++i)
            {
                width += plans[i].AdvanceX;
            }
            return(width);
        }
コード例 #5
0
        /// <summary>
        /// fetch layout result, unscaled version, put to IUnscaledGlyphPlanList
        /// </summary>
        /// <param name="glyphPositions"></param>
        /// <param name="pxscale"></param>
        /// <param name="outputGlyphPlanList"></param>
        public void GenerateUnscaledGlyphPlans(IUnscaledGlyphPlanList outputGlyphPlanList)
        {
            IGlyphPositions glyphPositions  = _glyphPositions;
            int             finalGlyphCount = glyphPositions.Count;

            for (int i = 0; i < finalGlyphCount; ++i)
            {
                short  offsetX, offsetY, advW;
                ushort glyphIndex = glyphPositions.GetGlyph(i,
                                                            out ushort input_offset,
                                                            out offsetX,
                                                            out offsetY,
                                                            out advW);
                //
                outputGlyphPlanList.Append(new UnscaledGlyphPlan(
                                               input_offset,
                                               glyphIndex,
                                               advW,
                                               offsetX,
                                               offsetY
                                               ));
            }
        }
コード例 #6
0
 public GlyphPlanSequence(IUnscaledGlyphPlanList glyphBuffer)
 {
     _glyphBuffer = glyphBuffer;
     this.startAt = 0;
     this.len     = (ushort)glyphBuffer.Count;
 }
コード例 #7
0
 public GlyphPlanSequence(IUnscaledGlyphPlanList glyphBuffer, int startAt, int len)
 {
     _glyphBuffer = glyphBuffer;
     this.startAt = startAt;
     this.len     = (ushort)len;
 }