TextContentElement.hx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (C)2005-2019 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. static inline var LENGTHADJUST_UNKNOWN : Int = 0;
  32. static inline var LENGTHADJUST_SPACING : Int = 1;
  33. static inline var LENGTHADJUST_SPACINGANDGLYPHS : Int = 2;
  34. /**
  35. An `SVGAnimatedLength` reflecting the `textLength` attribute of the given element.
  36. **/
  37. var textLength(default,null) : AnimatedLength;
  38. /**
  39. An `SVGAnimatedEnumeration` reflecting the `lengthAdjust` attribute of the given element. The numeric type values represent one of the constant values above.
  40. **/
  41. var lengthAdjust(default,null) : AnimatedEnumeration;
  42. /**
  43. Returns a long representing the total number of addressable characters available for rendering within the current element, regardless of whether they will be rendered.
  44. **/
  45. function getNumberOfChars() : Int;
  46. /**
  47. Returns a float representing the computed length for the text within the element.
  48. **/
  49. function getComputedTextLength() : Float;
  50. /**
  51. 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.
  52. @throws DOMError
  53. **/
  54. function getSubStringLength( charnum : Int, nchars : Int ) : Float;
  55. /**
  56. Returns a `DOMPoint` representing the position of a typographic character after text layout has been performed.
  57. Note: In SVG 1.1 this method returned an `SVGPoint`.
  58. @throws DOMError
  59. **/
  60. function getStartPositionOfChar( charnum : Int ) : Point;
  61. /**
  62. Returns a `DOMPoint` representing the trailing position of a typographic character after text layout has been performed.
  63. Note: In SVG 1.1 this method returned an `SVGPoint`.
  64. @throws DOMError
  65. **/
  66. function getEndPositionOfChar( charnum : Int ) : Point;
  67. /**
  68. Returns a `DOMRect` representing the computed tight bounding box of the glyph cell that corresponds to a given typographic character.
  69. @throws DOMError
  70. **/
  71. function getExtentOfChar( charnum : Int ) : Rect;
  72. /**
  73. Returns a float representing the rotation of typographic character.
  74. @throws DOMError
  75. **/
  76. function getRotationOfChar( charnum : Int ) : Float;
  77. /**
  78. 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
  79. **/
  80. function getCharNumAtPosition( point : Point ) : Int;
  81. /**
  82. Selects text within the element.
  83. @throws DOMError
  84. **/
  85. function selectSubString( charnum : Int, nchars : Int ) : Void;
  86. }