2010-05-04 20:10:13 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* vlc_text_style.h: text_style_t definition and helpers.
|
|
|
|
*****************************************************************************
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* Copyright (C) 1999-2010 VLC authors and VideoLAN
|
2010-05-04 20:10:13 +02:00
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Authors: Derk-Jan Hartman <hartman _AT_ videolan _DOT_ org>
|
|
|
|
* basOS G <noxelia 4t gmail , com>
|
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2010-05-04 20:10:13 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
2010-05-04 20:10:13 +02:00
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2010-05-04 20:10:13 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VLC_TEXT_STYLE_H
|
|
|
|
#define VLC_TEXT_STYLE_H 1
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Text style
|
|
|
|
*
|
|
|
|
* A text style is used to specify the formatting of text.
|
|
|
|
* A font renderer can use the supplied information to render the
|
|
|
|
* text specified.
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-04-06 14:27:01 +02:00
|
|
|
/* Family font names */
|
2010-05-04 20:10:13 +02:00
|
|
|
char * psz_fontname; /**< The name of the font */
|
2013-09-09 11:32:47 +02:00
|
|
|
char * psz_monofontname; /**< The name of the mono font */
|
2015-04-06 14:27:01 +02:00
|
|
|
|
2015-08-08 22:50:03 +02:00
|
|
|
uint16_t i_features; /**< Feature flags (means non default) */
|
|
|
|
uint16_t i_style_flags; /**< Formatting style flags */
|
|
|
|
|
2015-04-06 14:27:01 +02:00
|
|
|
/* Font style */
|
2015-08-08 22:50:03 +02:00
|
|
|
float f_font_relsize; /**< The font size in % */
|
2010-05-04 20:10:13 +02:00
|
|
|
int i_font_size; /**< The font size in pixels */
|
|
|
|
int i_font_color; /**< The color of the text 0xRRGGBB
|
|
|
|
(native endianness) */
|
2015-08-23 23:50:52 +02:00
|
|
|
uint8_t i_font_alpha; /**< The transparency of the text.*/
|
2015-04-06 14:27:01 +02:00
|
|
|
int i_spacing; /**< The spaceing between glyphs in pixels */
|
|
|
|
|
|
|
|
/* Outline */
|
2010-05-04 20:10:13 +02:00
|
|
|
int i_outline_color; /**< The color of the outline 0xRRGGBB */
|
2015-08-23 23:50:52 +02:00
|
|
|
uint8_t i_outline_alpha; /**< The transparency of the outline */
|
2015-04-06 14:27:01 +02:00
|
|
|
int i_outline_width; /**< The width of the outline in pixels */
|
|
|
|
|
|
|
|
/* Shadow */
|
2010-05-04 20:10:13 +02:00
|
|
|
int i_shadow_color; /**< The color of the shadow 0xRRGGBB */
|
2015-08-23 23:50:52 +02:00
|
|
|
uint8_t i_shadow_alpha; /**< The transparency of the shadow. */
|
2015-04-06 14:27:01 +02:00
|
|
|
int i_shadow_width; /**< The width of the shadow in pixels */
|
|
|
|
|
|
|
|
/* Background (and karaoke) */
|
2010-05-04 20:10:13 +02:00
|
|
|
int i_background_color;/**< The color of the background 0xRRGGBB */
|
2015-08-23 23:50:52 +02:00
|
|
|
uint8_t i_background_alpha;/**< The transparency of the background */
|
2010-05-04 20:10:13 +02:00
|
|
|
int i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
|
2015-08-23 23:50:52 +02:00
|
|
|
uint8_t i_karaoke_background_alpha;/**< The transparency of the karaoke bg */
|
2010-05-04 20:10:13 +02:00
|
|
|
} text_style_t;
|
|
|
|
|
2015-08-23 23:50:52 +02:00
|
|
|
#define STYLE_ALPHA_OPAQUE 0xFF
|
|
|
|
#define STYLE_ALPHA_TRANSPARENT 0x00
|
|
|
|
|
2015-08-08 22:50:03 +02:00
|
|
|
/* 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)
|
|
|
|
|
2010-05-04 20:10:13 +02:00
|
|
|
/* Style flags for \ref text_style_t */
|
2015-08-08 22:50:03 +02:00
|
|
|
#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)
|
2010-05-04 20:10:13 +02:00
|
|
|
|
2015-08-08 22:50:03 +02:00
|
|
|
#define STYLE_DEFAULT_FONT_SIZE 20
|
|
|
|
#define STYLE_DEFAULT_REL_FONT_SIZE 5.0
|
2014-03-21 19:33:39 +01:00
|
|
|
|
2015-04-06 18:42:57 +02:00
|
|
|
|
|
|
|
typedef struct text_segment_t text_segment_t;
|
|
|
|
/**
|
|
|
|
* Text segment for subtitles
|
|
|
|
*
|
|
|
|
* This structure is used to store a formatted text, with mixed styles
|
|
|
|
* Every segment is comprised of one text and a unique style
|
|
|
|
*
|
|
|
|
* On style change, a new segment is created with the next part of text
|
|
|
|
* and the new style, and chained to the list
|
|
|
|
*
|
|
|
|
* Create with text_segment_New and clean the chain with
|
|
|
|
* text_segment_ChainDelete
|
|
|
|
*/
|
|
|
|
struct text_segment_t {
|
|
|
|
char *psz_text; /**< text string of the segment */
|
|
|
|
text_style_t *style; /**< style applied to this segment */
|
|
|
|
text_segment_t *p_next; /**< next segment */
|
|
|
|
};
|
|
|
|
|
2010-05-04 20:10:13 +02:00
|
|
|
/**
|
|
|
|
* Create a default text style
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API text_style_t * text_style_New( void );
|
2010-05-04 20:10:13 +02:00
|
|
|
|
2015-08-12 15:11:41 +02:00
|
|
|
/**
|
|
|
|
* Create a text style
|
|
|
|
*
|
|
|
|
* Set feature flags as argument if you want to set style defaults
|
|
|
|
*/
|
|
|
|
VLC_API text_style_t * text_style_Create( int );
|
|
|
|
|
2010-05-04 20:10:13 +02:00
|
|
|
/**
|
|
|
|
* Copy a text style into another
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API text_style_t * text_style_Copy( text_style_t *, const text_style_t * );
|
2010-05-04 20:10:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Duplicate a text style
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API text_style_t * text_style_Duplicate( const text_style_t * );
|
2010-05-04 20:10:13 +02:00
|
|
|
|
2015-08-09 00:13:50 +02:00
|
|
|
/**
|
|
|
|
* Merge two styles using non default values
|
|
|
|
*
|
|
|
|
* Set b_override to true if you also want to overwrite non-defaults
|
|
|
|
*/
|
|
|
|
VLC_API void text_style_Merge( text_style_t *, const text_style_t *, bool b_override );
|
|
|
|
|
2010-05-04 20:10:13 +02:00
|
|
|
/**
|
|
|
|
* Delete a text style created by text_style_New or text_style_Duplicate
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API void text_style_Delete( text_style_t * );
|
2010-05-04 20:10:13 +02:00
|
|
|
|
2015-04-06 18:42:57 +02:00
|
|
|
/**
|
|
|
|
* This function will create a new text segment.
|
|
|
|
*
|
|
|
|
* You should use text_segment_ChainDelete to destroy it, to clean all
|
2015-07-08 11:07:35 +02:00
|
|
|
* the linked segments, or text_segment_Delete to free a specic one
|
2015-04-06 18:42:57 +02:00
|
|
|
*
|
|
|
|
* This duplicates the string passed as argument
|
|
|
|
*/
|
|
|
|
VLC_API text_segment_t *text_segment_New( const char * );
|
|
|
|
|
2015-07-27 20:54:26 +02:00
|
|
|
/**
|
|
|
|
* This function will create a new text segment and duplicates the style passed as argument
|
|
|
|
*
|
|
|
|
* You should use text_segment_ChainDelete to destroy it, to clean all
|
|
|
|
* the linked segments, or text_segment_Delete to free a specic one
|
|
|
|
*
|
|
|
|
* This doesn't initialize the text.
|
|
|
|
*/
|
|
|
|
VLC_API text_segment_t *text_segment_NewInheritStyle( const text_style_t* p_style );
|
|
|
|
|
2015-07-08 11:07:35 +02:00
|
|
|
/**
|
|
|
|
* Delete a text segment and its content.
|
|
|
|
*
|
|
|
|
* This assumes the segment is not part of a chain
|
|
|
|
*/
|
|
|
|
VLC_API void text_segment_Delete( text_segment_t * );
|
|
|
|
|
2015-04-06 18:42:57 +02:00
|
|
|
/**
|
|
|
|
* This function will destroy a list of text segments allocated
|
|
|
|
* by text_segment_New.
|
|
|
|
*
|
|
|
|
* You may pass it NULL.
|
|
|
|
*/
|
|
|
|
VLC_API void text_segment_ChainDelete( text_segment_t * );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function will copy a text_segment and its chain into a new one
|
|
|
|
*
|
|
|
|
* You may give it NULL, but it will return NULL.
|
|
|
|
*/
|
|
|
|
VLC_API text_segment_t * text_segment_Copy( text_segment_t * );
|
|
|
|
|
2015-09-16 11:03:13 +02:00
|
|
|
static const struct {
|
|
|
|
const char *psz_name;
|
|
|
|
uint32_t i_value;
|
|
|
|
} p_html_colors[] = {
|
|
|
|
/* Official html colors */
|
|
|
|
{ "Aqua", 0x00FFFF },
|
|
|
|
{ "Black", 0x000000 },
|
|
|
|
{ "Blue", 0x0000FF },
|
|
|
|
{ "Fuchsia", 0xFF00FF },
|
|
|
|
{ "Gray", 0x808080 },
|
|
|
|
{ "Green", 0x008000 },
|
|
|
|
{ "Lime", 0x00FF00 },
|
|
|
|
{ "Maroon", 0x800000 },
|
|
|
|
{ "Navy", 0x000080 },
|
|
|
|
{ "Olive", 0x808000 },
|
|
|
|
{ "Purple", 0x800080 },
|
|
|
|
{ "Red", 0xFF0000 },
|
|
|
|
{ "Silver", 0xC0C0C0 },
|
|
|
|
{ "Teal", 0x008080 },
|
|
|
|
{ "White", 0xFFFFFF },
|
|
|
|
{ "Yellow", 0xFFFF00 },
|
|
|
|
|
|
|
|
/* Common ones */
|
|
|
|
{ "AliceBlue", 0xF0F8FF },
|
|
|
|
{ "AntiqueWhite", 0xFAEBD7 },
|
|
|
|
{ "Aqua", 0x00FFFF },
|
|
|
|
{ "Aquamarine", 0x7FFFD4 },
|
|
|
|
{ "Azure", 0xF0FFFF },
|
|
|
|
{ "Beige", 0xF5F5DC },
|
|
|
|
{ "Bisque", 0xFFE4C4 },
|
|
|
|
{ "Black", 0x000000 },
|
|
|
|
{ "BlanchedAlmond", 0xFFEBCD },
|
|
|
|
{ "Blue", 0x0000FF },
|
|
|
|
{ "BlueViolet", 0x8A2BE2 },
|
|
|
|
{ "Brown", 0xA52A2A },
|
|
|
|
{ "BurlyWood", 0xDEB887 },
|
|
|
|
{ "CadetBlue", 0x5F9EA0 },
|
|
|
|
{ "Chartreuse", 0x7FFF00 },
|
|
|
|
{ "Chocolate", 0xD2691E },
|
|
|
|
{ "Coral", 0xFF7F50 },
|
|
|
|
{ "CornflowerBlue", 0x6495ED },
|
|
|
|
{ "Cornsilk", 0xFFF8DC },
|
|
|
|
{ "Crimson", 0xDC143C },
|
|
|
|
{ "Cyan", 0x00FFFF },
|
|
|
|
{ "DarkBlue", 0x00008B },
|
|
|
|
{ "DarkCyan", 0x008B8B },
|
|
|
|
{ "DarkGoldenRod", 0xB8860B },
|
|
|
|
{ "DarkGray", 0xA9A9A9 },
|
|
|
|
{ "DarkGrey", 0xA9A9A9 },
|
|
|
|
{ "DarkGreen", 0x006400 },
|
|
|
|
{ "DarkKhaki", 0xBDB76B },
|
|
|
|
{ "DarkMagenta", 0x8B008B },
|
|
|
|
{ "DarkOliveGreen", 0x556B2F },
|
|
|
|
{ "Darkorange", 0xFF8C00 },
|
|
|
|
{ "DarkOrchid", 0x9932CC },
|
|
|
|
{ "DarkRed", 0x8B0000 },
|
|
|
|
{ "DarkSalmon", 0xE9967A },
|
|
|
|
{ "DarkSeaGreen", 0x8FBC8F },
|
|
|
|
{ "DarkSlateBlue", 0x483D8B },
|
|
|
|
{ "DarkSlateGray", 0x2F4F4F },
|
|
|
|
{ "DarkSlateGrey", 0x2F4F4F },
|
|
|
|
{ "DarkTurquoise", 0x00CED1 },
|
|
|
|
{ "DarkViolet", 0x9400D3 },
|
|
|
|
{ "DeepPink", 0xFF1493 },
|
|
|
|
{ "DeepSkyBlue", 0x00BFFF },
|
|
|
|
{ "DimGray", 0x696969 },
|
|
|
|
{ "DimGrey", 0x696969 },
|
|
|
|
{ "DodgerBlue", 0x1E90FF },
|
|
|
|
{ "FireBrick", 0xB22222 },
|
|
|
|
{ "FloralWhite", 0xFFFAF0 },
|
|
|
|
{ "ForestGreen", 0x228B22 },
|
|
|
|
{ "Fuchsia", 0xFF00FF },
|
|
|
|
{ "Gainsboro", 0xDCDCDC },
|
|
|
|
{ "GhostWhite", 0xF8F8FF },
|
|
|
|
{ "Gold", 0xFFD700 },
|
|
|
|
{ "GoldenRod", 0xDAA520 },
|
|
|
|
{ "Gray", 0x808080 },
|
|
|
|
{ "Grey", 0x808080 },
|
|
|
|
{ "Green", 0x008000 },
|
|
|
|
{ "GreenYellow", 0xADFF2F },
|
|
|
|
{ "HoneyDew", 0xF0FFF0 },
|
|
|
|
{ "HotPink", 0xFF69B4 },
|
|
|
|
{ "IndianRed", 0xCD5C5C },
|
|
|
|
{ "Indigo", 0x4B0082 },
|
|
|
|
{ "Ivory", 0xFFFFF0 },
|
|
|
|
{ "Khaki", 0xF0E68C },
|
|
|
|
{ "Lavender", 0xE6E6FA },
|
|
|
|
{ "LavenderBlush", 0xFFF0F5 },
|
|
|
|
{ "LawnGreen", 0x7CFC00 },
|
|
|
|
{ "LemonChiffon", 0xFFFACD },
|
|
|
|
{ "LightBlue", 0xADD8E6 },
|
|
|
|
{ "LightCoral", 0xF08080 },
|
|
|
|
{ "LightCyan", 0xE0FFFF },
|
|
|
|
{ "LightGoldenRodYellow", 0xFAFAD2 },
|
|
|
|
{ "LightGray", 0xD3D3D3 },
|
|
|
|
{ "LightGrey", 0xD3D3D3 },
|
|
|
|
{ "LightGreen", 0x90EE90 },
|
|
|
|
{ "LightPink", 0xFFB6C1 },
|
|
|
|
{ "LightSalmon", 0xFFA07A },
|
|
|
|
{ "LightSeaGreen", 0x20B2AA },
|
|
|
|
{ "LightSkyBlue", 0x87CEFA },
|
|
|
|
{ "LightSlateGray", 0x778899 },
|
|
|
|
{ "LightSlateGrey", 0x778899 },
|
|
|
|
{ "LightSteelBlue", 0xB0C4DE },
|
|
|
|
{ "LightYellow", 0xFFFFE0 },
|
|
|
|
{ "Lime", 0x00FF00 },
|
|
|
|
{ "LimeGreen", 0x32CD32 },
|
|
|
|
{ "Linen", 0xFAF0E6 },
|
|
|
|
{ "Magenta", 0xFF00FF },
|
|
|
|
{ "Maroon", 0x800000 },
|
|
|
|
{ "MediumAquaMarine", 0x66CDAA },
|
|
|
|
{ "MediumBlue", 0x0000CD },
|
|
|
|
{ "MediumOrchid", 0xBA55D3 },
|
|
|
|
{ "MediumPurple", 0x9370D8 },
|
|
|
|
{ "MediumSeaGreen", 0x3CB371 },
|
|
|
|
{ "MediumSlateBlue", 0x7B68EE },
|
|
|
|
{ "MediumSpringGreen", 0x00FA9A },
|
|
|
|
{ "MediumTurquoise", 0x48D1CC },
|
|
|
|
{ "MediumVioletRed", 0xC71585 },
|
|
|
|
{ "MidnightBlue", 0x191970 },
|
|
|
|
{ "MintCream", 0xF5FFFA },
|
|
|
|
{ "MistyRose", 0xFFE4E1 },
|
|
|
|
{ "Moccasin", 0xFFE4B5 },
|
|
|
|
{ "NavajoWhite", 0xFFDEAD },
|
|
|
|
{ "Navy", 0x000080 },
|
|
|
|
{ "OldLace", 0xFDF5E6 },
|
|
|
|
{ "Olive", 0x808000 },
|
|
|
|
{ "OliveDrab", 0x6B8E23 },
|
|
|
|
{ "Orange", 0xFFA500 },
|
|
|
|
{ "OrangeRed", 0xFF4500 },
|
|
|
|
{ "Orchid", 0xDA70D6 },
|
|
|
|
{ "PaleGoldenRod", 0xEEE8AA },
|
|
|
|
{ "PaleGreen", 0x98FB98 },
|
|
|
|
{ "PaleTurquoise", 0xAFEEEE },
|
|
|
|
{ "PaleVioletRed", 0xD87093 },
|
|
|
|
{ "PapayaWhip", 0xFFEFD5 },
|
|
|
|
{ "PeachPuff", 0xFFDAB9 },
|
|
|
|
{ "Peru", 0xCD853F },
|
|
|
|
{ "Pink", 0xFFC0CB },
|
|
|
|
{ "Plum", 0xDDA0DD },
|
|
|
|
{ "PowderBlue", 0xB0E0E6 },
|
|
|
|
{ "Purple", 0x800080 },
|
2015-10-16 00:44:45 +02:00
|
|
|
{ "RebeccaPurple", 0x663399 },
|
2015-09-16 11:03:13 +02:00
|
|
|
{ "Red", 0xFF0000 },
|
|
|
|
{ "RosyBrown", 0xBC8F8F },
|
|
|
|
{ "RoyalBlue", 0x4169E1 },
|
|
|
|
{ "SaddleBrown", 0x8B4513 },
|
|
|
|
{ "Salmon", 0xFA8072 },
|
|
|
|
{ "SandyBrown", 0xF4A460 },
|
|
|
|
{ "SeaGreen", 0x2E8B57 },
|
|
|
|
{ "SeaShell", 0xFFF5EE },
|
|
|
|
{ "Sienna", 0xA0522D },
|
|
|
|
{ "Silver", 0xC0C0C0 },
|
|
|
|
{ "SkyBlue", 0x87CEEB },
|
|
|
|
{ "SlateBlue", 0x6A5ACD },
|
|
|
|
{ "SlateGray", 0x708090 },
|
|
|
|
{ "SlateGrey", 0x708090 },
|
|
|
|
{ "Snow", 0xFFFAFA },
|
|
|
|
{ "SpringGreen", 0x00FF7F },
|
|
|
|
{ "SteelBlue", 0x4682B4 },
|
|
|
|
{ "Tan", 0xD2B48C },
|
|
|
|
{ "Teal", 0x008080 },
|
|
|
|
{ "Thistle", 0xD8BFD8 },
|
|
|
|
{ "Tomato", 0xFF6347 },
|
|
|
|
{ "Turquoise", 0x40E0D0 },
|
|
|
|
{ "Violet", 0xEE82EE },
|
|
|
|
{ "Wheat", 0xF5DEB3 },
|
|
|
|
{ "White", 0xFFFFFF },
|
|
|
|
{ "WhiteSmoke", 0xF5F5F5 },
|
|
|
|
{ "Yellow", 0xFFFF00 },
|
|
|
|
{ "YellowGreen", 0x9ACD32 },
|
|
|
|
|
|
|
|
{ NULL, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an integer representation of an HTML color.
|
|
|
|
*
|
|
|
|
* @param psz_value An HTML color, which can be either:
|
|
|
|
* - A standard HTML color (red, cyan, ...) as defined in p_html_colors
|
|
|
|
* - An hexadecimal color, of the form [#][AA]RRGGBB
|
|
|
|
* @param ok If non-null, true will be stored in this pointer to signal
|
|
|
|
* a successful conversion
|
|
|
|
*/
|
|
|
|
VLC_API unsigned int vlc_html_color( const char *psz_value, bool* ok );
|
|
|
|
|
2010-05-04 20:10:13 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* VLC_TEXT_STYLE_H */
|
|
|
|
|