/src/wrappers/cairo/library/cairo_font_face.e

http://github.com/tybor/Liberty · Specman e · 124 lines · 55 code · 17 blank · 52 comment · 2 complexity · 8e18ee2f09630e0cbaf898157a3e8ab2 MD5 · raw file

  1. note
  2. description: "CAIRO_FONT_FACE -- Base class for fonts"
  3. copyright: "[
  4. Copyright (C) 2007-2017: Paolo Redaelli,
  5. Soluciones Informaticas Libres S.A. (Except),
  6. Cairo team
  7. This library is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU Lesser General Public License
  9. as published by the Free Software Foundation; either version 2.1 of
  10. the License, or (at your option) any later version.
  11. This library is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with this library; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. 02110-1301 USA
  19. ]"
  20. date: "$Date:$"
  21. revision: "$Revision:$"
  22. wrapped_version: "1.2.4"
  23. class CAIRO_FONT_FACE
  24. -- A cairo_font_face_t specifies all aspects of a font other than
  25. -- the size or font matrix (a font matrix is used to distort a font
  26. -- by sheering it or scaling it unequally in the two directions). A
  27. -- font face can be set on a CAIRO_CONTEXT by using
  28. -- `set_font_face'; the size and font matrix are set with
  29. -- `set_font_size' and `set_font_matrix'.
  30. inherit
  31. C_STRUCT
  32. insert
  33. CAIRO_FONT_FACE_EXTERNALS
  34. CAIRO_FONT_TYPE
  35. CAIRO_STATUS
  36. create {ANY} from_external_pointer
  37. feature {ANY} -- Memory handling
  38. dispose do unref end
  39. ref
  40. -- Increases the reference count on font_face by one. This
  41. -- prevents font_face from being destroyed until a matching
  42. -- call to CAIRO_FONT_FACE's `destroy' is made.
  43. local p: POINTER
  44. do
  45. p:=cairo_font_face_reference(handle)
  46. end
  47. unref
  48. -- Decreases the reference count on font_face by one. If the
  49. -- result is zero, then font_face and all associated
  50. -- resources are freed. See `reference'.
  51. do
  52. cairo_font_face_destroy(handle)
  53. end
  54. feature {ANY}
  55. status: INTEGER
  56. -- The status of font face. Useful to check whether an error has previously occurred.
  57. do
  58. Result:=cairo_font_face_status(handle)
  59. ensure
  60. valid: is_valid_cairo_status (Result)
  61. end
  62. -- TODO: if necessary cairo_font_face_get_user_data ()
  63. -- void* cairo_font_face_get_user_data (cairo_font_face_t *font_face,
  64. -- const cairo_user_data_key_t *key);
  65. --
  66. -- Return user data previously attached to font_face using the specified key.
  67. -- If no user data has been attached with the given key this function returns
  68. -- NULL.
  69. --
  70. -- font_face : a cairo_font_face_t
  71. -- key : the address of the cairo_user_data_key_t the user data was
  72. -- attached to
  73. -- Returns : the user data previously attached or NULL.
  74. --
  75. -- TODO: if necessary cairo_font_face_set_user_data ()
  76. --
  77. -- cairo_status_t cairo_font_face_set_user_data
  78. -- (cairo_font_face_t *font_face,
  79. -- const cairo_user_data_key_t *key,
  80. -- void *user_data,
  81. -- cairo_destroy_func_t destroy);
  82. --
  83. -- Attach user data to font_face. To remove user data from a font face, call
  84. -- this function with the key that was used to set it and NULL for data.
  85. --
  86. -- font_face : a cairo_font_face_t
  87. -- key : the address of a cairo_user_data_key_t to attach the user data
  88. -- to
  89. -- user_data : the user data to attach to the font face
  90. -- destroy : a cairo_destroy_func_t which will be called when the font face
  91. -- is destroyed or when new user data is attached using the same
  92. -- key.
  93. -- Returns : CAIRO_STATUS_SUCCESS or CAIRO_STATUS_NO_MEMORY if a slot could
  94. -- not be allocated for the user data.
  95. --
  96. --
  97. feature {WRAPPER, WRAPPER_HANDLER}
  98. type: INTEGER
  99. -- The type of the backend used to create a font face. See
  100. -- CAIRO_FONT_TYPE for available types.
  101. -- Note: this is useful only to provide wrappers of the
  102. -- effective type.
  103. do
  104. Result:=cairo_font_face_get_type(handle)
  105. ensure valid: is_valid_font_type(Result)
  106. end
  107. end -- class CAIRO_FONT_FACE