1*2d1272b8SAndroid Build Coastguard Worker /* 2*2d1272b8SAndroid Build Coastguard Worker * Copyright © 2019 Ebrahim Byagowi 3*2d1272b8SAndroid Build Coastguard Worker * 4*2d1272b8SAndroid Build Coastguard Worker * This is part of HarfBuzz, a text shaping library. 5*2d1272b8SAndroid Build Coastguard Worker * 6*2d1272b8SAndroid Build Coastguard Worker * Permission is hereby granted, without written agreement and without 7*2d1272b8SAndroid Build Coastguard Worker * license or royalty fees, to use, copy, modify, and distribute this 8*2d1272b8SAndroid Build Coastguard Worker * software and its documentation for any purpose, provided that the 9*2d1272b8SAndroid Build Coastguard Worker * above copyright notice and the following two paragraphs appear in 10*2d1272b8SAndroid Build Coastguard Worker * all copies of this software. 11*2d1272b8SAndroid Build Coastguard Worker * 12*2d1272b8SAndroid Build Coastguard Worker * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR 13*2d1272b8SAndroid Build Coastguard Worker * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 14*2d1272b8SAndroid Build Coastguard Worker * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN 15*2d1272b8SAndroid Build Coastguard Worker * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 16*2d1272b8SAndroid Build Coastguard Worker * DAMAGE. 17*2d1272b8SAndroid Build Coastguard Worker * 18*2d1272b8SAndroid Build Coastguard Worker * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, 19*2d1272b8SAndroid Build Coastguard Worker * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20*2d1272b8SAndroid Build Coastguard Worker * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 21*2d1272b8SAndroid Build Coastguard Worker * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO 22*2d1272b8SAndroid Build Coastguard Worker * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 23*2d1272b8SAndroid Build Coastguard Worker */ 24*2d1272b8SAndroid Build Coastguard Worker 25*2d1272b8SAndroid Build Coastguard Worker #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR) 26*2d1272b8SAndroid Build Coastguard Worker #error "Include <hb.h> instead." 27*2d1272b8SAndroid Build Coastguard Worker #endif 28*2d1272b8SAndroid Build Coastguard Worker 29*2d1272b8SAndroid Build Coastguard Worker #ifndef HB_STYLE_H 30*2d1272b8SAndroid Build Coastguard Worker #define HB_STYLE_H 31*2d1272b8SAndroid Build Coastguard Worker 32*2d1272b8SAndroid Build Coastguard Worker #include "hb.h" 33*2d1272b8SAndroid Build Coastguard Worker 34*2d1272b8SAndroid Build Coastguard Worker HB_BEGIN_DECLS 35*2d1272b8SAndroid Build Coastguard Worker 36*2d1272b8SAndroid Build Coastguard Worker /** 37*2d1272b8SAndroid Build Coastguard Worker * hb_style_tag_t: 38*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_ITALIC: Used to vary between non-italic and italic. 39*2d1272b8SAndroid Build Coastguard Worker * A value of 0 can be interpreted as "Roman" (non-italic); a value of 1 can 40*2d1272b8SAndroid Build Coastguard Worker * be interpreted as (fully) italic. 41*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_OPTICAL_SIZE: Used to vary design to suit different text sizes. 42*2d1272b8SAndroid Build Coastguard Worker * Non-zero. Values can be interpreted as text size, in points. 43*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_SLANT_ANGLE: Used to vary between upright and slanted text. Values 44*2d1272b8SAndroid Build Coastguard Worker * must be greater than -90 and less than +90. Values can be interpreted as 45*2d1272b8SAndroid Build Coastguard Worker * the angle, in counter-clockwise degrees, of oblique slant from whatever the 46*2d1272b8SAndroid Build Coastguard Worker * designer considers to be upright for that font design. Typical right-leaning 47*2d1272b8SAndroid Build Coastguard Worker * Italic fonts have a negative slant angle (typically around -12) 48*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_SLANT_RATIO: same as @HB_STYLE_TAG_SLANT_ANGLE expression as ratio. 49*2d1272b8SAndroid Build Coastguard Worker * Typical right-leaning Italic fonts have a positive slant ratio (typically around 0.2) 50*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_WIDTH: Used to vary width of text from narrower to wider. 51*2d1272b8SAndroid Build Coastguard Worker * Non-zero. Values can be interpreted as a percentage of whatever the font 52*2d1272b8SAndroid Build Coastguard Worker * designer considers “normal width” for that font design. 53*2d1272b8SAndroid Build Coastguard Worker * @HB_STYLE_TAG_WEIGHT: Used to vary stroke thicknesses or other design details 54*2d1272b8SAndroid Build Coastguard Worker * to give variation from lighter to blacker. Values can be interpreted in direct 55*2d1272b8SAndroid Build Coastguard Worker * comparison to values for usWeightClass in the OS/2 table, 56*2d1272b8SAndroid Build Coastguard Worker * or the CSS font-weight property. 57*2d1272b8SAndroid Build Coastguard Worker * 58*2d1272b8SAndroid Build Coastguard Worker * Defined by [OpenType Design-Variation Axis Tag Registry](https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg). 59*2d1272b8SAndroid Build Coastguard Worker * 60*2d1272b8SAndroid Build Coastguard Worker * Since: 3.0.0 61*2d1272b8SAndroid Build Coastguard Worker **/ 62*2d1272b8SAndroid Build Coastguard Worker typedef enum 63*2d1272b8SAndroid Build Coastguard Worker { 64*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_ITALIC = HB_TAG ('i','t','a','l'), 65*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_OPTICAL_SIZE = HB_TAG ('o','p','s','z'), 66*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_SLANT_ANGLE = HB_TAG ('s','l','n','t'), 67*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_SLANT_RATIO = HB_TAG ('S','l','n','t'), 68*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_WIDTH = HB_TAG ('w','d','t','h'), 69*2d1272b8SAndroid Build Coastguard Worker HB_STYLE_TAG_WEIGHT = HB_TAG ('w','g','h','t'), 70*2d1272b8SAndroid Build Coastguard Worker 71*2d1272b8SAndroid Build Coastguard Worker /*< private >*/ 72*2d1272b8SAndroid Build Coastguard Worker _HB_STYLE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ 73*2d1272b8SAndroid Build Coastguard Worker } hb_style_tag_t; 74*2d1272b8SAndroid Build Coastguard Worker 75*2d1272b8SAndroid Build Coastguard Worker 76*2d1272b8SAndroid Build Coastguard Worker HB_EXTERN float 77*2d1272b8SAndroid Build Coastguard Worker hb_style_get_value (hb_font_t *font, hb_style_tag_t style_tag); 78*2d1272b8SAndroid Build Coastguard Worker 79*2d1272b8SAndroid Build Coastguard Worker HB_END_DECLS 80*2d1272b8SAndroid Build Coastguard Worker 81*2d1272b8SAndroid Build Coastguard Worker #endif /* HB_STYLE_H */ 82