Commit 3baf2006 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Backport font renderer improvements.

-------
quartztext: Reenable quartztext along with some enhancements.

First, set a text drop shadow because we can, and it is nice for readability.
Then, correct behaviour for border color: minimum size to 1.0, where current code max it to 1.0, and comment the contrary.
(cherry picked from commit eb5bc9eb)

Conflicts:

	modules/misc/quartztext.c

quartztext: Use 10.4 compatible alternative to kCGColorBlack
(cherry picked from commit f0d84d01)

quartztext: fix [f0d84d01]. white is not block
(cherry picked from commit e096835f)

quartztext: One more fix to  [f0d84d01]

This properly creates the colorspace.
(cherry picked from commit 05128dd4)
parent fc281340
......@@ -121,7 +121,7 @@ vlc_module_begin();
add_integer( "quartztext-color", 0x00FFFFFF, NULL, COLOR_TEXT,
COLOR_LONGTEXT, false );
change_integer_list( pi_color_values, ppsz_color_descriptions, NULL );
set_capability( "text renderer", 120 );
set_capability( "text renderer", 150 );
add_shortcut( "text" );
set_callbacks( Create, Destroy );
vlc_module_end();
......@@ -1046,7 +1046,9 @@ static offscreen_bitmap_t *Compose( int i_text_align, UniChar *psz_utf16_str, ui
// Set up black outlining of the text --
CGContextSetRGBStrokeColor( p_context, 0, 0, 0, 0.5 );
CGContextSetTextDrawingMode( p_context, kCGTextFillStroke );
CGContextSetShadow( p_context, CGSizeMake( 0, 0 ), 5 );
float black_components[4] = {0, 0, 0, 1};
CGContextSetShadowWithColor (p_context, CGSizeMake( 0, 0 ), 5, CGColorCreate( CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB ), black_components ));
do
{
// ATSUBreakLine will automatically pick up any manual '\n's also
......@@ -1068,8 +1070,7 @@ static offscreen_bitmap_t *Compose( int i_text_align, UniChar *psz_utf16_str, ui
// Set the outlining for this line to be dependent on the size of the line -
// make it about 5% of the ascent, with a minimum at 1.0
float f_thickness = FixedToFloat( ascent ) * 0.05;
CGContextSetLineWidth( p_context, (( f_thickness > 1.0 ) ? 1.0 : f_thickness ));
CGContextSetLineWidth( p_context, (( f_thickness < 1.0 ) ? 1.0 : f_thickness ));
ATSUDrawText( p_textLayout, i_start, i_end - i_start, x, y );
// and now prepare for the next line by coming down far enough for our
......
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