~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorPrintOperation.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
                        SetHeaderFormat (settings.HeaderFormat);
62
62
                        SetFooterFormat (settings.FooterFormat);
63
63
                        
64
 
                        style = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (null, settings.ColorScheme);
 
64
                        style = Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (settings.ColorScheme);
65
65
                        
66
66
                        pageWidth = context.PageSetup.GetPageWidth (Unit.Pixel);
67
67
                        pageHeight = context.PageSetup.GetPageHeight (Unit.Pixel);
123
123
                                        
124
124
                                        var startChunk = doc.SyntaxMode.GetChunks (style, line, line.Offset, line.LengthIncludingDelimiter);
125
125
                                        foreach (Chunk chunk in startChunk) {
126
 
                                                ChunkStyle chunkStyle = chunk != null ? style.GetChunkStyle (chunk) : null;
 
126
                                                var chunkStyle = chunk != null ? style.GetChunkStyle (chunk) : null;
127
127
                                                string text = doc.GetTextAt (chunk);
128
128
                                                text = text.Replace ("\t", new string (' ', settings.TabSize));
129
129
                                                layout.SetText (text);
130
130
                                        
131
131
                                                var atts = ResetAttributes ();
132
132
                                        
133
 
                                                atts.Insert (new Pango.AttrForeground (chunkStyle.Color.Red, chunkStyle.Color.Green, chunkStyle.Color.Blue));
 
133
                                                atts.Insert (new Pango.AttrForeground ((ushort)(chunkStyle.Foreground.R * ushort.MaxValue), (ushort)(chunkStyle.Foreground.G * ushort.MaxValue), (ushort)(chunkStyle.Foreground.B * ushort.MaxValue)));
134
134
                                        
135
 
                                                if (chunkStyle.Bold) {
136
 
                                                        atts.Insert (new Pango.AttrWeight (Pango.Weight.Bold));
 
135
                                                if (chunkStyle.FontWeight != Xwt.Drawing.FontWeight.Normal) {
 
136
                                                        atts.Insert (new Pango.AttrWeight ((Pango.Weight)chunkStyle.FontWeight));
137
137
                                                }
138
 
                                                if (chunkStyle.Italic) {
139
 
                                                        atts.Insert (new Pango.AttrStyle (Pango.Style.Italic));
 
138
                                                if (chunkStyle.FontStyle != Xwt.Drawing.FontStyle.Normal) {
 
139
                                                        atts.Insert (new Pango.AttrStyle ((Pango.Style)chunkStyle.FontStyle));
140
140
                                                }
141
141
                                                if (chunkStyle.Underline) {
142
142
                                                        atts.Insert (new Pango.AttrUnderline (Pango.Underline.Single));