[vlc-devel] commit: quartztext: Reenable quartztext along with some enhancements. ( Pierre d'Herbemont )

git version control git at videolan.org
Tue Sep 16 23:51:14 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Sep 16 23:51:22 2008 +0200| [eb5bc9eb9ce3305dc7f8183aecc46c6b1e849cf6] | committer: Pierre d'Herbemont 

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.

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

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

diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index 8ba9757..485ac12 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", 0 ); // Freetype is better than us
+    set_capability( "text renderer", 150 );
     add_shortcut( "text" );
     set_callbacks( Create, Destroy );
 vlc_module_end();
@@ -1233,7 +1233,8 @@ 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 );
+            CGContextSetShadowWithColor (p_context, CGSizeMake( 0, 0 ), 5, CGColorGetConstantColor(kCGColorBlack));
             do
             {
                 // ATSUBreakLine will automatically pick up any manual '\n's also
@@ -1255,8 +1256,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