Class Magick::RVG::Utility::TextAttributes
In: lib/rvg/misc.rb
Parent: Object
Enum GeometryValue Stylable RVG\n[lib/rvg/clippath.rb\nlib/rvg/container.rb\nlib/rvg/deep_equal.rb\nlib/rvg/describable.rb\nlib/rvg/embellishable.rb\nlib/rvg/misc.rb\nlib/rvg/paint.rb\nlib/rvg/pathdata.rb\nlib/rvg/rvg.rb\nlib/rvg/stretchable.rb\nlib/rvg/stylable.rb\nlib/rvg/text.rb\nlib/rvg/transformable.rb\nlib/rvg/units.rb] Transformable Stretchable Embellishable Describable Duplicatable Comparable Image ImageList Enumerable Geometry HatchFill Draw lib/RMagick.rb lib/rvg/misc.rb ObjectData Application Pre_ObjectData_Descriptor Envelope Post_ObjectData_Descriptor IPTC Magick dot/m_14_0.png

Methods

Constants

WRITING_MODE = %w{lr-tb lr rl-tb rl tb-rl tb}

Public Class methods

[Source]

     # 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

Public Instance methods

[Source]

     # File lib/rvg/misc.rb, line 402
402:                 def affine()
403:                     @affine[-1]
404:                 end

[Source]

     # File lib/rvg/misc.rb, line 406
406:                 def baseline_shift()
407:                     @baseline_shift[-1]
408:                 end

[Source]

     # File lib/rvg/misc.rb, line 410
410:                 def baseline_shift=(value)
411:                     @baseline_shift[-1] = value
412:                 end

[Source]

     # File lib/rvg/misc.rb, line 430
430:                 def glyph_orientation_horizontal()
431:                     @glyph_orientation_horizontal[-1]
432:                 end

[Source]

     # File lib/rvg/misc.rb, line 434
434:                 def glyph_orientation_horizontal=(angle)
435:                     @glyph_orientation_horizontal[-1] = angle
436:                 end

[Source]

     # File lib/rvg/misc.rb, line 422
422:                 def glyph_orientation_vertical()
423:                     @glyph_orientation_vertical[-1]
424:                 end

[Source]

     # File lib/rvg/misc.rb, line 426
426:                 def glyph_orientation_vertical=(angle)
427:                     @glyph_orientation_vertical[-1] = angle
428:                 end

[Source]

     # File lib/rvg/misc.rb, line 438
438:                 def letter_spacing()
439:                     @letter_spacing[-1]
440:                 end

[Source]

     # File lib/rvg/misc.rb, line 442
442:                 def letter_spacing=(value)
443:                     @letter_spacing[-1] = value
444:                 end

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # File lib/rvg/misc.rb, line 414
414:                 def text_anchor()
415:                     @text_anchor[-1]
416:                 end

[Source]

     # File lib/rvg/misc.rb, line 418
418:                 def text_anchor=(anchor)
419:                     @text_anchor[-1] = anchor
420:                 end

[Source]

     # File lib/rvg/misc.rb, line 452
452:                 def word_spacing()
453:                     @word_spacing[-1]
454:                 end

[Source]

     # File lib/rvg/misc.rb, line 456
456:                 def word_spacing=(value)
457:                     @word_spacing[-1] = value
458:                 end

[Source]

     # File lib/rvg/misc.rb, line 460
460:                 def writing_mode()
461:                     @writing_mode[-1]
462:                 end

[Source]

     # File lib/rvg/misc.rb, line 464
464:                 def writing_mode=(mode)
465:                     @writing_mode[-1] = WRITING_MODE.include?(mode) ? mode : 'lr-tb'
466:                 end

[Validate]