Skip to content

Commit 613193a

Browse files
author
Elvir Brkic
committed
Fonts working for keywords.
TODO: Fonts for other words.
1 parent 45ea705 commit 613193a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

GenerateHighlightContent/GenerateHighLight.cs

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class GenerateHighLight : IGenerateHighLight
2626

2727
/// <summary> highlight.exe 參數 設定於 App.config 的 HighLightSection 區塊 </summary>
2828
private static HighLightSection _section;
29+
30+
public static HighLightSection Config { get { return _section; } }
2931
#endregion
3032

3133
#region -- IGenerageHighLight Member --

NoteHighlightAddin/AddIn.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ public XDocument InsertHighLightCode(string htmlContent, string[] position)
260260
var arrayLine = htmlContent.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
261261
foreach (var item in arrayLine)
262262
{
263+
string s = item.Replace(@"style=""", string.Format(@"style=""font-family:{0}; ", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value));
263264
children.Add(new XElement(ns + "OE",
264265
new XElement(ns + "T",
265-
new XCData(item))));
266+
new XCData(s))));
266267
}
267268

268269
XElement outline = new XElement(ns + "Outline");

NoteHighlightAddin/App.config

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
<add Name="LineNumbers" Key="-l" Value="" Option="true"/>
3535
<add Name="Style" Key="-s" Value="{highLightStyle}"/>
3636
<add Name="LineNumberLength" Key="-j" Value="5"/>
37-
<add Name="Font" Key="-k" Value="\'Courier\ New\'"/>
37+
<add Name="Font" Key="-k" Value="Consolas"/>
38+
<add Name="OutFormat" Key="-O" Value="html"/>
3839
</OutputArguments>
3940
</HighLightSection>
4041
<startup>

0 commit comments

Comments
 (0)