TextContentElement.hx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C)2005-2018 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\SVGTextContentElement.webidl. Do not edit!
  23. package js.html.svg;
  24. /**
  25. The `SVGTextContentElement` interface is implemented by elements that support rendering child text content. It is inherited by various text-related interfaces, such as `SVGTextElement`, `SVGTSpanElement`, `SVGTRefElement`, `SVGAltGlyphElement` and `SVGTextPathElement`.
  26. Documentation [SVGTextContentElement](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement>
  28. **/
  29. @:native("SVGTextContentElement")
  30. extern class TextContentElement extends GraphicsElement
  31. {
  32. static inline var LENGTHADJUST_UNKNOWN : Int = 0;
  33. static inline var LENGTHADJUST_SPACING : Int = 1;
  34. static inline var LENGTHADJUST_SPACINGANDGLYPHS : Int = 2;
  35. /**
  36. An `SVGAnimatedLength` reflecting the `textLength` attribute of the given element.
  37. **/
  38. var textLength(default,null) : AnimatedLength;
  39. /**
  40. An `SVGAnimatedEnumeration` reflecting the `lengthAdjust` attribute of the given element. The numeric type values represent one of the constant values above.
  41. **/
  42. var lengthAdjust(default,null) : AnimatedEnumeration;
  43. /**
  44. Returns a long representing the total number of addressable characters available for rendering within the current element, regardless of whether they will be rendered.
  45. **/
  46. function getNumberOfChars() : Int;
  47. /**
  48. Returns a float representing the computed length for the text within the element.
  49. **/
  50. function getComputedTextLength() : Float;
  51. /**
  52. Returns a float representing the computed length of the formatted text advance distance for a substring of text within the element. Note that this method only accounts for the widths of the glyphs in the substring and any extra spacing inserted by the CSS 'letter-spacing' and 'word-spacing' properties. Visual spacing adjustments made by the 'x' attribute is ignored.
  53. @throws DOMError
  54. **/
  55. function getSubStringLength( charnum : Int, nchars : Int ) : Float;
  56. /**
  57. Returns a `DOMPoint` representing the position of a typographic character after text layout has been performed.
  58. Note: In SVG 1.1 this method returned an `SVGPoint`.
  59. @throws DOMError
  60. **/
  61. function getStartPositionOfChar( charnum : Int ) : Point;
  62. /**
  63. Returns a `DOMPoint` representing the trailing position of a typographic character after text layout has been performed.
  64. Note: In SVG 1.1 this method returned an `SVGPoint`.
  65. @throws DOMError
  66. **/
  67. function getEndPositionOfChar( charnum : Int ) : Point;
  68. /**
  69. Returns a `DOMRect` representing the computed tight bounding box of the glyph cell that corresponds to a given typographic character.
  70. @throws DOMError
  71. **/
  72. function getExtentOfChar( charnum : Int ) : Rect;
  73. /**
  74. Returns a float representing the rotation of typographic character.
  75. @throws DOMError
  76. **/
  77. function getRotationOfChar( charnum : Int ) : Float;
  78. /**
  79. Returns a long representing the character which caused a text glyph to be rendered at a given position in the coordinate system. Because the relationship between characters and glyphs is not one-to-one, only the first character of the relevant typographic character is returned
  80. **/
  81. function getCharNumAtPosition( point : Point ) : Int;
  82. /**
  83. Selects text within the element.
  84. @throws DOMError
  85. **/
  86. function selectSubString( charnum : Int, nchars : Int ) : Void;
  87. }