Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
acd27a20
Commit
acd27a20
authored
Aug 08, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text_style: add style members presence flags
because you can't tell if members are have set value or are unset.
parent
fb51deba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
13 deletions
+34
-13
include/vlc_text_style.h
include/vlc_text_style.h
+31
-12
src/misc/text_style.c
src/misc/text_style.c
+3
-1
No files found.
include/vlc_text_style.h
View file @
acd27a20
...
...
@@ -42,14 +42,17 @@ typedef struct
char
*
psz_fontname
;
/**< The name of the font */
char
*
psz_monofontname
;
/**< The name of the mono font */
uint16_t
i_features
;
/**< Feature flags (means non default) */
uint16_t
i_style_flags
;
/**< Formatting style flags */
/* Font style */
float
f_font_relsize
;
/**< The font size in % */
int
i_font_size
;
/**< The font size in pixels */
int
i_font_color
;
/**< The color of the text 0xRRGGBB
(native endianness) */
uint8_t
i_font_alpha
;
/**< The transparency of the text.
0x00 is fully opaque,
0xFF fully transparent */
uint16_t
i_style_flags
;
/**< Formatting style flags */
int
i_spacing
;
/**< The spaceing between glyphs in pixels */
/* Outline */
...
...
@@ -77,18 +80,34 @@ typedef struct
0xFF fully transparent */
}
text_style_t
;
/* Features flags for \ref i_features */
#define STYLE_NO_DEFAULTS 0x0
#define STYLE_FULLY_SET 0xFFFF
#define STYLE_HAS_FONT_COLOR (1 << 0)
#define STYLE_HAS_FONT_ALPHA (1 << 1)
#define STYLE_HAS_FLAGS (1 << 2)
#define STYLE_HAS_OUTLINE_COLOR (1 << 3)
#define STYLE_HAS_OUTLINE_ALPHA (1 << 4)
#define STYLE_HAS_SHADOW_COLOR (1 << 5)
#define STYLE_HAS_SHADOW_ALPHA (1 << 6)
#define STYLE_HAS_BACKGROUND_COLOR (1 << 7)
#define STYLE_HAS_BACKGROUND_ALPHA (1 << 8)
#define STYLE_HAS_K_BACKGROUND_COLOR (1 << 9)
#define STYLE_HAS_K_BACKGROUND_ALPHA (1 << 10)
/* Style flags for \ref text_style_t */
#define STYLE_BOLD 1
#define STYLE_ITALIC 2
#define STYLE_OUTLINE 4
#define STYLE_SHADOW 8
#define STYLE_BACKGROUND 16
#define STYLE_UNDERLINE 32
#define STYLE_STRIKEOUT 64
#define STYLE_HALFWIDTH 128
#define STYLE_MONOSPACED 256
#define STYLE_DEFAULT_FONT_SIZE 22
#define STYLE_BOLD (1 << 0)
#define STYLE_ITALIC (1 << 1)
#define STYLE_OUTLINE (1 << 2)
#define STYLE_SHADOW (1 << 3)
#define STYLE_BACKGROUND (1 << 4)
#define STYLE_UNDERLINE (1 << 5)
#define STYLE_STRIKEOUT (1 << 6)
#define STYLE_HALFWIDTH (1 << 7)
#define STYLE_MONOSPACED (1 << 8)
#define STYLE_DEFAULT_FONT_SIZE 20
#define STYLE_DEFAULT_REL_FONT_SIZE 5.0
typedef
struct
text_segment_t
text_segment_t
;
...
...
src/misc/text_style.c
View file @
acd27a20
...
...
@@ -38,10 +38,12 @@ text_style_t *text_style_New( void )
/* initialize to default text style */
p_style
->
psz_fontname
=
NULL
;
p_style
->
psz_monofontname
=
NULL
;
p_style
->
i_features
=
STYLE_FULLY_SET
;
p_style
->
i_style_flags
=
STYLE_OUTLINE
;
p_style
->
f_font_relsize
=
STYLE_DEFAULT_REL_FONT_SIZE
;
p_style
->
i_font_size
=
STYLE_DEFAULT_FONT_SIZE
;
p_style
->
i_font_color
=
0xffffff
;
p_style
->
i_font_alpha
=
0xff
;
p_style
->
i_style_flags
=
STYLE_OUTLINE
;
p_style
->
i_outline_color
=
0x000000
;
p_style
->
i_outline_alpha
=
0xff
;
p_style
->
i_shadow_color
=
0x000000
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment