CodeMirror text width for custom font - codemirror

I have a custom theme for CM, important part is just this:
.CodeMirror, .CodeMirror * {
font-family: "Roboto Mono" !important;
font-size: 14px;
}
Using this theme causes the text to be measured incorrectly at first render, but it looks good after the editor updates:
Is there any way I could force the Editor/Doc to re-measure the text? Couldn't find any API methods.

I've added the CSS that you provided and it works very fine.
Just you don't need to use the .CodeMirror *
I think that your problem may be due to something else.
Try to call editor.refresh(); after the page loaded.

Related

How to apply styles for GWT scrollbar

I 've tried to give css to scrollpanel in GWT. But its not working.
The problem is I want to change the foregroung and background colors and also the width of scrollers.
Is it possible? can any1 suggest?
Generally it is based on the browser user agent.
For example : For Chrome You need to do something like,
::-webkit-scrollbar { width: 3px; height: 3px;}
::-webkit-scrollbar-button { background-color: #666; }
::-webkit-scrollbar-track { background-color: #999;}
::-webkit-scrollbar-track-piece { background-color: #ffffff;}
::-webkit-scrollbar-thumb { height: 50px; background-color: #666; border-radius: 3px;}
::-webkit-scrollbar-corner { background-color: #999;}}
::-webkit-resizer { background-color: #666;}
Please refer this Link
GWT scrollbars are simply html ones, so you can style them in the same way you would do with plain html: using css.
Add a class to your ScrollPanel and set the styles in your .css files, or set styles to it using java methods.
But you have to be aware that styling scroll-bars is not a standard thing, webkit supports it via vendor-css-properties and the same with IE, but unfortunately you will not be able to style FF.
UPDATE:
As #Andrea suggest in the comment below, if you can change in your app ScrollPanel by CustomScrollPanel you have much more options to customize bars.
In this case you have to provide your own bars because by default it uses browser native ones. This response can help you.

GWT - RichTextArea - how to set its inner font-family

I am just wondering how can I change RichTextArea inner font-family or font-size for example?
I tried to modify its CSS something as a
border: 1px solid black;
background-color: white;
font-family: verdana;
... but it doesn't work :( The font is still something like times new roman or something this way :S
So is there a way manually set its font attributes?
Thanks
Create a Formatter, documented here: http://google-web-toolkit.googlecode.com/svn/javadoc/2.4/com/google/gwt/user/client/ui/RichTextArea.Formatter.html#setFontName(java.lang.String).
It abstracts all the styling stuff so you don't have to manually write CSS.

iOS UIWebview ignoring CSS line-height

I have created some web content using a HTML editor and am loading it into a UIWebView. Everything seems to be working fine apart from one small bit. The CSS is being loaded, but the UIWebView ignores the line-height CSS attribute. Font sizes are being picked up correctly
My body CSS is as follows:
body {
color: #333;
text-align: centre;
padding: 0;
font: 0.75em/0.8em "Lucida Grande", Lucida, Verdana, sans-serif;
margin: 0 0 0;
}
I have also tried adding a specific line-height: 80%; line, but it makes no difference. UIWebView renders the text in exactly the same way if I set the lien-height to 0.8em or 1.5em!
The HTML displays correctly when I load it in Safari on my Mac, so I presume the HTNML is ok, and other the text is not inheriting from other CSS statements. I'm lost as to what could be wrong.
Any ideas?
Thanks Craig
I have tried this on a real device and it renders correctly. This is a simulator issue :(
I was using Xcode 4.3.2 and the simulator running iOS5.1.
I will raise this as a bug with Apple, but hopefully this answer will help somebody else in the future!

Tinymce stop adding a class "mceItemTable" to my table

When I check the content area within tinymce using firebug, I notice that TinyMce is adding a class=mceItemTable to each of my tables. This is annoying because in the theme stylesheet it has definition for this which sets all tables to have a dotted bored and looks horrible.
Is there any way to turn this off?
Cool jsfiddle for tinymce
PS: Is there a correct name for a css definition/group like this?
.className {
background: blue;
color: red;
font-size: 12px;
}
You may set whatever class you like using this configuration setting: http://www.tinymce.com/wiki.php/Configuration:visual_table_class

change font size of a flextable in gwt

I was wondering if anyone knew how to change the font size of a flextable in GWT? I've tried numerous attempts and looked online everywhere but no solution seems to work. I have a flexTable in GWT, and a number of labels like...
user_info.setText(5, 0, "Organization:");
Currently I've been trying to write a style in a CSS page with the code
.smallFont
{
font-size: 6pt;
background-color: #66ff66;
}
I set the flexTable to that style and the background of the table changes, but the font does not. Any help would greatly be appreciated. I've looked online everywhere. I've even tried changing the default styling page for each component by doing ...
.gwt-FlexTable
{
font-size: 6pt;
background-color: #66ff66;
}
but to no avail...
So discouraging = (
I used firebug to find out the CSS styles of GWT, then in my CSS file I used "!important" to override the existing CSS styles. There is an example below.
.gwt-TabPanelBottom {
border-width: 1px !important;
background: none no-repeat scroll center center #F6F6FF !important;
padding: 0 !important;
border: 2px solid #BFCC99 !important;
}
Override the CSS imported via your XML with the !important statement.
Or if needed, you can just download those base css files, manually include a copy of them, comment out everything in the xml, and have full style control.
Here's the clean.css file for example:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/user/theme/clean/public/gwt/clean/clean.css?r=10894
Specifically, to change the font in a GWT Flex Table (assuming you are importing clean.css), add this example to your custom css file and override the table td style you imported:
table td{
font: 18px Arial, sans-serif !important;
}