| Class | Magick::RVG::Utility::TextAttributes |
| In: |
lib/rvg/misc.rb
|
| Parent: | Object |
| WRITING_MODE | = | %w{lr-tb lr rl-tb rl tb-rl tb} |
# File lib/rvg/misc.rb, line 352
352: def initialize()
353: @affine = Array.new
354: @affine << Magick::AffineMatrix.new(1, 0, 0, 1, 0, 0)
355: @baseline_shift = Array.new
356: @baseline_shift << :baseline
357: @glyph_orientation_horizontal = Array.new
358: @glyph_orientation_horizontal << 0
359: @glyph_orientation_vertical = Array.new
360: @glyph_orientation_vertical << 90
361: @letter_spacing = Array.new
362: @letter_spacing << 0
363: @text_anchor = Array.new
364: @text_anchor << :start
365: @word_spacing = Array.new
366: @word_spacing << 0
367: @writing_mode = Array.new
368: @writing_mode << 'lr-tb'
369: end
# File lib/rvg/misc.rb, line 410
410: def baseline_shift=(value)
411: @baseline_shift[-1] = value
412: end
# File lib/rvg/misc.rb, line 430
430: def glyph_orientation_horizontal()
431: @glyph_orientation_horizontal[-1]
432: end
# File lib/rvg/misc.rb, line 434
434: def glyph_orientation_horizontal=(angle)
435: @glyph_orientation_horizontal[-1] = angle
436: end
# File lib/rvg/misc.rb, line 422
422: def glyph_orientation_vertical()
423: @glyph_orientation_vertical[-1]
424: end
# File lib/rvg/misc.rb, line 426
426: def glyph_orientation_vertical=(angle)
427: @glyph_orientation_vertical[-1] = angle
428: end
# File lib/rvg/misc.rb, line 442
442: def letter_spacing=(value)
443: @letter_spacing[-1] = value
444: end
# File lib/rvg/misc.rb, line 446
446: def non_default?
447: @baseline_shift[-1] != :baseline || @letter_spacing[-1] != 0 ||
448: @word_spacing[-1] != 0 || @writing_mode[-1][/\Alr/].nil? ||
449: @glyph_orientation_horizontal[-1] != 0
450: end
# File lib/rvg/misc.rb, line 382
382: def pop()
383: @affine.pop
384: @baseline_shift.pop
385: @text_anchor.pop
386: @writing_mode.pop
387: @glyph_orientation_vertical.pop
388: @glyph_orientation_horizontal.pop
389: @letter_spacing.pop
390: @word_spacing.pop
391: end
# File lib/rvg/misc.rb, line 371
371: def push()
372: @affine.push(@affine.last.dup)
373: @baseline_shift.push(@baseline_shift.last)
374: @text_anchor.push(@text_anchor.last)
375: @writing_mode.push(@writing_mode.last.dup)
376: @glyph_orientation_vertical.push(@glyph_orientation_vertical.last)
377: @glyph_orientation_horizontal.push(@glyph_orientation_horizontal.last)
378: @letter_spacing.push(@letter_spacing.last)
379: @word_spacing.push(@word_spacing.last)
380: end
# File lib/rvg/misc.rb, line 393
393: def set_affine(sx, rx, ry, sy, tx, ty)
394: @affine[-1].sx = sx
395: @affine[-1].rx = rx
396: @affine[-1].ry = ry
397: @affine[-1].sy = sy
398: @affine[-1].tx = tx
399: @affine[-1].ty = ty
400: end
# File lib/rvg/misc.rb, line 418
418: def text_anchor=(anchor)
419: @text_anchor[-1] = anchor
420: end
# File lib/rvg/misc.rb, line 456
456: def word_spacing=(value)
457: @word_spacing[-1] = value
458: end