Hi,

Attached is the source to a program I remember testing when Winelib was
still the order of the day and it somehow worked.

It still does work. However, if you resize the window, the text becomes
corrupted. Can someone test this under mono/windows. I've attached a
screenshot so you can see what I can see.

TTFN

Paul

// created on 27/06/2004 at 21:25

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class UsingFonts : System.Windows.Forms.Form
{
  private System.ComponentModel.Container components = null;

  [STAThread]
  static void Main()
  {
    Application.Run (new UsingFonts() );
  }
        
  protected override void OnPaint(PaintEventArgs paintEvent)    
  {
     Graphics graphicsObject = paintEvent.Graphics;
     SolidBrush brush = new SolidBrush (Color.DarkBlue);
                
     FontStyle style = FontStyle.Bold;
     Font arial = new Font (new FontFamily ("Ariel"), 12, style);
                
     style = FontStyle.Regular;
     Font timesNewRoman = new Font ("Times New Roman", 12, style);
                
     style = FontStyle.Bold | FontStyle.Italic;
     Font courierNew = new Font("Courier New", 16, style);
     
     style = FontStyle.Strikeout;
     Font tahoma = new Font("Tahoma", 18, style);
                
     graphicsObject.DrawString(arial.Name + " 12 point bold.", arial, 
                        brush, 10, 10);
 
     graphicsObject.DrawString(timesNewRoman.Name + " 12 point plain.",
                        timesNewRoman, brush, 10, 30);
                
     graphicsObject.DrawString(courierNew.Name + " 16 point bold and
italic.", courierNew, brush, 10, 54);
                
     graphicsObject.DrawString(tahoma.Name + " 18 point strikeout",
tahoma, brush, 10, 75);
        
  }
}
-- 
"A lot of football success is in the mind. You must believe you are the
best and then make sure that you are. In my time at Liverpool we always
said we had the best two teams on Merseyside, Liverpool and Liverpool
Reserves." - Bill Shankly

Attachment: Screenshot1.png
Description: PNG image

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to