Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font size drop down list. #58

Closed
maheshhfs opened this issue May 3, 2013 · 5 comments
Closed

Font size drop down list. #58

maheshhfs opened this issue May 3, 2013 · 5 comments

Comments

@maheshhfs
Copy link

Hi...

I integrated redactor editor in my web application. But there are no any setting for font size drop down list. I wont font size values from 6,7,8,9......,96 like in word document font size drop down list. So, what i do?

Thanks in advance.
Mahesh

@jlnwcic
Copy link

jlnwcic commented May 3, 2013

I agree. Considering this app for a client, and they wouldn't use it without the ability to change font sizes. What about a customizable toolbar like CKEditor where you just add the name of the toolbar item you want in the line for the toolbar in the code?

@jlnwcic
Copy link

jlnwcic commented May 3, 2013

Actually, you can get font alterations using the paragraph icon:
fonts.
Also, to add font size (6,7,8,9), you might be able to add it to the default style section. If I use the app, I will try that because your idea is a good one.

@EpokK
Copy link

EpokK commented Jun 18, 2013

Use this plugin :

if (!RedactorPlugins) var RedactorPlugins = {};

RedactorPlugins.fontsize = {
    init: function()
    {
        var fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];
        var that = this;
        var dropdown = {};

        $.each(fonts, function(i, s)
        {
            dropdown['s' + i] = { title: s + 'px', callback: function() { that.setFontsize(s); } };
        });

        dropdown['remove'] = { title: 'Remove font size', callback: function() { that.resetFontsize(); } };

        this.buttonAdd( 'fontsize', 'Change font size', false, dropdown);
    },
    setFontsize: function(size)
    {
        this.inlineSetStyle('font-size', size + 'px');
    },
    resetFontsize: function()
    {
        this.inlineRemoveStyle('font-size');
    }
};

@maheshhfs
Copy link
Author

Oh!...... Nice solution.
I implement it and try to change font size.... But, I am confused in following two methods,
this.inlineSetStyle('font-size', size + 'px');
this.inlineRemoveStyle('font-size');
this two methods are not in the redactor plugin. So, i try to implement this methods but does not works properly.
So, Please can you have code for this methods then please send me......
Again thanks for your thinking.......

Best Regards,
Mahesh.

@maheshhfs
Copy link
Author

Hi....
can you explore for the following two methods......
this.inlineSetStyle('font-size', size + 'px'); & this.inlineRemoveStyle('font-size');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants