[vlc-devel] commit: Backport font renderer improvements. (Pierre d'Herbemont )

git version control git at videolan.org
Sat Sep 20 00:34:05 CEST 2008


vlc | branch: 0.9-bugfix | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Sep 20 00:34:40 2008 +0200| [3baf2006c81bc6f93360ad0d43642c27e85a2f65] | committer: 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 eb5bc9eb9ce3305dc7f8183aecc46c6b1e849cf6)

Conflicts:

	modules/misc/quartztext.c

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

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

quartztext: One more fix to  [f0d84d019c8c240c47672b82be123dc979b8d09e]

This properly creates the colorspace.
(cherry picked from commit 05128dd4d0ee08aec1045309d664e39ac1a5583a)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3baf2006c81bc6f93360ad0d43642c27e85a2f65
---

 modules/misc/quartztext.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index ac8468d..bf739de 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -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




More information about the vlc-devel mailing list