Esempio n. 1
0
        public override void DoLayout()
        {
            base.DoLayout();

            var symbolHeight = 0f;

            switch (_type)
            {
            case VibratoType.Slight:
                _symbol       = MusicFontSymbol.WaveHorizontalSlight;
                _symbolSize   = SlightWaveSize * _scale;
                _symbolOffset = SlightWaveOffset * _scale;
                symbolHeight  = 6 * _scale;
                break;

            case VibratoType.Wide:
                _symbol       = MusicFontSymbol.WaveHorizontalWide;
                _symbolSize   = 10 * _scale;
                _symbolOffset = 7 * _scale;
                symbolHeight  = 10 * _scale;
                break;
            }

            Height = symbolHeight * Scale;
        }
Esempio n. 2
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            //_buffer += "<text x=\"";
            //_buffer += x;
            //_buffer += "\" y=\"";
            //_buffer += y + GetSvgBaseLineOffset();
            //_buffer += "\" style=\"font:";
            //_buffer += Resources.MusicFont.ToCssString();
            //_buffer += "; fill:";
            //_buffer += Color.ToRgbaString();
            //_buffer += ";\" ";
            //_buffer += " dominant-baseline=\"top\" text-anchor=\"start\"";
            //_buffer += ">&#x";
            //_buffer += Std.ToHexString((int)symbol);
            //_buffer += ";</text>\n";


            //if (symbol == MusicFontSymbol.None)
            //{
            //    return;
            //}

            SvgRenderer glyph = new SvgRenderer(MusicFont.SymbolLookup[symbol], scale, scale);

            glyph.Paint(x, y, this);
        }
Esempio n. 3
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            SvgRenderer glyph = new SvgRenderer(MusicFont.SymbolLookup[symbol], scale, scale);

            glyph.Paint(x, y, this);
        }
Esempio n. 4
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            // for whatever reason the padding on GDI font rendering is a bit messed up, there is 1px padding on the left
            x += scale;

            _graphics.DrawString(Std.StringFromCharCode((int)symbol), GetMusicFont(scale), _brush, x, y, MusicFontFormat);
        }
Esempio n. 5
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            using (var paint = CreatePaint())
            {
                paint.Typeface = MusicFont;
                paint.TextSize = MusicFontSize * scale;
                _surface.Canvas.DrawText(Std.StringFromCharCode((int)symbol), x, y, paint);
            }
        }
Esempio n. 6
0
        public override void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            Buffer.Append("<svg x=\"" + (x - BlurCorrection) + "\" y=\"" + (y - BlurCorrection) + "\" class=\"at\" ><text style=\"fill:" + Color.RGBA + "; ");
            if (scale != 1)
            {
                Buffer.Append("font-size: " + (scale * 100) + "%");
            }
            Buffer.Append("\" text-anchor=\"start\">&#" + (int)symbol + ";</text></svg>");
        }
Esempio n. 7
0
        public override void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            Buffer.Append("<svg x=\"" + (x - BlurCorrection) + "\" y=\"" + (y - BlurCorrection) + "\" class=\"at\" ><text style=\"fill:" + Color.RGBA + "; ");
            if (scale != 1)
            {
                Buffer.Append("font-size: " + (scale * 100) + "%");
            }
            Buffer.Append("\" text-anchor=\"start\">&#" + (int)symbol + ";</text></svg>");
        }
Esempio n. 8
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }
            var baseLine = _context.textBaseline;
            var font     = _context.font;

            _context.font         = _musicFont.ToCssString(scale);
            _context.textBaseline = "middle";
            _context.fillText(Std.StringFromCharCode((int)symbol), x, y);
            _context.textBaseline = baseLine;
            _context.font         = font;
        }
Esempio n. 9
0
 public override void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
 {
     Buffer.Append("<g transform=\"translate(" + ((int)x - BlurCorrection) + " " + ((int)y - BlurCorrection) + ")\" class=\"at\" ><text");
     //Buffer.Append("<svg x=\"" + ((int) x - BlurCorrection) + "\" y=\"" + ((int) y - BlurCorrection) +
     //              "\" class=\"at\" >");
     if (scale != 1)
     {
         Buffer.Append("  style=\"font-size: " + (scale * 100) + "%\"");
     }
     if (Color.RGBA != Model.Color.BlackRgb)
     {
         Buffer.Append(" fill=\"" + Color.RGBA + "\"");
     }
     //Buffer.Append(">&#" + (int)symbol + ";</text></svg>");
     Buffer.Append(">&#" + (int)symbol + ";</text></g>");
 }
Esempio n. 10
0
 public override void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
 {
     if (symbol == MusicFontSymbol.None)
     {
         return;
     }
     Buffer.Append("<g transform=\"translate(" + ((int)x - BlurCorrection) + " " + ((int)y - BlurCorrection) + ")\" class=\"at\" ><text");
     if (scale != 1)
     {
         Buffer.Append(" style=\"font-size: " + (scale * 100) + "%; stroke:none\"");
     }
     else
     {
         Buffer.Append(" style=\"stroke:none\"");
     }
     if (Color.RGBA != Model.Color.BlackRgb)
     {
         Buffer.Append(" fill=\"" + Color.RGBA + "\"");
     }
     Buffer.Append(">&#" + (int)symbol + ";</text></g>");
 }
Esempio n. 11
0
        public void FillMusicFontSymbol(
            double x,
            double y,
            double scale,
            MusicFontSymbol symbol,
            bool centerAtPosition = false)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            using (var paint = CreatePaint())
            {
                paint.Typeface = MusicFont;
                paint.TextSize = (float)(MusicFontSize * scale);
                if (centerAtPosition)
                {
                    paint.TextAlign = SKTextAlign.Center;
                }

                _surface.Canvas.DrawText(String.FromCharCode((double)symbol), (float)x, (float)y, paint);
            }
        }
Esempio n. 12
0
 public abstract void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol);
Esempio n. 13
0
 public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
 {
     if (symbol == MusicFontSymbol.None)
     {
         return;
     }
     var baseLine = _context.textBaseline;
     var font = _context.font;
     _context.font = _musicFont.ToCssString(scale);
     _context.textBaseline = "middle";
     _context.fillText(Std.StringFromCharCode((int) symbol), x, y);
     _context.textBaseline = baseLine;
     _context.font = font;
 }
Esempio n. 14
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            // for whatever reason the padding on GDI font rendering is a bit messed up, there is 1px padding on the left
            x += scale;

            _graphics.DrawString(Std.StringFromCharCode((int)symbol), GetMusicFont(scale), _brush, x, y, MusicFontFormat);
        }
Esempio n. 15
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            SvgRenderer glyph = new SvgRenderer(MusicFont.SymbolLookup[symbol], scale, scale);
            glyph.Paint(x, y, this);
        }
Esempio n. 16
0
        public void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol)
        {
            if (symbol == MusicFontSymbol.None)
            {
                return;
            }

            //_buffer += "<text x=\"";
            //_buffer += x;
            //_buffer += "\" y=\"";
            //_buffer += y + GetSvgBaseLineOffset();
            //_buffer += "\" style=\"font:";
            //_buffer += Resources.MusicFont.ToCssString();
            //_buffer += "; fill:";
            //_buffer += Color.ToRgbaString();
            //_buffer += ";\" ";
            //_buffer += " dominant-baseline=\"top\" text-anchor=\"start\"";
            //_buffer += ">&#x";
            //_buffer += Std.ToHexString((int)symbol);
            //_buffer += ";</text>\n";


            //if (symbol == MusicFontSymbol.None)
            //{
            //    return;
            //}

            SvgRenderer glyph = new SvgRenderer(MusicFont.SymbolLookup[symbol], scale, scale);
            glyph.Paint(x, y, this);
        }
 public MusicFontGlyph(float x, float y, float scale, MusicFontSymbol symbol)
     : base(x, y)
 {
     _scale  = scale;
     _symbol = symbol;
 }
Esempio n. 18
0
 public MusicFontGlyph(float x, float y, float glyphScale, MusicFontSymbol symbol)
     : base(x, y)
 {
     GlyphScale = glyphScale;
     _symbol    = symbol;
 }
Esempio n. 19
0
 public MusicFontGlyph(float x, float y, float scale, MusicFontSymbol symbol)
     : base(x, y)
 {
     _scale = scale;
     _symbol = symbol;
 }
Esempio n. 20
0
 public abstract void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol);