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 Array Geometry HatchFill Draw lib/RMagick.rb lib/rvg/rvg.rb Magick Module: Magick

Methods

Constants

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

Public Class methods

[Source]

     # File lib/rvg/misc.rb, line 344
344:         def initialize()
345:             @affine = Array.new
346:             @affine << Magick::AffineMatrix.new(1, 0, 0, 1, 0, 0)
347:             @baseline_shift = Array.new
348:             @baseline_shift << :baseline
349:             @glyph_orientation_horizontal = Array.new
350:             @glyph_orientation_horizontal << 0
351:             @glyph_orientation_vertical = Array.new
352:             @glyph_orientation_vertical << 90
353:             @letter_spacing = Array.new
354:             @letter_spacing << 0
355:             @text_anchor = Array.new
356:             @text_anchor << :start
357:             @word_spacing = Array.new
358:             @word_spacing << 0
359:             @writing_mode = Array.new
360:             @writing_mode << 'lr-tb'
361:         end

Public Instance methods

[Source]

     # File lib/rvg/misc.rb, line 394
394:         def affine()
395:             @affine[-1]
396:         end

[Source]

     # File lib/rvg/misc.rb, line 398
398:         def baseline_shift()
399:             @baseline_shift[-1]
400:         end

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

     # File lib/rvg/misc.rb, line 438
438:         def non_default?
439:             @baseline_shift[-1] != :baseline || @letter_spacing[-1] != 0 ||
440:             @word_spacing[-1] != 0 || @writing_mode[-1][/\Alr/].nil? ||
441:             @glyph_orientation_horizontal[-1] != 0
442:         end

[Source]

     # File lib/rvg/misc.rb, line 374
374:         def pop()
375:             @affine.pop
376:             @baseline_shift.pop
377:             @text_anchor.pop
378:             @writing_mode.pop
379:             @glyph_orientation_vertical.pop
380:             @glyph_orientation_horizontal.pop
381:             @letter_spacing.pop
382:             @word_spacing.pop
383:         end

[Source]

     # File lib/rvg/misc.rb, line 363
363:         def push()
364:             @affine.push(@affine.last.dup)
365:             @baseline_shift.push(@baseline_shift.last)
366:             @text_anchor.push(@text_anchor.last)
367:             @writing_mode.push(@writing_mode.last.dup)
368:             @glyph_orientation_vertical.push(@glyph_orientation_vertical.last)
369:             @glyph_orientation_horizontal.push(@glyph_orientation_horizontal.last)
370:             @letter_spacing.push(@letter_spacing.last)
371:             @word_spacing.push(@word_spacing.last)
372:         end

[Source]

     # File lib/rvg/misc.rb, line 385
385:         def set_affine(sx, rx, ry, sy, tx, ty)
386:             @affine[-1].sx = sx
387:             @affine[-1].rx = rx
388:             @affine[-1].ry = ry
389:             @affine[-1].sy = sy
390:             @affine[-1].tx = tx
391:             @affine[-1].ty = ty
392:         end

[Source]

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

[Source]

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

[Source]

     # File lib/rvg/misc.rb, line 444
444:         def word_spacing()
445:             @word_spacing[-1]
446:         end

[Source]

     # File lib/rvg/misc.rb, line 448
448:         def word_spacing=(value)
449:             @word_spacing[-1] = value
450:         end

[Source]

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

[Source]

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

[Validate]