Posted 14 years ago by Jortx
Version: 4.0.58
Avatar
Hi!
I have a very simple question... ¿How to change the font used in the control?
Is very nice that the font used, be the default font, but i need to change the font, and is being very difficult to change it!!
Nothing changes when I put all the control inside this TAGs: <font face="Courier New"> and </font>
I've tried with DIVs, and nothing...
I don't find any property to change in the control properties...
Just find, in the documentation, something like this XML syntax (to find in the documentation search "Style Tag"):
<SyntaxLanguage Key="C#" LanguageDefinitionVersion="4.0">
    <!-- Highlighting Styles -->    
    <Styles>
        <!-- Optional Styles to Override Built-In Styles -->
        <Style Key="BracketHighlightingStyle" Name="Bracket Highlighted Text" BackColor="Silver" />
        <Style Key="CollapsibleTextStyle" Name="Collapsible Text" ForeColor="Gray" BorderStyle="Solid" BorderCornerStyle="SinglePixelRounded" />
[...]
I don't know how to use it.
¿Can anybody tell me how to set the font i like, in the control?
Thanks a lot!

Comments (5)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I was able to change it by putting a CSS style on the PRE that should surround the control:
<pre style="font-family: Arial;"><CH:CodeHighlighter runat="server" ID="CssCodeHighlighter" LanguageKey="CSS">...


Actipro Software Support

Posted 14 years ago by Jortx
Avatar
Thanks a lot.
You are right, it should be something like this, but i'm trying to explain that is not easy to change by the "logical" ways.
No change with this:
<pre style="font-family: Arial;"><CH:CodeHighlighter runat="server" ID="CssCodeHighlighter" LanguageKey="CSS">...
No change with this:
<DIV style="font-family: Arial;"><pre><CH:CodeHighlighter runat="server" ID="CssCodeHighlighter" LanguageKey="CSS">...
This throw an exception:
<pre><CH:CodeHighlighter runat="server" ID="CssCodeHighlighter" LanguageKey="CSS" style="font-family: Courier-New">...
¿Am I the extrange case? ¿Nobody has had this problem?
Great control, but this is a problem if is not easy to change the font...

Maybe this CSS rule in my site has some incompatibility with your control:
span, td, .TextoNormal {
font-family: Verdana, Arial;
font-size: 14px;
color: #bbbbbb;
}
I allways see the same font, "Verdana 14px", while making the changes I have said.

Thanks for your response!

[Modified at 01/27/2010 03:05 AM]
Posted 14 years ago by Jortx
Avatar
YES! Is it!
If you set a default font to the SPAN html control in yous CSS style sheet, then you are not able to change the CodeHighlighter Control Font.
Maybe should be a way to set the font in the control regardless of the default font.
Cheers!
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Well that is how CSS works. We use SPANs to set font attributes so if you apply a global font-family to SPAN tags then it will be applied to anything we do. I would never recommend setting a global font-family/size on a SPAN tag in CSS. You should set the CSS font properties on things like BODY, TD, etc. instead, or SPANs but only ones with CSS class or id's.

Another thing is that our Style tags in the language definition files do let you set FontFamilyName and FontSize attributes there, which would likely override your CSS settings as-is.


Actipro Software Support

Posted 14 years ago by Jortx
Avatar
I've fixed this issue. Now i don't set anything to the tag SPAN and others TAGs like this one. Thanks for your advice.
The latest build of this product (v4.0.59) was released 13 years ago, which was after the last post in this thread.