void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(650 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(650 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; double width = context.Width; layout.Width = (int)width; layout.Alignment = Pango.Alignment.Center; //layout.Wrap = Pango.WrapMode.Word; //layout.SingleParagraphMode = true; layout.Justify = false; cr.MoveTo(width / 2, 45 * escala_en_linux_windows); layout.SetText("ESTUDIOS_CARGADOS_A_PACIENTES"); Pango.CairoHelper.ShowLayout(cr, layout); }
public SchemeShell() : base() { mgr = new SourceLanguagesManager(); language = mgr.GetLanguageFromMimeType("text/plain"); // Set up syntax highlighting buffer = new SourceBuffer(language); buffer.Highlight = true; source_view = new ShellSourceView(buffer, "> "); // Change the font to fixed-width: Pango.FontDescription font = new Pango.FontDescription(); font.Family = "Monospace"; source_view.ModifyFont(font); // Event Handlers: source_view.WrapMode = Gtk.WrapMode.Word; source_view.AutoIndent = true; source_view.Execute += execute; // Encoding encoding = Encoding.UTF8; // Probably a more direct way to do these things: // command("import sys"); // command("sys.path.append('.')"); // command("sys.path.append('python')"); // command("sys.path.append('DLLs')"); // buffer.Text += "# Python " + command("sys.version") + "\n" + // "# " + command("sys.copyright") + "\n"; // command("del sys"); source_view.AddPrompt(); }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { //Gtk.Image image5 = new Gtk.Image(); //image5.Name = "image5"; //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg")); //image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/OSIRISLogo.jpg"); // en Linux //---image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear); //---Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,1,-30); //---Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(180, 64, Gdk.InterpType.Hyper),1,1); //cr.Fill(); //cr.Paint(); //cr.Restore(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Normal; // Letra normal cr.MoveTo(479 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Normal; // Letra normal cr.MoveTo(479 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(200 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(departament); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra normal fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente cr.MoveTo(565 * escala_en_linux_windows, 383 * escala_en_linux_windows); cr.LineTo(05, 383); // Linea Horizontal 4 cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.1; cr.Stroke(); }
/// <summary> /// The measure text. /// </summary> /// <param name="text">The text.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">The font size.</param> /// <param name="fontWeight">The font weight.</param> /// <returns>The size of the text.</returns> public override OxySize MeasureText(string text, string fontFamily, double fontSize, double fontWeight) { if (text == null) { return(OxySize.Empty); } this.g.Save(); #if GTKSHARP3 Pango.Layout layout = new Layout(this.c); #else Pango.Layout layout = Pango.CairoHelper.CreateLayout(this.g); #endif Pango.FontDescription font = new Pango.FontDescription(); font.Family = fontFamily; font.Weight = (fontWeight >= 700) ? Pango.Weight.Bold : Pango.Weight.Normal; font.AbsoluteSize = (int)(fontSize * Pango.Scale.PangoScale); layout.FontDescription = font; layout.SetText(text); Pango.Rectangle inkRect; Pango.Rectangle logicalRect; layout.GetExtents(out inkRect, out logicalRect); this.g.Restore(); layout.Dispose(); return(new OxySize(logicalRect.Width / Pango.Scale.PangoScale, logicalRect.Height / Pango.Scale.PangoScale)); }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { Gtk.Image image5 = new Gtk.Image(); image5.Name = "image5"; //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg")); image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/OSIRISLogo.jpg"); // en Linux //image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,1,-30); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1); Gdk.CairoHelper.SetSourcePixbuf(cr, image5.Pixbuf, 1, 1); cr.Fill(); //cr.Restore(); cr.Paint(); cr.Restore(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; //cr.MoveTo(20*escala_en_linux_windows,10*escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,20*escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,30*escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(20*escala_en_linux_windows,70*escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout (cr, layout); // Cambiando el tamaño de la fuente fontSize = 12.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(230 * escala_en_linux_windows, 55 * escala_en_linux_windows); layout.SetText("PROTOCOLO DE ADMISION"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(280 * escala_en_linux_windows, 65 * escala_en_linux_windows); layout.SetText("REGISTRO"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra Normal fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; }
///<summary>Constructor</summary> public Drawer(Gtk.Widget wid, Information inf) { widget = wid; info = inf; pixmapIds = new StringCollection(); // make sure highlight colors are set info.SetupHighlight(wid); fontDescription = Pango.FontDescription.FromString(info.FontName); Pango.Language lang = Pango.Language.FromString(info.FontLanguage); Pango.Context pangoCtx = widget.PangoContext; pangoCtx.FontDescription = fontDescription; pangoCtx.Language = lang; // set the font height and width pangoLayout = new Pango.Layout(pangoCtx); // we use a monospaced font, the actual character doesn't matter pangoLayout.SetText("X"); pangoLayout.GetPixelSize(out width, out height); pangoLayout.SetText(""); // create the font pixmaps InitializePixmaps(); InitializeBackgroundGCs(); }
void crea_encbezado(Cairo.Context cr, Pango.Layout layout) { Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(479 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(479 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 11.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(155 * escala_en_linux_windows, 85 * escala_en_linux_windows); layout.SetText("AUTORIZACION PARA TRATAMIENTOS MEDICOS,"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(145 * escala_en_linux_windows, 95 * escala_en_linux_windows); layout.SetText("PROCEDIMIENTOS DE DIAGNOSTICO TERAPEUTICOS"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(220 * escala_en_linux_windows, 105 * escala_en_linux_windows); layout.SetText("Y/O INTERVENCIONES"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Pango.Weight.Normal; // Letra Normal }
private void RenderFileNme(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { string type = (string)model.GetValue(iter, 0); Pango.FontDescription fd = new Pango.FontDescription(); if (type.Contains("Log-E")) { (cell as Gtk.CellRendererText).Foreground = "red"; fd.Weight = Pango.Weight.Bold; } else if (type.Contains("Log-W")) { (cell as Gtk.CellRendererText).ForegroundGdk = new Gdk.Color(255, 111, 0); // "black"; fd.Weight = Pango.Weight.Normal; } else //if (type.Contains("Log-W")) { { (cell as Gtk.CellRendererText).Foreground = "black"; fd.Weight = Pango.Weight.Normal; } (cell as Gtk.CellRendererText).FontDesc = fd; //(cell as Gtk.CellRendererText).Text = type; }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(479 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(479 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(225 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("REPORTE DE PAGO/ABONOS"); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; if (rango1 == "" || rango2 == "") { cr.MoveTo(235 * escala_en_linux_windows, 45 * escala_en_linux_windows); layout.SetText("Todas Las Fechas"); Pango.CairoHelper.ShowLayout(cr, layout); } else { if (rango1 == rango2) { cr.MoveTo(235 * escala_en_linux_windows, 45 * escala_en_linux_windows); layout.SetText("FECHA: " + rango1); Pango.CairoHelper.ShowLayout(cr, layout); } else { cr.MoveTo(235 * escala_en_linux_windows, 45 * escala_en_linux_windows); layout.SetText("Rango del " + rango1 + " al " + rango2); Pango.CairoHelper.ShowLayout(cr, layout); } } fontSize = 7.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Normal; // Letra normal // Creando el Cuadro de Titulos para colocar el nombre del usuario cr.Rectangle(05 * escala_en_linux_windows, 55 * escala_en_linux_windows, 565 * escala_en_linux_windows, 15 * escala_en_linux_windows); cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.5; cr.Stroke(); /* * ContextoImp.MoveTo(26,720); ContextoImp.Show("FOLIO"); * ContextoImp.MoveTo(56,720); ContextoImp.Show("MONTO"); * ContextoImp.MoveTo(93,720); ContextoImp.Show("F. ABONO"); * ContextoImp.MoveTo(134,720); ContextoImp.Show("Nº. REC."); * ContextoImp.MoveTo(171,720); ContextoImp.Show("PID Y NOMBRE DEL PACIENTE"); * ContextoImp.MoveTo(351,720); ContextoImp.Show("CONCEPTO"); * ContextoImp.MoveTo(501,720); ContextoImp.Show("FORMA DE PAGO"); */ }
void Update (string name) { if (desc != null) desc.Dispose (); desc = Pango.FontDescription.FromString (name); if (desc != null) updater (desc); }
protected override void OnDestroyed () { if (font != null) { font.Dispose (); font = null; } base.OnDestroyed (); }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { //Gtk.Image image5 = new Gtk.Image(); //image5.Name = "image5"; //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg")); //image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/OSIRISLogo.jpg"); // en Linux //image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,1,-30); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(180, 64, Gdk.InterpType.Hyper),1,1); //cr.Fill(); //cr.Paint(); //cr.Restore(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(650 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(650 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(240 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText("REPORTE OCUPACION HOSPITALARIA"); Pango.CairoHelper.ShowLayout(cr, layout); // Creando el Cuadro de Titulos cr.Rectangle(05 * escala_en_linux_windows, 50 * escala_en_linux_windows, 750 * escala_en_linux_windows, 15 * escala_en_linux_windows); cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.5; cr.Stroke(); fontSize = 7.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(09 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Folio."); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(74 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Orden"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(114 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Codigo"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(300 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Descripcion"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(400 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("CostoUni"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(480 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Fecha"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(570 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("Surtir"); Pango.CairoHelper.ShowLayout(cr, layout); //cr.MoveTo(570*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("Autoz"); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(570*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("%Gana"); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(570*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("SubAlmacen"); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(570*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("Compro"); Pango.CairoHelper.ShowLayout (cr, layout); //cr.MoveTo(570*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("Medico"); Pango.CairoHelper.ShowLayout (cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra Normal }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { //image5.Pixbuf = new Gdk.Pixbuf(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "osiris.jpg")); //image5.Pixbuf = new Gdk.Pixbuf("/opt/osiris/bin/OSIRISLogo.jpg"); // en Linux //image5.Pixbuf.ScaleSimple(128, 128, Gdk.InterpType.Bilinear); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf,1,-30); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(145, 50, Gdk.InterpType.Bilinear),1,1); //Gdk.CairoHelper.SetSourcePixbuf(cr,image5.Pixbuf.ScaleSimple(180, 64, Gdk.InterpType.Hyper),1,1); //cr.Fill(); //cr.Paint(); //cr.Restore(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(650 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(650 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(240 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(titulo); Pango.CairoHelper.ShowLayout(cr, layout); // Creando el Cuadro de Titulos cr.Rectangle(05 * escala_en_linux_windows, 50 * escala_en_linux_windows, 750 * escala_en_linux_windows, 15 * escala_en_linux_windows); cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.5; cr.Stroke(); fontSize = 7.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(09 * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("ID Producto"); Pango.CairoHelper.ShowLayout(cr, layout); //cr.MoveTo(74*escala_en_linux_windows,53*escala_en_linux_windows); layout.SetText("Ingreso"); Pango.CairoHelper.ShowLayout (cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 1) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("ENE"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 2) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("FEB"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 3) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("MAR"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 4) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("ABR"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 5) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("MAY"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 6) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("JUN"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 7) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("JUL"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 8) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("AGO"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 9) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("SEP"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 10) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("OCT"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 11) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("NUV"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(comienzo_mese + (espacio_mese * 12) * escala_en_linux_windows, 53 * escala_en_linux_windows); layout.SetText("DIC"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra Normal }
protected override void OnDestroyed() { if (font != null) { font.Dispose(); font = null; } base.OnDestroyed(); }
void ejecutar_consulta_reporte(PrintContext context) { Cairo.Context cr = context.CairoContext; Pango.Layout layout = context.CreatePangoLayout(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; }
public CairoContext(IntPtr state, Gtk.Widget widget) : base(state) { layout = Pango.CairoHelper.CreateLayout (this); // We do not honor DPI settings or font sizes (just font name) // User should resize the window font_description = layout.FontDescription = widget.PangoContext.FontDescription.Copy (); FontLineSpace = def_linespace; }
public RangeRenderer(DiffWidget widget, string text, char type, bool wrap, Pango.FontDescription font) { this.widget = widget; this.text = text; this.wrap = wrap; this.font = font; this.type = type; this.Realized += OnRealized; this.SizeAllocated += SizeAllocatedHandler; ClearHighlight(); }
static void Scale(FontDescription font, double scale) { if (font.SizeIsAbsolute) { font.AbsoluteSize = scale * font.Size; } else { var size = font.Size; if (size == 0) size = 10; font.Size = (int)(Pango.Scale.PangoScale * (int)(scale * size / Pango.Scale.PangoScale)); } }
void salto_de_pagina(Cairo.Context cr, Pango.Layout layout) { if (comienzo_linea > 530) { cr.ShowPage(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; comienzo_linea = 90; numpage += 1; imprime_encabezado(cr, layout); } }
void salto_de_pagina(Cairo.Context cr, Pango.Layout layout) { //context.PageSetup.Orientation = PageOrientation.Landscape; if (comienzo_linea > 660) { cr.ShowPage(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; comienzo_linea = 145; imprime_encabezado(cr, layout); } }
internal void SetCustomFont(Pango.FontDescription desc) { this.desc = desc; if (layout != null) { layout.FontDescription = desc; } if (headerLayout != null) { headerLayout.FontDescription = desc; } }
void ejecutar_consulta_reporte(PrintContext context) { string descripcion_producto_aplicado; int idgrupoproducto; Cairo.Context cr = context.CairoContext; Pango.Layout layout = context.CreatePangoLayout(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 7.0; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; imprime_encabezado(cr, layout); }
void crea_consentimiento(PrintContext context) { Cairo.Context cr = context.CairoContext; Pango.Layout layout = context.CreatePangoLayout(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; crea_encbezado(cr, layout); formato_consentimiento2(cr, layout); }
// Used by GeneratePDF public CairoContext(Cairo.Surface s, string font, int dpis) : base(s) { layout = Pango.CairoHelper.CreateLayout (this); font_description = layout.FontDescription = FontDescription.FromString (font); if (dpis > 0) { Pango.Context c = layout.Context; Pango.CairoHelper.ContextSetResolution (c, dpis); c.Dispose (); } FontLineSpace = def_linespace; }
private void RenderWorkspaceName(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2)); Pango.FontDescription fd = new Pango.FontDescription(); if (type == 2) { fd.Weight = Pango.Weight.Bold; } (cell as Gtk.CellRendererText).FontDesc = fd; }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(650 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(650 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(290 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(titulo); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(200 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Departamento : "); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(350 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Rango de Fecha : " + rango_fecha); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(10 * escala_en_linux_windows, 60 * escala_en_linux_windows); layout.SetText("CODIGO"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(95 * escala_en_linux_windows, 60 * escala_en_linux_windows); layout.SetText("DESCRIPCION PRODUCTO"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(19 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("N° ATENCION"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(65 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("FECHA/HORA"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(125 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("CANT."); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(145 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("EXPED."); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(190 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("NOMBRE DEL PACIENTE"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(360 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("TIPO PACIENTE"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(470 * escala_en_linux_windows, 70 * escala_en_linux_windows); layout.SetText("INSTITUCION O EMPRESA"); Pango.CairoHelper.ShowLayout(cr, layout); //cr.MoveTo(750*escala_en_linux_windows, 60*escala_en_linux_windows); //cr.LineTo(05,60); // Linea Horizontal 1 //cr.FillExtents(); //. FillPreserve(); //cr.SetSourceRGB (0, 0, 0); //cr.LineWidth = 0.3; //cr.Stroke(); // Creacion del cr.Rectangle(05 * escala_en_linux_windows, 55 * escala_en_linux_windows, 750 * escala_en_linux_windows, 25 * escala_en_linux_windows); cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.3; cr.Stroke(); }
void imprime_encabezado(Cairo.Context cr, Pango.Layout layout) { Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 8.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra normal //cr.Rotate(90); //Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna cr.MoveTo(05 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText(classpublic.nombre_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText(classpublic.direccion_empresa); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 25 * escala_en_linux_windows); layout.SetText(classpublic.telefonofax_empresa); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 6.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; cr.MoveTo(479 * escala_en_linux_windows, 05 * escala_en_linux_windows); layout.SetText("Fech.Rpt:" + (string)DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(479 * escala_en_linux_windows, 15 * escala_en_linux_windows); layout.SetText("N° Page :" + numpage.ToString().Trim()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, 35 * escala_en_linux_windows); layout.SetText("Sistema Hospitalario OSIRIS"); Pango.CairoHelper.ShowLayout(cr, layout); // Cambiando el tamaño de la fuente fontSize = 10.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita layout.Alignment = Pango.Alignment.Center; double width = context.Width; layout.Width = (int)width; layout.Alignment = Pango.Alignment.Center; //layout.Wrap = Pango.WrapMode.Word; //layout.SingleParagraphMode = true; layout.Justify = false; cr.MoveTo(width / 2, 45 * escala_en_linux_windows); layout.SetText("DEVOLUCIONES"); Pango.CairoHelper.ShowLayout(cr, layout); fontSize = 7.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra normal cr.MoveTo(05 * escala_en_linux_windows, 65 * escala_en_linux_windows); layout.SetText("N° Atencion: " + numeroatencion); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(120 * escala_en_linux_windows, 65 * escala_en_linux_windows); layout.SetText("N° Expe.: " + pidpaciente); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(220 * escala_en_linux_windows, 65 * escala_en_linux_windows); layout.SetText("Nombre Paciente: " + nombrepaciente); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra normal cr.MoveTo(05 * escala_en_linux_windows, 75 * escala_en_linux_windows); layout.SetText("Procedimiento: "); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(300 * escala_en_linux_windows, 75 * escala_en_linux_windows); layout.SetText("Diagnostico: "); Pango.CairoHelper.ShowLayout(cr, layout); cr.Rectangle(05 * escala_en_linux_windows, 85 * escala_en_linux_windows, 565 * escala_en_linux_windows, 15 * escala_en_linux_windows); cr.FillExtents(); //. FillPreserve(); cr.SetSourceRGB(0, 0, 0); cr.LineWidth = 0.5; cr.Stroke(); layout.FontDescription.Weight = Weight.Bold; // Letra normal cr.MoveTo(18 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Codigo"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(150 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Descripción Producto"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(350 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Cargado"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(390 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Solicitado"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(435 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Devolucion"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(500 * escala_en_linux_windows, 88 * escala_en_linux_windows); layout.SetText("Departamento"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra normal }
public void Start() { notebook1.CurrentPage = 0; checklist = new Checklist (this, tree); back.Sensitive = false; OnNotesFocusOutEvent(null, null); Pango.FontDescription big = new Pango.FontDescription (); big.Size = (int)(26 * Pango.Scale.PangoScale); currentItem.ModifyFont (big); LoadItems (); }
public RefactoringPreviewTooltipWindow (TextEditor editor, DocumentContext documentContext, CodeAction codeAction) { this.editor = editor; this.documentContext = documentContext; this.codeAction = codeAction; TransientFor = IdeApp.Workbench.RootWindow; fontDescription = Pango.FontDescription.FromString (DefaultSourceEditorOptions.Instance.FontName); fontDescription.Size = (int)(fontDescription.Size * 0.8f); using (var metrics = PangoContext.GetMetrics (fontDescription, PangoContext.Language)) { lineHeight = (int)Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale); } }
private void RenderWorkspacePath(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { string text2 = (string)model.GetValue(iter, 1); int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2)); Pango.FontDescription fd = new Pango.FontDescription(); if (type == 2) { fd.Weight = Pango.Weight.Bold; } (cell as Gtk.CellRendererText).FontDesc = fd; (cell as Gtk.CellRendererText).Markup = "<small><i>" + text2 + "</i></small>"; }
void salto_de_pagina(Cairo.Context cr, Pango.Layout layout, string descripcion_almacen, string numerosolicitud, string fechaenvio, string idusuario, string nombreusr, string numeroatencion, string pidpaciente, string nombrepaciente, string tiposolicitud, string procedimientoqx, string diagnosticoqx, string obs_solicitud) { //context.PageSetup.Orientation = PageOrientation.Landscape; if (comienzo_linea > 660) { cr.ShowPage(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 8.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; comienzo_linea = 135; numpage += 1; imprime_encabezado(cr, layout, descripcion_almacen, numerosolicitud, fechaenvio, idusuario, nombreusr, numeroatencion, pidpaciente, nombrepaciente, tiposolicitud, procedimientoqx, diagnosticoqx, obs_solicitud); } }
void imprime_subtitulo(Cairo.Context cr, Pango.Layout layout, string tipoproducto, string fechacreacion) { Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); fontSize = 7.0; desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; layout.FontDescription.Weight = Weight.Bold; // Letra negrita cr.MoveTo(09 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Codigo"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(80 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Cantidad"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(120 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Hora"); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(160 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(tipoproducto); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(315 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(fechacreacion); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(490 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("V.B."); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(540 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText("Caja"); Pango.CairoHelper.ShowLayout(cr, layout); layout.FontDescription.Weight = Weight.Normal; // Letra negrita comienzo_linea += separacion_linea; }
private void RenderOrientationProject(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { string text = (string)model.GetValue(iter, 0); string text2 = (string)model.GetValue(iter, 1); Pango.FontDescription fd = new Pango.FontDescription(); (cell as Gtk.CellRendererText).FontDesc = fd; (cell as Gtk.CellRendererText).Markup = "<b >" + text + "</b>" + Environment.NewLine + "<small>" + text2 + "</small>"; /*string pathTemplates = (string) model.GetValue (iter, 3); * * string[] templates = System.IO.Directory.GetDirectories(pathTemplates); * if(templates.Length<1) * (cell as Gtk.CellRendererText).Sensitive = false;*/ }
public OxySize MeasureText(string text, string fontFamily = "", double fontSize = 10, double fontWeight = 500) { FontDescription desc = new FontDescription(); OxySize size = new OxySize(); int width, height; desc.Family = fontFamily; desc.Size = Pango.Units.FromPixels ((int) fontSize); desc.Weight = PangoWeightFromDouble (fontWeight); layout.FontDescription = desc; layout.SetMarkup (GLib.Markup.EscapeText (text)); layout.GetPixelSize (out width, out height); size.Width = (double) width; size.Height = (double) height; return size; }
public void GetFont (out Pango.FontDescription desc, out Pango.Language language, out Pango.Attribute[] extra_attrs) { desc = new FontDescription (); IntPtr language_handle, list_handle; pango_attr_iterator_get_font (Handle, desc.Handle, out language_handle, out list_handle); desc.Family = desc.Family; // change static string to allocated one language = language_handle == IntPtr.Zero ? null : new Language (language_handle); if (list_handle == IntPtr.Zero) { extra_attrs = new Pango.Attribute [0]; return; } GLib.SList list = new GLib.SList (list_handle); extra_attrs = new Pango.Attribute [list.Count]; int i = 0; foreach (IntPtr raw_attr in list) extra_attrs [i++] = Pango.Attribute.GetAttribute (raw_attr); }
static void LoadDefaults () { if (defaultMonospaceFont != null) { defaultMonospaceFont.Dispose (); defaultSansFont.Dispose (); } #pragma warning disable 618 defaultMonospaceFontName = DesktopService.DefaultMonospaceFont; defaultMonospaceFont = FontDescription.FromString (defaultMonospaceFontName); #pragma warning restore 618 var label = new Gtk.Label (""); defaultSansFont = label.Style.FontDescription.Copy (); label.Destroy (); defaultSansFontName = defaultSansFont.ToString (); }
public static FontDescription ScaleFontSize(Widget w, double scaleK) { double k = scaleK; if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32S || Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.WinCE) { k *= WindowsFontScaleBase; } string fd_string = w.PangoContext.FontDescription.Family + " " + ((int)(k * w.PangoContext.FontDescription.Size / Pango.Scale.PangoScale)); Pango.FontDescription fd = Pango.FontDescription.FromString(fd_string); return(fd); }
private Layout MakeLayout(string text, bool bold = false) { // http://developer.gnome.org/pangomm/unstable/classPango_1_1FontDescription.html Pango.FontDescription font = new Pango.FontDescription(); font.Family = "Arial"; font.Size = Convert.ToInt32(11 * Pango.Scale.PangoScale); if (bold) { font.Weight = Weight.Semibold; } // http://developer.gnome.org/pangomm/unstable/classPango_1_1Layout.html Pango.Layout layout = CreatePangoLayout(text); layout.FontDescription = font; return(layout); }
public void GetFont(out Pango.FontDescription desc, out Pango.Language language, out Pango.Attribute[] extra_attrs) { desc = new FontDescription(); IntPtr language_handle, list_handle; pango_attr_iterator_get_font(Handle, desc.Handle, out language_handle, out list_handle); desc.Family = desc.Family; // change static string to allocated one language = language_handle == IntPtr.Zero ? null : new Language(language_handle); if (list_handle == IntPtr.Zero) { extra_attrs = new Pango.Attribute [0]; return; } GLib.SList list = new GLib.SList(list_handle); extra_attrs = new Pango.Attribute [list.Count]; int i = 0; foreach (IntPtr raw_attr in list) { extra_attrs [i++] = Pango.Attribute.GetAttribute(raw_attr); } }
void ejecutar_consulta_reporte(PrintContext context) { Cairo.Context cr = context.CairoContext; Pango.Layout layout = context.CreatePangoLayout(); Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; /* * ContextoImp.BeginPage("Pagina 1"); * * cantidad_de_letras = classpublic.ConvertirCadena(total_descuento.ToString("F"),"PESO"); * Gnome.Font fuente2 = Gnome.Font.FindClosest("Bitstream Vera Sans", 8); * //Gnome.Font fuente3 = Gnome.Font.FindClosest("Bitstream Vera Sans", 10); * * // ESTA FUNCION ES PARA QUE EL TEXTO SALGA EN NEGRITA * //Gnome.Font fuente4 = Gnome.Font.FindClosestFromWeightSlant("Bitstream Vera Sans", FontWeight.Bold ,false, 12); * //Gnome.Font fuente5 = Gnome.Font.FindClosestFromWeightSlant("Bitstream Vera Sans", FontWeight.Bold ,false, 10); * Gnome.Print.Setfont (ContextoImp, fuente2); * * ContextoImp.MoveTo(400, 780); ContextoImp.Show(DateTime.Now.ToString("dd MM yyyy") ); * ContextoImp.MoveTo(130, 740); ContextoImp.Show(nombredoctor); * ContextoImp.MoveTo(530, 710); ContextoImp.Show("X" ); * ContextoImp.MoveTo(70, 660); ContextoImp.Show("Pagos de Honorarios Medicos / Folio :"+ folio_servicio.Trim()+" Paciente :"+nombre_paciente.Trim()); * ContextoImp.MoveTo(100, 650); ContextoImp.Show(tipo_paciente); * ContextoImp.MoveTo(70, 640); ContextoImp.Show(aseguradora); * ContextoImp.MoveTo(130, 690); ContextoImp.Show("("+ cantidad_de_letras + ")"); * ContextoImp.MoveTo(405, 620); ContextoImp.Show(hono_medico.ToString("C")); * ContextoImp.MoveTo(460, 620); ContextoImp.Show(descuento_hono_medico.ToString("C")); * ContextoImp.MoveTo(445, 620); ContextoImp.Show(" - "); * ContextoImp.MoveTo(170, 720); ContextoImp.Show(total_descuento.ToString("C")); * ContextoImp.MoveTo(370, 620); ContextoImp.Show("Total:"); * ContextoImp.MoveTo(500, 620); ContextoImp.Show(total_descuento.ToString("C")); * ContextoImp.ShowPage(); */ }
void UpdateCustomFont (string name) { if (customFont != null) { customFont.Dispose (); customFont = null; } if (!string.IsNullOrEmpty (name)) { customFont = Pango.FontDescription.FromString (name); } textEditorControl.ModifyFont (customFont); }
protected override void OnDestroyed () { base.OnDestroyed (); if (layout != null) { layout.Dispose (); categoryLayout.Dispose (); noMatchLayout.Dispose (); layout = categoryLayout = noMatchLayout = null; } if (itemFont != null) { itemFont.Dispose (); itemFont = null; } }
void SetFont () { // TODO: Add font property to ICompletionWidget; if (itemFont != null) itemFont.Dispose (); if (categoryFont != null) categoryFont.Dispose (); if (noMatchFont != null) noMatchFont.Dispose (); itemFont = FontService.MonospaceFont.Copy (); categoryFont = FontService.SansFont.CopyModified (Styles.FontScale11); noMatchFont = FontService.SansFont.CopyModified (Styles.FontScale11); var newItemFontSize = itemFont.Size; var newCategoryFontSize = categoryFont.Size; var newNoMatchFontSize = noMatchFont.Size; if (newItemFontSize > 0) { itemFont.Size = (int)newItemFontSize; layout.FontDescription = itemFont; } if (newCategoryFontSize > 0) { categoryFont.Size = (int)newCategoryFontSize; categoryLayout.FontDescription = categoryFont; } if (newNoMatchFontSize > 0) { noMatchFont.Size = (int)newNoMatchFontSize; noMatchLayout.FontDescription = noMatchFont; } }
/// <summary> /// The measure text. /// </summary> /// <param name="text">The text.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">The font size.</param> /// <param name="fontWeight">The font weight.</param> /// <returns>The size of the text.</returns> public override OxySize MeasureText(string text, string fontFamily, double fontSize, double fontWeight) { if (text == null) { return OxySize.Empty; } this.g.Save(); Pango.Layout layout = Pango.CairoHelper.CreateLayout(this.g); Pango.FontDescription font = new Pango.FontDescription(); font.Family = fontFamily; font.Weight = (fontWeight >= 700) ? Pango.Weight.Bold : Pango.Weight.Normal; font.AbsoluteSize = (int)(fontSize * Pango.Scale.PangoScale); layout.FontDescription = font; layout.SetText(text); Pango.Rectangle inkRect; Pango.Rectangle logicalRect; layout.GetExtents(out inkRect, out logicalRect); this.g.Restore(); return new OxySize(logicalRect.Width / Pango.Scale.PangoScale, logicalRect.Height / Pango.Scale.PangoScale); }
private void RenderWorkspacePath(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { string text2 = (string) model.GetValue (iter, 1); int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2)); Pango.FontDescription fd = new Pango.FontDescription(); if(type == 2) fd.Weight = Pango.Weight.Bold; (cell as Gtk.CellRendererText).FontDesc = fd; (cell as Gtk.CellRendererText).Markup = "<small><i>"+text2+"</i></small>"; }
private void ConfigureTextView() { FontDescription fontDescription = new FontDescription(); fontDescription.Family = "Bitstream Vera Sans Mono"; fontDescription.AbsoluteSize = 12000; txtEditor.ModifyFont(fontDescription); }
public OutputConsole() { buffer = new Gtk.TextBuffer(new Gtk.TextTagTable()); textEditorControl = new Gtk.TextView(buffer); textEditorControl.Editable = true; sw = new ScrolledWindow(); sw.ShadowType = ShadowType.Out; sw.Add(textEditorControl); this.PackStart(sw, true, true, 0); vbt = new VBox(); Gdk.Pixbuf clear_pixbuf = MainClass.Tools.GetIconFromStock("file-new.png", IconSize.SmallToolbar); Button btnClear = new Button(new Gtk.Image(clear_pixbuf)); btnClear.TooltipText = MainClass.Languages.Translate("clear"); btnClear.Relief = ReliefStyle.None; btnClear.CanFocus = false; btnClear.WidthRequest = btnClear.HeightRequest = 24; btnClear.Clicked += delegate(object sender, EventArgs e) { Clear(); }; Gdk.Pixbuf save_pixbuf = MainClass.Tools.GetIconFromStock("save.png", IconSize.SmallToolbar); Button btnSave = new Button(new Gtk.Image(save_pixbuf)); btnSave.TooltipText = MainClass.Languages.Translate("save"); btnSave.Relief = ReliefStyle.None; btnSave.CanFocus = false; btnSave.WidthRequest = btnSave.HeightRequest = 24; btnSave.Clicked += delegate(object sender, EventArgs e) { Save(); }; vbt.WidthRequest = 24; vbt.PackStart(btnClear, false, false, 0); vbt.PackStart(btnSave, false, false, 0); this.PackEnd(vbt, false, false, 0); bold = new TextTag("bold"); bold.Weight = Pango.Weight.Bold; buffer.TagTable.Add(bold); errorTag = new TextTag("error"); errorTag.Foreground = "red"; buffer.TagTable.Add(errorTag); consoleLogTag = new TextTag("consoleLog"); consoleLogTag.Foreground = "darkgrey"; buffer.TagTable.Add(consoleLogTag); tag = new TextTag("0"); tag.LeftMargin = 10; buffer.TagTable.Add(tag); tags.Add(tag); endMark = buffer.CreateMark("end-mark", buffer.EndIter, false); outputDispatcher = new GLib.TimeoutHandler(OutputDispatchHandler); customFont = Pango.FontDescription.FromString(MainClass.Settings.ConsoleTaskFont); textEditorControl.ModifyFont(customFont); textEditorControl.KeyPressEvent += HandleTextEditorControlKeyPressEvent; this.ShowAll(); }
protected override void OnDestroyed () { base.OnDestroyed (); lock (updates) { updates.Clear (); lastTextWrite = null; } IdeApp.Preferences.CustomOutputPadFontChanged -= HandleCustomFontChanged; if (customFont != null) { customFont.Dispose (); customFont = null; } }
void SetFont () { // TODO: Add font property to ICompletionWidget; if (itemFont != null) itemFont.Dispose (); itemFont = FontService.GetFontDescription ("Editor").Copy (); var provider = CompletionWidget as ITextEditorDataProvider; if (provider != null) { var newSize = (itemFont.Size * provider.GetTextEditorData ().Options.Zoom); if (newSize > 0) { itemFont.Size = (int)newSize; layout.FontDescription = itemFont; } } }
public RangeRenderer(string text, char type, bool wrap, Pango.FontDescription font) { this.text = text; this.wrap = wrap; this.font = font; this.Realized += OnRealized; this.ExposeEvent += OnExposed; this.SizeAllocated += SizeAllocatedHandler; switch (type) { case 'C': bg_color = DiffWidget.ColorChanged; highlight_bg_color = DiffWidget.ColorChangedHighlight; break; case '+': bg_color = DiffWidget.ColorAdded; highlight_bg_color = DiffWidget.ColorAddedHighlight; break; case '-': bg_color = DiffWidget.ColorRemoved; highlight_bg_color = DiffWidget.ColorRemovedHighlight; break; default: bg_color = DiffWidget.ColorDefault; highlight_bg_color = DiffWidget.ColorDefaultHighlight; break; } Colormap.AllocColor(ref bg_color, false, true); Colormap.AllocColor(ref highlight_bg_color, false, true); ClearHighlight(); }
private DiffWidget(Hunk[] hunks, Options options) : base(false, 0) { if (hunks == null || hunks.Length == 0 || options == null) throw new ArgumentException(); if (options.SideBySide && options.LeftName != null && options.RightName != null) { HBox filetitles = new HBox(true, 2); PackStart(filetitles, false, false, 2); Label leftlabel = new Label(options.LeftName); Label rightlabel = new Label(options.RightName); filetitles.PackStart(leftlabel); filetitles.PackStart(rightlabel); } HBox centerpanel = new HBox(false, 0); PackStart(centerpanel); scroller = new ScrolledWindow(); centerpanel.PackStart (new OverviewRenderer (this, scroller, hunks, options.SideBySide), false, false, 0); Viewport textviewport = new Viewport(); centerpanel.PackStart(scroller); scroller.Add(textviewport); int nRows = 0; foreach (Hunk hunk in hunks) { if (options.SideBySide) { nRows += hunk.MaxLines(); } else { if (hunk.Same) { nRows += hunk.Original().Count; } else { for (int i = 0; i < hunk.ChangedLists; i++) nRows += hunk.Changes(i).Count; } } } uint nCols = 1 + (uint)hunks[0].ChangedLists; if (options.SideBySide) nCols += 2; if (options.LineNumbers) nCols++; VBox tablecontainer = new VBox(false, 0); textviewport.Add(tablecontainer); difftable = new Table((uint)nRows, (uint)nCols, false); tablecontainer.PackStart(difftable, false, false, 0); uint row = 0; if (options.Font != null) font = Pango.FontDescription.FromString(options.Font); Hunk lastHunk = hunks.Length > 0 ? hunks[hunks.Length - 1] : null; foreach (Hunk hunk in hunks) { char leftmode = hunk.Same ? ' ' : (hunk.ChangedLists == 1 && hunk.Changes(0).Count == 0) ? '-' : 'C'; uint inc = 0; if (options.SideBySide) { ComposeLines(hunk.Original(), leftmode, -1, difftable, row, false, 0, options.LineWrap, font, options.LineNumbers, lastHunk.Original ()); inc = (uint)hunk.Original().Count; } else { if (leftmode == 'C') leftmode = '-'; int altlines = -1; if (hunk.ChangedLists == 1 && hunk.Same) altlines = hunk.Changes(0).Start; ComposeLines(hunk.Original(), leftmode, altlines, difftable, row, true, 0, options.LineWrap, font, options.LineNumbers, lastHunk.Original ()); row += (uint)hunk.Original().Count; } for (int i = 0; i < hunk.ChangedLists; i++) { char rightmode = hunk.Same ? ' ' : hunk.Original().Count == 0 ? '+' : 'C'; if (options.SideBySide) { int colsper = 1 + (options.LineNumbers ? 1 : 0); ComposeLines(hunk.Changes(i), rightmode, -1, difftable, row, false, (uint)((i+1)*colsper), options.LineWrap, font, options.LineNumbers, lastHunk.Original ()); if (hunk.Changes(i).Count > inc) inc = (uint)hunk.Changes(i).Count; } else { if (rightmode == 'C') rightmode = '+'; if (!hunk.Same) ComposeLines(hunk.Changes(i), rightmode, -1, difftable, row, true, 0, options.LineWrap, font, options.LineNumbers, lastHunk.Original ()); if (!hunk.Same) row += (uint)hunk.Changes(i).Count; } } if (options.SideBySide) row += inc; } }
/// <summary> /// Draws the text. /// </summary> /// <param name="p">The p.</param> /// <param name="text">The text.</param> /// <param name="fill">The fill color.</param> /// <param name="fontFamily">The font family.</param> /// <param name="fontSize">Size of the font.</param> /// <param name="fontWeight">The font weight.</param> /// <param name="rotate">The rotation angle.</param> /// <param name="halign">The horizontal alignment.</param> /// <param name="valign">The vertical alignment.</param> /// <param name="maxSize">The maximum size of the text.</param> public override void DrawText( ScreenPoint p, string text, OxyColor fill, string fontFamily, double fontSize, double fontWeight, double rotate, HorizontalAlignment halign, VerticalAlignment valign, OxySize? maxSize) { Pango.Layout layout = Pango.CairoHelper.CreateLayout(this.g); Pango.FontDescription font = new Pango.FontDescription(); font.Family = fontFamily; font.Weight = (fontWeight >= 700) ? Pango.Weight.Bold : Pango.Weight.Normal; font.AbsoluteSize = (int)(fontSize * Pango.Scale.PangoScale); layout.FontDescription = font; layout.SetText(text); Pango.Rectangle inkRect; Pango.Rectangle size; layout.GetExtents(out inkRect, out size); size.Width /= (int)Pango.Scale.PangoScale; size.Height /= (int)Pango.Scale.PangoScale; if (maxSize != null) { size.Width = Math.Min(size.Width, (int)maxSize.Value.Width); size.Height = Math.Min(size.Height, (int)maxSize.Value.Height); } this.g.Save(); double dx = 0; if (halign == HorizontalAlignment.Center) { dx = -size.Width / 2; } if (halign == HorizontalAlignment.Right) { dx = -size.Width; } double dy = 0; if (valign == VerticalAlignment.Middle) { dy = -size.Height / 2; } if (valign == VerticalAlignment.Bottom) { dy = -size.Height; } this.g.Translate(p.X, p.Y); if (Math.Abs(rotate) > double.Epsilon) { this.g.Rotate(rotate * Math.PI / 180.0); } this.g.Translate(dx, dy); g.Rectangle(0, 0, size.Width + 0.1f, size.Height + 0.1f); g.Clip(); this.g.SetSourceColor(fill); Pango.CairoHelper.ShowLayout(this.g, layout); this.g.Restore(); }
public void SetFont(string fontname) { customFont = Pango.FontDescription.FromString(fontname); textEditorControl.ModifyFont(customFont); }
void AddItemToCurrentMarketGroup(ECM.EveItem item, TreeModel model, TreeIter iter) { if (vbbMarketGroups.IsRealized == false) vbbMarketGroups.Realize(); Image itemPic = new Image(); itemPic.PixbufAnimation = new Gdk.PixbufAnimation(ECM.Core.LoadingSpinnerGIF); itemPic.WidthRequest = 64; itemPic.HeightRequest = 64; BackgroundWorker fetchImage = new BackgroundWorker(); fetchImage.DoWork += delegate(object sender, DoWorkEventArgs e) { itemPic.Pixbuf = ECM.API.ImageApi.GetItemImageGTK(item.ID, ECM.API.ImageApi.ImageRequestSize.Size64x64); }; fetchImage.RunWorkerAsync(); Gdk.Pixbuf buf = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, 22, 22); Gdk.Pixbuf book = new Gdk.Pixbuf(ECM.Core.Skillbook22PNG); EveItemUseability useability = Core.CurrentCharacter.GetItemUseability(item); if (useability == EveItemUseability.Untrainable) buf.Fill(m_Untrainable.ToUint()); else if (useability == EveItemUseability.Trainable) buf.Fill(m_Trainable.ToUint()); else buf.Fill(m_Useable.ToUint()); book.Composite(buf, 0, 0, buf.Width, buf.Height, 0, 0, 1, 1, Gdk.InterpType.Hyper, 255); Image skillsMet = new Image(buf); skillsMet.WidthRequest = 22; skillsMet.HeightRequest = 22; skillsMet.Xalign = 0; Pango.FontDescription font = new Pango.FontDescription(); font.Size = 24; Label itemName = new Label(); itemName.UseMarkup = true; itemName.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>", item.Name); itemName.Xalign = 0; //itemName.ModifyFont(font); Image infoPic = new Image(ECM.Core.Info16PNG); infoPic.WidthRequest = 16; infoPic.HeightRequest = 16; Button btnInfo = new Button(); btnInfo.Relief = ReliefStyle.None; btnInfo.Add(infoPic); btnInfo.Clicked += delegate(object sender, EventArgs e) { m_ViewDetails.ShowItemDetails(item); }; HBox itemNameHeader = new HBox(); itemNameHeader.PackStart(itemName, false, false, 0); itemNameHeader.PackStart(btnInfo, false, false, 3); WrapLabel itemDesc = new WrapLabel(item.Description); Frame picFrame = new Frame(); picFrame.Shadow = ShadowType.Out; picFrame.Add(itemPic); VBox heading = new VBox(); heading.Spacing = 6; heading.PackEnd(itemNameHeader, false, false, 0); if(item.HasRequirements) heading.PackEnd(skillsMet, false, false, 0); HBox inner = new HBox(); inner.PackStart(picFrame, false, false, 0); inner.PackStart(heading, true, true, 1); Button viewDets = new Button(new Label("View Market Details")); viewDets.Clicked += delegate(object sender, EventArgs e) { ShowItemMarketDetails(item, model, iter); }; HButtonBox itemButtons = new HButtonBox(); itemButtons.Layout = ButtonBoxStyle.End; itemButtons.BorderWidth = 3; itemButtons.Add(viewDets); itemButtons.ShowAll(); HSeparator sep = new HSeparator(); VBox itemBlock = new VBox(); itemBlock.Spacing = 10; itemBlock.PackStart(inner, false, false, 0); itemBlock.PackStart(itemDesc, true, true, 0); itemBlock.PackEnd(itemButtons, false, false, 0); itemBlock.ShowAll(); sep.ShowAll(); vbbMarketGroups.PackStart(itemBlock, false, false, 3); vbbMarketGroups.PackStart(sep, false, false, 3); }
private void RenderResolution(CellLayout cell_layout, CellRenderer cell, TreeModel model, TreeIter iter) { string type = (string) model.GetValue (iter, 1); Pango.FontDescription fd = new Pango.FontDescription(); if ((type == "-1") || (type == "-2")) { fd.Style = Pango.Style.Italic; } (cell as Gtk.CellRendererText).FontDesc = fd; }
void ejecutar_consulta_reporte(PrintContext context) { Cairo.Context cr = context.CairoContext; Pango.Layout layout = context.CreatePangoLayout(); float subtota_por_prod = 0; Pango.FontDescription desc = Pango.FontDescription.FromString("Sans"); // cr.Rotate(90) Imprimir Orizontalmente rota la hoja cambian las posiciones de las lineas y columna fontSize = 8.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; NpgsqlConnection conexion; conexion = new NpgsqlConnection(connectionString + nombrebd); // Verifica que la base de datos este conectada try{ imprime_encabezado(cr, layout); fontSize = 6.0; layout = null; layout = context.CreatePangoLayout(); desc.Size = (int)(fontSize * pangoScale); layout.FontDescription = desc; conexion.Open(); NpgsqlCommand comando; comando = conexion.CreateCommand(); comando.CommandText = query1; //Console.WriteLine(comando.CommandText.ToString()); NpgsqlDataReader lector = comando.ExecuteReader(); string codigoprod = ""; if (lector.Read()) { codigoprod = (string)lector["idproducto"]; cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["idproducto"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(75 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["descripcion_producto"]); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["foliodeservicio"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["fechahoracreacion"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(lector ["cantidadaplicada"].ToString()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["pidpaciente"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["nombre_paciente"]); Pango.CairoHelper.ShowLayout(cr, layout); busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim()); cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(tipo_paciente); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["descripcion_empresa"]); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); subtota_por_prod = float.Parse(lector ["cantidadaplicada"].ToString()); busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim()); while (lector.Read()) { if (codigoprod != (string)lector["idproducto"]) { cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(subtota_por_prod.ToString()); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); codigoprod = (string)lector["idproducto"]; cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["idproducto"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(75 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["descripcion_producto"]); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["foliodeservicio"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["fechahoracreacion"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(lector ["cantidadaplicada"].ToString()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["pidpaciente"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["nombre_paciente"]); Pango.CairoHelper.ShowLayout(cr, layout); busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim()); cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(tipo_paciente); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["descripcion_empresa"]); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); subtota_por_prod = float.Parse(lector ["cantidadaplicada"].ToString()); } else { cr.MoveTo(15 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["foliodeservicio"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(55 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["fechahoracreacion"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(105 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(lector ["cantidadaplicada"].ToString()); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(135 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["pidpaciente"]); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(180 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["nombre_paciente"]); Pango.CairoHelper.ShowLayout(cr, layout); busca_tipoadmisiones(lector["foliodeservicio"].ToString().Trim()); cr.MoveTo(350 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(tipo_paciente); Pango.CairoHelper.ShowLayout(cr, layout); cr.MoveTo(460 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText((string)lector["descripcion_empresa"]); Pango.CairoHelper.ShowLayout(cr, layout); comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); subtota_por_prod += float.Parse(lector ["cantidadaplicada"].ToString()); } } } comienzo_linea += separacion_linea; salto_de_pagina(cr, layout); cr.MoveTo(05 * escala_en_linux_windows, comienzo_linea * escala_en_linux_windows); layout.SetText(subtota_por_prod.ToString()); Pango.CairoHelper.ShowLayout(cr, layout); }catch (NpgsqlException ex) { MessageDialog msgBoxError = new MessageDialog(MyWinError, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close, "PostgresSQL error: {0}", ex.Message); msgBoxError.Run(); msgBoxError.Destroy(); } }
private void RenderTypProject(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { string text = (string) model.GetValue (iter, 0); string text2 = (string) model.GetValue (iter, 1); Pango.FontDescription fd = new Pango.FontDescription(); (cell as Gtk.CellRendererText).FontDesc = fd; (cell as Gtk.CellRendererText).Markup = "<b >"+text + "</b>"+Environment.NewLine+"<small>" + text2+"</small>"; /*string pathTemplates = (string) model.GetValue (iter, 3); if(!string.IsNullOrEmpty(pathTemplates)){ string[] templates = System.IO.Directory.GetDirectories(pathTemplates); if(templates.Length<1) (cell as Gtk.CellRendererText).Sensitive = false; else (cell as Gtk.CellRendererText).Sensitive = true; }*/ }
private void RenderWorkspaceName(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2)); Pango.FontDescription fd = new Pango.FontDescription(); if(type == 2) fd.Weight = Pango.Weight.Bold; (cell as Gtk.CellRendererText).FontDesc = fd; }
public void Dispose () { if (styleSource != null) { IdeApp.Preferences.CustomPadFontChanged -= PropertyChanged; styleSource = null; } if (desc != null) { desc.Dispose (); desc = null; } }