Exemplo n.º 1
0
        static CLichtFontMetrics()
        {
            float hScale = 3.4037F / 800F;
            float vScale = 2.9464F / 800F;

            foreach (string key in CLichtGlyphBoundingBoxesDictMM.Keys)
            {
                GlyphBoundingBoxMM gbbMM         = CLichtGlyphBoundingBoxesDictMM[key];
                float top_1px                    = (float)gbbMM.mmTop * vScale;
                float left_1px                   = (float)gbbMM.mmLeft * hScale;
                float bottom_1px                 = (float)gbbMM.mmBottom * vScale;
                float right_1px                  = (float)gbbMM.mmRight * hScale;
                CLichtGlyphBoxMetric metrics_1px =
                    new CLichtGlyphBoxMetric(top_1px, right_1px, bottom_1px, left_1px);
                CLichtGlyphBoundingBoxesDictPX.Add(key, metrics_1px);
            }
            foreach (string key in ClichtNoteheadStemPositionsDictMM.Keys)
            {
                NoteheadStemPositionsMM  nspMM = ClichtNoteheadStemPositionsDictMM[key];
                NoteheadStemPositions_px nspPX = new NoteheadStemPositions_px()
                {
                    LeftStemX_px  = (float)nspMM.mmLeftStemX * hScale,
                    LeftStemY_px  = (float)nspMM.mmLeftStemY * vScale,
                    RightStemX_px = (float)nspMM.mmRightStemX * hScale,
                    RightStemY_px = (float)nspMM.mmRightStemY * vScale
                };
                ClichtNoteheadStemPositionsDictPX.Add(key, nspPX);
            }
        }
Exemplo n.º 2
0
 static CLichtFontMetrics()
 {
     float hScale = 3.4037F / 800F;
     float vScale = 2.9464F / 800F;
     foreach(string key in CLichtGlyphBoundingBoxesDictMM.Keys)
     {
         GlyphBoundingBoxMM gbbMM = CLichtGlyphBoundingBoxesDictMM[key];
         float top_1px = (float) gbbMM.mmTop * vScale;
         float left_1px = (float) gbbMM.mmLeft * hScale;
         float bottom_1px = (float) gbbMM.mmBottom * vScale;
         float right_1px = (float) gbbMM.mmRight * hScale;
         CLichtGlyphBoxMetric metrics_1px =
            new CLichtGlyphBoxMetric(top_1px, right_1px, bottom_1px, left_1px);
         CLichtGlyphBoundingBoxesDictPX.Add(key, metrics_1px);
     }
     foreach(string key in ClichtNoteheadStemPositionsDictMM.Keys)
     {
         NoteheadStemPositionsMM nspMM = ClichtNoteheadStemPositionsDictMM[key];
         NoteheadStemPositions_px nspPX = new NoteheadStemPositions_px()
         {
             LeftStemX_px = (float) nspMM.mmLeftStemX * hScale,
             LeftStemY_px = (float) nspMM.mmLeftStemY * vScale,
             RightStemX_px = (float) nspMM.mmRightStemX * hScale,
             RightStemY_px = (float) nspMM.mmRightStemY * vScale
         };
         ClichtNoteheadStemPositionsDictPX.Add(key, nspPX);
     }
 }