odin-blend2d

Odin bindings to Blend2D
Log | Files | Refs | README | LICENSE

fontmanager.odin (2755B)


      1 // This file is part of Blend2D project <https://blend2d.com>
      2 //
      3 // See blend2d.h or LICENSE.md for license and copyright information
      4 // SPDX-License-Identifier: Zlib
      5 package blend2d
      6 
      7 import "core:c"
      8 
      9 when ODIN_OS == .Windows {
     10 	foreign import lib "blend2d.lib"
     11 } else when ODIN_OS == .Darwin {
     12 	foreign import lib "libblend2d.a"
     13 } else when ODIN_OS == .Linux {
     14 	foreign import lib "libblend2d.a"
     15 }
     16 
     17 
     18 //! Font manager [C API].
     19 FontManagerCore :: struct {
     20 	_d: ObjectDetail,
     21 }
     22 
     23 //! \cond INTERNAL
     24 //! Font manager [C API Virtual Function Table].
     25 FontManagerVirt :: struct {
     26 	base: ObjectVirtBase,
     27 }
     28 
     29 //! Font manager [C API Impl].
     30 FontManagerImpl :: struct {
     31 	//! Virtual function table.
     32 	virt: ^FontManagerVirt,
     33 }
     34 
     35 @(default_calling_convention="c", link_prefix="bl_")
     36 foreign lib {
     37 	//! \endcond
     38 	font_manager_init                       :: proc(self: ^FontManagerCore) -> Result ---
     39 	font_manager_init_move                  :: proc(self: ^FontManagerCore, other: ^FontManagerCore) -> Result ---
     40 	font_manager_init_weak                  :: proc(self: ^FontManagerCore, other: ^FontManagerCore) -> Result ---
     41 	font_manager_init_new                   :: proc(self: ^FontManagerCore) -> Result ---
     42 	font_manager_destroy                    :: proc(self: ^FontManagerCore) -> Result ---
     43 	font_manager_reset                      :: proc(self: ^FontManagerCore) -> Result ---
     44 	font_manager_assign_move                :: proc(self: ^FontManagerCore, other: ^FontManagerCore) -> Result ---
     45 	font_manager_assign_weak                :: proc(self: ^FontManagerCore, other: ^FontManagerCore) -> Result ---
     46 	font_manager_create                     :: proc(self: ^FontManagerCore) -> Result ---
     47 	font_manager_get_face_count             :: proc(self: ^FontManagerCore) -> c.size_t ---
     48 	font_manager_get_family_count           :: proc(self: ^FontManagerCore) -> c.size_t ---
     49 	font_manager_has_face                   :: proc(self: ^FontManagerCore, face: ^FontFaceCore) -> i32 ---
     50 	font_manager_add_face                   :: proc(self: ^FontManagerCore, face: ^FontFaceCore) -> Result ---
     51 	font_manager_query_face                 :: proc(self: ^FontManagerCore, name: cstring, name_size: c.size_t, properties: ^FontQueryProperties, out: ^FontFaceCore) -> Result ---
     52 	font_manager_query_faces_by_family_name :: proc(self: ^FontManagerCore, name: cstring, name_size: c.size_t, out: ^ArrayCore) -> Result ---
     53 	font_manager_equals                     :: proc(a: ^FontManagerCore, b: ^FontManagerCore) -> i32 ---
     54 }
     55 
     56 //! Properties that can be used to query \ref BLFont and \ref BLFontFace.
     57 //!
     58 //! \sa BLFontManager.
     59 FontQueryProperties :: struct {
     60 	//! \name Members
     61 	//! \{
     62 	
     63 	//! Font style.
     64 	style: u32,
     65 
     66 	//! Font weight.
     67 	weight: u32,
     68 
     69 	//! Font stretch.
     70 	stretch: u32,
     71 }
     72