Commit dce9f3d2 authored by Luca Barbato's avatar Luca Barbato Committed by Rafaël Carré

configure: provide --with options to override default fonts

Most distributions have fonts in paths different from defaults.
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent 30b5874f
......@@ -3109,6 +3109,28 @@ AC_ARG_ENABLE(fribidi,
AC_ARG_ENABLE(fontconfig,
[ --enable-fontconfig fontconfig support (default auto)])
AC_ARG_WITH([default-font],
AS_HELP_STRING([--with-default-font=PATH],
[Path to the default font]),
[AC_DEFINE_UNQUOTED([DEFAULT_FONT_FILE],
"$withval", [Default font])])
AC_ARG_WITH([default-monospace-font],
AS_HELP_STRING([--with-default-monospace-font=PATH],
[Path to the default font]),
[AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FONT_FILE],
"$withval", [Default monospace font])])
AC_ARG_WITH([default-font-family],
AS_HELP_STRING([--with-default-font-family=NAME],
[Path to the default font family]),
[AC_DEFINE_UNQUOTED([DEFAULT_FAMILY],
"$withval", [Default font family])])
AC_ARG_WITH([default-monospace-font-family],
AS_HELP_STRING([--with-default-monospace-font-family=NAME],
[Path to the default font family]),
[AC_DEFINE_UNQUOTED([DEFAULT_MONOSPACE_FAMILY],
"$withval", [Default monospace font family])])
if test "${enable_freetype}" != "no"; then
PKG_CHECK_MODULES(FREETYPE, freetype2, [
have_freetype=yes
......
......@@ -47,30 +47,46 @@
/* Default fonts */
#ifdef __APPLE__
# define DEFAULT_FONT_FILE "/Library/Fonts/Arial Unicode.ttf"
# define DEFAULT_FAMILY "Arial Unicode MS"
# define DEFAULT_MONOSPACE_FONT_FILE "/System/Library/Fonts/Monaco.dfont"
# define DEFAULT_MONOSPACE_FAMILY "Monaco"
# define SYSTEM_DEFAULT_FONT_FILE "/Library/Fonts/Arial Unicode.ttf"
# define SYSTEM_DEFAULT_FAMILY "Arial Unicode MS"
# define SYSTEM_DEFAULT_MONOSPACE_FONT_FILE "/System/Library/Fonts/Monaco.dfont"
# define SYSTEM_DEFAULT_MONOSPACE_FAMILY "Monaco"
#elif defined( WIN32 )
# define DEFAULT_FONT_FILE "arial.ttf" /* Default path font found at run-time */
# define DEFAULT_FAMILY "Arial"
# define DEFAULT_MONOSPACE_FONT_FILE "cour.ttf"
# define DEFAULT_MONOSPACE_FAMILY "Courier New"
# define SYSTEM_DEFAULT_FONT_FILE "arial.ttf" /* Default path font found at run-time */
# define SYSTEM_DEFAULT_FAMILY "Arial"
# define SYSTEM_DEFAULT_MONOSPACE_FONT_FILE "cour.ttf"
# define SYSTEM_DEFAULT_MONOSPACE_FAMILY "Courier New"
#elif defined( __OS2__ )
# define DEFAULT_FONT_FILE "/psfonts/tnrwt_k.ttf"
# define DEFAULT_FAMILY "Times New Roman WT K"
# define DEFAULT_MONOSPACE_FONT_FILE "/psfonts/mtsansdk.ttf"
# define DEFAULT_MONOSPACE_FAMILY "Monotype Sans Duospace WT K"
# define SYSTEM_DEFAULT_FONT_FILE "/psfonts/tnrwt_k.ttf"
# define SYSTEM_DEFAULT_FAMILY "Times New Roman WT K"
# define SYSTEM_DEFAULT_MONOSPACE_FONT_FILE "/psfonts/mtsansdk.ttf"
# define SYSTEM_DEFAULT_MONOSPACE_FAMILY "Monotype Sans Duospace WT K"
#elif defined( __ANDROID__ )
# define DEFAULT_FONT_FILE "/system/fonts/DroidSans-Bold.ttf"
# define DEFAULT_FAMILY "Droid Sans Bold"
# define DEFAULT_MONOSPACE_FONT_FILE "/system/fonts/DroidSansMono.ttf"
# define DEFAULT_MONOSPACE_FAMILY "Droid Sans Mono"
# define SYSTEM_DEFAULT_FONT_FILE "/system/fonts/DroidSans-Bold.ttf"
# define SYSTEM_DEFAULT_FAMILY "Droid Sans Bold"
# define SYSTEM_DEFAULT_MONOSPACE_FONT_FILE "/system/fonts/DroidSansMono.ttf"
# define SYSTEM_DEFAULT_MONOSPACE_FAMILY "Droid Sans Mono"
#else
# define DEFAULT_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
# define DEFAULT_FAMILY "Serif Bold"
# define DEFAULT_MONOSPACE_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeMono.ttf"
# define DEFAULT_MONOSPACE_FAMILY "Monospace"
# define SYSTEM_DEFAULT_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeSerifBold.ttf"
# define SYSTEM_DEFAULT_FAMILY "Serif Bold"
# define SYSTEM_DEFAULT_MONOSPACE_FONT_FILE "/usr/share/fonts/truetype/freefont/FreeMono.ttf"
# define SYSTEM_DEFAULT_MONOSPACE_FAMILY "Monospace"
#endif
#ifndef DEFAULT_FONT_FILE
#define DEFAULT_FONT_FILE SYSTEM_DEFAULT_FONT_FILE
#endif
#ifndef DEFAULT_FAMILY
#define DEFAULT_FAMILY SYSTEM_DEFAULT_FAMILY
#endif
#ifndef DEFAULT_MONOSPACE_FONT_FILE
#define DEFAULT_MONOSPACE_FONT_FILE SYSTEM_DEFAULT_MONOSPACE_FONT_FILE
#endif
#ifndef DEFAULT_MONOSPACE_FAMILY
#define DEFAULT_MONOSPACE_FAMILY SYSTEM_DEFAULT_MONOSPACE_FAMILY
#endif
/* Freetype */
......
......@@ -84,6 +84,16 @@ static void Close ( vlc_object_t * );
# define PRESET_PATH "/usr/share/projectM/presets"
#endif
#ifdef DEFAULT_FONT_FILE
#undef FONT_PATH
#define FONT_PATH DEFAULT_FONT_FILE
#endif
#ifdef DEFAULT_MONOSPACE_FONT_FILE
#undef FONT_PATH_MENU
#define FONT_PATH_MENU DEFAULT_MONOSPACE_FONT_FILE
#endif
vlc_module_begin ()
set_shortname( N_("projectM"))
set_description( N_("libprojectM effect") )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment