[vlc-devel] [PATCH] Feature #2568: Hotkey for font size change

Ilkka Ollakka ileoo at videolan.org
Fri Mar 14 08:56:45 CET 2014


On Thu, Mar 13, 2014 at 11:42:25PM -0600, Subodh Shrestha wrote:
> - added hotkeys (Alt+u increases fontsize, Alt+Shift+u decreases font size)
> - Check whether absolute or relative sizing is being used
>   -- depends on whether freetype-fontsize is set or not

Hi,


> ---

> diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
> index 1e7fcdf..40fb43b 100644
> --- a/modules/control/hotkeys.c
> +++ b/modules/control/hotkeys.c
> @@ -129,7 +129,7 @@ static void Close( vlc_object_t *p_this )
>      free( p_sys );
>  }

> +                int abs_fontsize = var_InheritInteger( p_filter, "freetype-fontsize");
> +                int rel_fontsize = var_InheritInteger( p_filter, "freetype-rel-fontsize");
> +
> +                // If freetype-fontsize is set in config file (non-zero value), it overrides the freetype-rel-fontsize value
> +                // in determining the subtitle fontsize.
> +                // So checking for this config value first
> +                if( abs_fontsize )
> +                {
> +                    config_PutInt(p_filter, "freetype-fontsize", ++abs_fontsize);

I think you should more likely use var_SetInteger as you are
changing variable?

> +                }
> +                else
> +                {
> +                    int MAX_REL_FONTSIZE = 1;
> +                    // If freetype-rel-fontsize is allowed to go 0 or below, subtitle fontsize gets reset to 12 (absolute value)
> +                    // So not allowing value to go below 1
> +                    if( rel_fontsize == MAX_REL_FONTSIZE )
> +                    {
> +                        msg_Err( p_filter, "Cannot increase fontsize further using relative sizing" );
> +                    }
> +                    else
> +                    {
> +                        config_PutInt(p_filter, "freetype-rel-fontsize", --rel_fontsize);

Are you increasing or decreasing the size ? 


-- 
Ilkka Ollakka
If your hands are clean and your cause is just and your demands are
reasonable, at least it's a start.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140314/2bd0397d/attachment.sig>


More information about the vlc-devel mailing list