static void drawRubyText(SKCanvas canvas, SKPaint paint, WaterTrans.TypeLoader.TypefaceInfo tfi, HKWaxBase ch) { if (string.IsNullOrEmpty(ch.Ruby)) { return; } float rubyFontSize = ch.FontSize * 0.6f; //ルビの文字サイズは本文の半分 paint.TextSize = rubyFontSize; var glyphs = stringToVerticalGlyphs(ch.Ruby, paint, tfi); float curY = ch.DevY; foreach (var glyph in glyphs) { drawChar(canvas, glyph, ch.DevX + ch.FontSize /*本文の右*/, curY, paint); curY += paint.TextSize;/*下に進む*/ } }
static void drawHinshiText(SKCanvas canvas, SKPaint paint, WaterTrans.TypeLoader.TypefaceInfo tfi, HKWaxBase ch, bool bRightLeft) { if (string.IsNullOrEmpty(ch.Hinshi)) { return; } //Debug.WriteLine($"drawhinshi hinsi={ch.Hinshi}"); float hinshiFontSize = ch.FontSize * 0.5f; //ルビの文字サイズは本文の半分 paint.TextSize = hinshiFontSize; var glyphs = stringToVerticalGlyphs(ch.Hinshi, paint, tfi); float curX = ch.DevX; if (bRightLeft != true) //左右交互 { curX += paint.TextSize; } //if (ch.Hinshi.Length >= 2) // curX -= paint.TextSize; //左から2文字 float curY = ch.DevY; foreach (var glyph in glyphs) { drawChar(canvas, glyph, curX - ch.FontSize /*本文の左側*/, curY, paint); curY += paint.TextSize; /*下に進む*/ } }
static void drawHonbunChar(SKCanvas canvas, SKPaint paint, WaterTrans.TypeLoader.TypefaceInfo tfi, HKWaxBase ch) { //文字をGlyphIdに変換 var glyphs = stringToVerticalGlyphs(ch.Char, paint, tfi); //描画の文字サイズを設定 paint.TextSize = ch.FontSize; //本文を描画 drawText(canvas, glyphs, ch.DevX, ch.DevY, paint); }