mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Made all header files to have LABWC_ prefix in include guard identifers. Converted from __LABWC_ in 35 include/ files. Converted from __LAB_ in 5 include/ files. Added LABWC prefix to 3 include/ files. Added include guards to 3 include/ files. The double underscores were removed since according to C standard those "are always reserved for any use".
		
			
				
	
	
		
			57 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			57 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0-only */
 | 
						|
#ifndef LABWC_FONT_H
 | 
						|
#define LABWC_FONT_H
 | 
						|
 | 
						|
struct lab_data_buffer;
 | 
						|
 | 
						|
enum font_slant {
 | 
						|
	FONT_SLANT_NORMAL = 0,
 | 
						|
	FONT_SLANT_ITALIC
 | 
						|
};
 | 
						|
 | 
						|
enum font_weight {
 | 
						|
	FONT_WEIGHT_NORMAL = 0,
 | 
						|
	FONT_WEIGHT_BOLD
 | 
						|
};
 | 
						|
 | 
						|
struct font {
 | 
						|
	char *name;
 | 
						|
	int size;
 | 
						|
	enum font_slant slant;
 | 
						|
	enum font_weight weight;
 | 
						|
};
 | 
						|
 | 
						|
struct _PangoFontDescription *font_to_pango_desc(struct font *font);
 | 
						|
 | 
						|
/**
 | 
						|
 * font_height - get font vertical extents
 | 
						|
 * @font: description of font including family name and size
 | 
						|
 */
 | 
						|
int font_height(struct font *font);
 | 
						|
 | 
						|
/**
 | 
						|
 * font_width - get font horizontal extents
 | 
						|
 * @font: description of font including family name and size
 | 
						|
 */
 | 
						|
int font_width(struct font *font, const char *string);
 | 
						|
 | 
						|
/**
 | 
						|
 * font_buffer_create - Create ARGB8888 lab_data_buffer using pango
 | 
						|
 * @buffer: buffer pointer
 | 
						|
 * @max_width: max allowable width; will be ellipsized if longer
 | 
						|
 * @text: text to be generated as texture
 | 
						|
 * @font: font description
 | 
						|
 * @color: foreground color in rgba format
 | 
						|
 * @arrow: arrow (utf8) character to show or NULL for none
 | 
						|
 */
 | 
						|
void font_buffer_create(struct lab_data_buffer **buffer, int max_width,
 | 
						|
	const char *text, struct font *font, float *color, const char *arrow,
 | 
						|
	double scale);
 | 
						|
 | 
						|
/**
 | 
						|
 * font_finish - free some font related resources
 | 
						|
 * Note: use on exit
 | 
						|
 */
 | 
						|
void font_finish(void);
 | 
						|
 | 
						|
#endif /* LABWC_FONT_H */
 |