You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function called by litehtml to create the font. ```create_font``` returns ```uint_ptr``` that must identify the created font.
@@ -121,16 +121,16 @@ Parameters:
121
121
struct font_description
122
122
{
123
123
std::string family;
124
-
intsize;
125
-
font_stylestyle;
126
-
intweight;
127
-
intdecoration_line;
128
-
css_lengthdecoration_thickness;
129
-
text_decoration_styledecoration_style;
130
-
web_colordecoration_color;
131
-
std::stringemphasis_style;
132
-
web_coloremphasis_color;
133
-
intemphasis_position;
124
+
intsize;
125
+
font_stylestyle;
126
+
intweight;
127
+
intdecoration_line;
128
+
css_lengthdecoration_thickness;
129
+
text_decoration_styledecoration_style;
130
+
web_colordecoration_color;
131
+
std::stringemphasis_style;
132
+
web_coloremphasis_color;
133
+
intemphasis_position;
134
134
};
135
135
```
136
136
*```family``` - Font family name as described in [CSS specifications](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family). You have to select the proper font.
@@ -158,23 +158,23 @@ struct font_description
158
158
```cpp
159
159
structfont_metrics
160
160
{
161
-
int font_size;
162
-
intheight;
163
-
intascent;
164
-
intdescent;
165
-
intx_height;
166
-
int ch_width;
167
-
booldraw_spaces;
168
-
intsub_shift;
169
-
intsuper_shift;
161
+
int font_size;
162
+
intheight;
163
+
intascent;
164
+
intdescent;
165
+
intx_height;
166
+
int ch_width;
167
+
booldraw_spaces;
168
+
intsub_shift;
169
+
intsuper_shift;
170
170
};
171
171
```
172
172
*```font_size``` - the font size in pixels. The same as size argument of the create_font function.
173
173
*```height``` - the recommended vertical distance between baselines when setting consecutive lines of text with the font. This is greater than ```ascent+descent``` by a quantity known as the line spacing or external leading. When space is at a premium, most fonts can be set with only a distance of ```ascent+descent``` between lines.
174
174
*```ascent``` - the distance from the baseline to the top of a line of text.
175
175
*```descent``` - the distance from the baseline to the bottom of a line of text.
176
176
*```x_height``` - height of the symbol x.
177
-
*```ch_width``` - height of the symbol 0.
177
+
*```ch_width``` - width of the symbol 0.
178
178
*```draw_spaces``` - true to call draw text function for spaces. If false, just use space width without draw.
179
179
*```sub_shift``` - the baseline shift for subscripts.
180
180
*```super_shift``` - the baseline shift for superscripts.
@@ -188,7 +188,7 @@ delete the font created in [create_font](#create_font) function
188
188
189
189
### text_width
190
190
```cpp
191
-
virtual int text_width(const char* text, uint_ptr hFont);
You can preload image in this function. litehtml does not cache the images, so you have to create own images cache if you need it.
@@ -358,7 +358,7 @@ class conic_gradient : public gradient_base
358
358
public:
359
359
pointF position;
360
360
float angle;
361
-
float radius;
361
+
float radius;
362
362
};
363
363
```
364
364
*```position``` - the center of the conic gradient
@@ -374,14 +374,14 @@ Draw the element borders here. The parameter ```root``` is ```true``` if you hav
374
374
375
375
### set_caption
376
376
```cpp
377
-
virtualvoid set_caption(const char* caption);
377
+
virtualvoid set_caption(const char* caption);
378
378
```
379
379
380
380
litehtml calls this function with ```<title>``` html tag text. You can use the ```caption``` parameter to set the window caption text into the html page title.
381
381
382
382
### set_base_url
383
383
```cpp
384
-
virtualvoidset_base_url(const char* base_url);
384
+
virtualvoidset_base_url(const char* base_url);
385
385
```
386
386
387
387
litehtml calls this function for the ```<base>``` html tag to set the base url. Save this string for future use in the functions that get the ```baseurl``` parameter.
@@ -416,13 +416,13 @@ litehtml calls this function on mouse event. The parameter **el** is the element
416
416
417
417
### set_cursor
418
418
```cpp
419
-
virtualvoid set_cursor(const char* cursor);
419
+
virtualvoid set_cursor(const char* cursor);
420
420
```
421
421
Define this function to handle the CSS cursor property.
All functions returns the ```bool``` to indicate that you have to redraw the rectangles from *redraw_boxes* vector. Also note the ```x``` and ```y``` are relative to the HTML layout. So ```0,0``` is the top-left corner.
0 commit comments