irshu355 / Android-WYSIWYG-Editor

:pager: A text editor written in Android using native components in the content tree. Integrate easily to work with web based WYSIWYG's.
http://irshulx.github.io/Android-WYSIWYG-Editor
Apache License 2.0
412 stars 116 forks source link

Bug: Bold and Italic not working? #61

Closed nilskretschmer closed 5 years ago

nilskretschmer commented 5 years ago

This issue seems to remain. All the functions from the sample work for me. Except for italic and bold. What is the status of this bug? This is the code for the two buttons:

    findViewById(R.id.action_bold).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            editor.updateTextStyle(EditorTextStyle.BOLD);
        }
    });

    findViewById(R.id.action_Italic).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            editor.updateTextStyle(EditorTextStyle.ITALIC);
        }
    });
JonnyCiel commented 5 years ago

I am having the same problem. Bold and Italic are not working.

irshu355 commented 5 years ago

I could not reproduce this bug. If you are using custom font-face, u must provide the font variant for bold, italic, and bold-italic (https://github.com/irshuLx/Android-WYSIWYG-Editor#custom-fonts), without providing these font variants, they won't work. For eg: https://fonts.google.com/specimen/Lato, you need to download regular 400, black 900(for bold), regular 400 italic (for italic) and black 900 italic(for bold-italic) and copy them to asset directory and configure it using the api.

nilskretschmer commented 5 years ago

Hi @irshuLx !

Thanks for your answer. No - I don't use custom font-face. I just use the code snippet from the readme. So I just added the library as a dependency, wrote a short activity containing the onclicklisteners and that's it. I realized that if I skip the map and image listeners everything works as expected..

nilskretschmer commented 5 years ago

Hi again @irshuLx You are right, sorry. The issue is related to the custom typeface. I if I comment the methods for the custom fontface out it works. My bad. Nice library - thanks for your work!! I'd like to add Checkboxes - can you explain to me where I should add the code for that?