I want to change the font family of my TinyMCE content.
I tried:
tinymce.get('myid').execCommand("fontName", false, "Verdana");
But this is actually only changing the font in the menu. My content is still written in Arial.
How could I proceed to change the font family of the text already present in the TinyMCE?
The answer to this depends on how the content gets its font setting. If there are inline styles on the content you would have to parse the HTML and remove/modify the inline styles to use the font you wish to use.
If there are no inline styles the content would rely on CSS to control the styles so you would either use the content_css setting in your TinyMCE configuration to set the CSS defaults you want or inject inline styles to override the CSS.
Related
What I am doing is simple. I am simply copy and paste the font from flutter It copies only the letters the font styles are not copying.
styling properties are given to display text in given Style it is not the property of text. Text is copied in UTF byte Format so, When you copy text Only text gets copied the style and Other property does not get copied.
Flutter works with custom fonts and you can apply a custom font across an entire app or to individual widgets. This recipe creates an app that uses custom fonts with the following steps:
Import the font files.
Declare the font in the pubspec.
Set a font as the default.
Use a font in a specific widget.
I am using tiny mce 3.5.8 .i already set default font size is 14px in the tiny mce editor using ed.execCommand("fontSize", true,"14px");.But on the time of rendering font size 12px text shows.
The command you are using is telling the Font Size select list to set itself to the 14px selection but that won't impact the HTML that is already loaded into the editor.
If you want the content in the editor to default to using 14px you should pass a CSS file into TinyMCE (see the content_css init setting) and set the default font size to 14px in that CSS file.
If you load content and then manually use the font size select to set the size you will see that TinyMCE wraps the selection in a span and applies an inline style. You could certainly also do that as you load the content into TinyMCE but then you have a hard-coded font size.
I would think the CSS approach will do what you want while making it easier to change your default font size later if you need to do so.
I am trying to change the text color for tinymce text editor, when I type text inside it is by default appearing with gray color, I want text to appear with say red color. I think I will have to override its default css not sure about it, any suggestions?
If possible don't fiddle with the tinymce skin specifics.
Best practice is to use the tinymce configuration parameter content_css.
content_css : "http://path_to_css/custom_content.css",
I have an application that opens HTML pages in a UIWebView. The pages have a specific color theme, which is disrupted by form elements on the page (I have few "select" fields), which have their own color theme (white font, light gray background). CSS can't seem to force it to display in other colors.
Does anyone know how to fix that?
Thanks!
Try using -webkit-appearance: none; to disable the browser's default styling, then apply your own styles. More info and examples at 37signals.
Try using !important in your external CSS styles. It could be that the style sheets for UIWebView are inline and are overriding your external styles.
For example, select { color:#000!important; } should override any inline style text color (unless it is set to !important as well) on <select> elements.
Can someone explain how can I add custom font, css classes styles to Contribute?
styles for h1, h2, h3, ul, ol, p, span, blockquote, etc
The problem that I'm having is that when I go to edit the page, only header styles appear but none of the rest. How can I make all of the styles that I have on the css to appear to the WYSIWYG?
Thanks
You can change the settings on the "Publisher Settings" in Contribute.
There is a page "Styles and fonts" where you can allow the users to select all of your CSS elements.
Preferably you normally only make a selection of styles that you want the user to be able to choose. You can do this with a seperate CSS where you specify the styles that a user can select. This file doesn't contain much only some styles normally without actual formatting which is still in you main stylesheet.
See this tutorial for some help:
http://www.adobe.com/devnet/contribute/articles/css_03.html