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;
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
            }
        }
Exemple #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>");
        }
Exemple #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>");
        }
Exemple #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;
        }
Exemple #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>");
 }
Exemple #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>");
 }
Exemple #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);
            }
        }
Exemple #12
0
 public abstract void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol);
Exemple #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;
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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;
 }
Exemple #18
0
 public MusicFontGlyph(float x, float y, float glyphScale, MusicFontSymbol symbol)
     : base(x, y)
 {
     GlyphScale = glyphScale;
     _symbol    = symbol;
 }
Exemple #19
0
 public MusicFontGlyph(float x, float y, float scale, MusicFontSymbol symbol)
     : base(x, y)
 {
     _scale = scale;
     _symbol = symbol;
 }
Exemple #20
0
 public abstract void FillMusicFontSymbol(float x, float y, float scale, MusicFontSymbol symbol);