Commit for development environment setup

This commit is contained in:
2023-06-19 16:12:33 -04:00
parent be72063a3c
commit bbce2ad0a6
2209 changed files with 1171775 additions and 625 deletions

View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LineDraw", "LineDraw\LineDraw.csproj", "{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,78 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D94CFBC2-40EA-4470-BCF2-2D46777DADA3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LineDraw</RootNamespace>
<AssemblyName>LineDraw</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="frmLineDraw.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLineDraw.Designer.cs">
<DependentUpon>frmLineDraw.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmLineDraw.resx">
<SubType>Designer</SubType>
<DependentUpon>frmLineDraw.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace LineDraw
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmLineDraw());
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LineDraw")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LineDraw")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("32c2fc18-34ec-4eb1-ad46-77fc30e3c7a7")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3074
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LineDraw.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LineDraw.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3074
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace LineDraw.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,86 @@
namespace LineDraw
{
partial class frmLineDraw
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.rtb = new System.Windows.Forms.RichTextBox();
this.tbResults = new System.Windows.Forms.TextBox();
this.btnCheck = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// rtb
//
this.rtb.Location = new System.Drawing.Point(31, 29);
this.rtb.Name = "rtb";
this.rtb.Size = new System.Drawing.Size(338, 234);
this.rtb.TabIndex = 0;
this.rtb.Text = "";
//
// tbResults
//
this.tbResults.Location = new System.Drawing.Point(33, 287);
this.tbResults.Multiline = true;
this.tbResults.Name = "tbResults";
this.tbResults.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tbResults.Size = new System.Drawing.Size(336, 204);
this.tbResults.TabIndex = 1;
//
// btnCheck
//
this.btnCheck.Location = new System.Drawing.Point(443, 256);
this.btnCheck.Name = "btnCheck";
this.btnCheck.Size = new System.Drawing.Size(75, 23);
this.btnCheck.TabIndex = 2;
this.btnCheck.Text = "Check";
this.btnCheck.UseVisualStyleBackColor = true;
this.btnCheck.Click += new System.EventHandler(this.btnCheck_Click);
//
// frmLineDraw
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(600, 533);
this.Controls.Add(this.btnCheck);
this.Controls.Add(this.tbResults);
this.Controls.Add(this.rtb);
this.Name = "frmLineDraw";
this.Text = "LineDrawTest";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.RichTextBox rtb;
private System.Windows.Forms.TextBox tbResults;
private System.Windows.Forms.Button btnCheck;
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace LineDraw
{
public partial class frmLineDraw : Form
{
public frmLineDraw()
{
InitializeComponent();
//rtb.Rtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 VESymbFix;}{\\f1\\fnil\\fcharset2 Prestige Elite Tall;}{\\f2\\fnil\\fcharset0 Prestige Elite Tall;}}\r\n\\viewkind4\\uc1\\pard\\sl-240\\slmult0\\f0\\fs20\\u9484?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9516?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9488?\\f1\\par\r\n\\f0\\u9474?\\f1 Tim\\f0\\u916?\\f1 e \\f0\\u9474?\\f1 Occ\\'b0urance\\f0\\u9474?\\f1\\par\r\n\\f0\\u9500?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9532?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\f1 \\f0\\u9474?\\f1\\par\r\n\\f0\\u9474?\\f1 03\\f0\\u931?\\f1 :00\\f0\\u9474?\\f1 Explosion \\f0\\u9474?\\f1\\par\r\n\\pard\\sl-252\\slmult0\\f0\\u9474?\\f1 04 :00\\f0\\u9474?\\f1 Fire \\f0\\u9474?\\f1\\par\r\n\\f0\\u9492?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9524?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9496?\\f2\\par\r\n}\r\n";
rtb.Rtf = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset2 Prestige Elite Tall;}{\\f1\\fnil\\fcharset0 VESymbFix;}{\\f2\\fnil\\fcharset0 Prestige Elite Tall;}}\r\n\\viewkind4\\uc1\\pard\\sl-240\\slmult0\\f0\\fs20\\f1\\u9484?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9516?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9488?\\f0 \\par\r\n\\f1\\u9474?\\f0 Tim\\f1\\u916?\\f0 e \\f1\\u9474?\\f0 Occ\\'b0urance\\f1\\u9474?\\f0 \\par\r\n\\f1\\u9500?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9532?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9474?\\f0 \\par\r\n\\f1\\u9474?\\f0 03\\f1\\u931?\\f0 :00\\f1\\u9474?\\f0 Explosion \\f1\\u9474?\\f0 \\par\r\n\\pard\\sl-252\\slmult0\\f1\\u9474?\\f0 04 :00\\f1\\u9474?\\f0 Fire \\f1\\u9474?\\f0 \\par\r\n\\f1\\u9492?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9524?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9496?\\f0 \\f2\\fs20\\par\r\n}\r\n";
}
private void btnCheck_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (char c in rtb.Text)
{
if (c <= '\xFF' && c >= ' ')
{
sb.Append(c);
}
else
{
sb.Append(string.Format("0x{0:X4}",(int) c));
}
sb.Append("\r\n");
}
tbResults.Text = sb.ToString();
}
//Generated //"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset2 Prestige Elite Tall;}{\\f1\\fnil\\fcharset0 VESymbFix;}{\\f2\\fnil\\fcharset0 Prestige Elite Tall;}}\r\n\\viewkind4\\uc1\\pard\\sl-240\\slmult0\\f0\\fs20\\f1\\u9484?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9516?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9488?\\f0 \\par\r\n\\f1\\u9474?\\f0 Tim\\f1\\u916?\\f0 e \\f1\\u9474?\\f0 Occ\\'b0urance\\f1\\u9474?\\f0 \\par\r\n\\f1\\u9500?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9532?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9474?\\f0 \\par\r\n\\f1\\u9474?\\f0 03\\f1\\u931?\\f0 :00\\f1\\u9474?\\f0 Explosion \\f1\\u9474?\\f0 \\par\r\n\\pard\\sl-252\\slmult0\\f1\\u9474?\\f0 04 :00\\f1\\u9474?\\f0 Fire \\f1\\u9474?\\f0 \\par\r\n\\f1\\u9492?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9524?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9472?\\f0 \\f1\\u9496?\\f0 \\f2\\fs20\\par\r\n}\r\n"
//RTF //"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 VESymbFix;}{\\f1\\fnil\\fcharset2 Prestige Elite Tall;}{\\f2\\fnil\\fcharset0 Prestige Elite Tall;}}\r\n\\viewkind4\\uc1\\pard\\sl-240\\slmult0\\f0\\fs20\\u9484?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9516?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9488?\\f1\\par\r\n\\f0\\u9474?\\f1 Tim\\f0\\u916?\\f1 e \\f0\\u9474?\\f1 Occ\\'b0urance\\f0\\u9474?\\f1\\par\r\n\\f0\\u9500?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9532?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\f1 \\f0\\u9474?\\f1\\par\r\n\\f0\\u9474?\\f1 03\\f0\\u931?\\f1 :00\\f0\\u9474?\\f1 Explosion \\f0\\u9474?\\f1\\par\r\n\\pard\\sl-252\\slmult0\\f0\\u9474?\\f1 04 :00\\f0\\u9474?\\f1 Fire \\f0\\u9474?\\f1\\par\r\n\\f0\\u9492?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9524?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9472?\\u9496?\\f2\\par\r\n}\r\n"
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

File diff suppressed because one or more lines are too long

54323
PROMS/FONTS/PDF/PromsFonts.pdf Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,35 @@
#include "stdafx.h"
#include "About.h"
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDC_ABOUT_EMAIL, m_ctrlEmail);
//}}AFX_DATA_MAP
}
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CString strMailTo = _T("");
strMailTo.LoadString(IDS_MAILTO);
m_ctrlEmail.SetURL(strMailTo);
CenterWindow();
return TRUE;
}

View File

@@ -0,0 +1,35 @@
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
#ifndef ABOUT_H
#define ABOUT_H
#include "xhyperlink.h"
#include "resource.h"
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
CXHyperLink m_ctrlEmail;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //ABOUT_H

View File

@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// XMonoFontDialogTest.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,41 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef STDAFX_H
#define STDAFX_H
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#if _MSC_VER >= 1400
#ifndef WINVER
#define WINVER 0x0501
#endif
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#if _MFC_VER > 0x700
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#endif
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // STDAFX_H

View File

@@ -0,0 +1,78 @@
// XFontSize.cpp Version 1.0
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
//#include "windows.h"
#define XFONTSIZE_CPP
#include "XFontSize.h"
#include "tchar.h"
int CXFontSize::m_cyPixelsPerInch = 0;
//=============================================================================
CXFontSize::CXFontSize()
//=============================================================================
{
Init();
}
//=============================================================================
void CXFontSize::Init()
//=============================================================================
{
if (m_cyPixelsPerInch == 0)
{
HDC hdc = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
if (hdc)
{
m_cyPixelsPerInch = ::GetDeviceCaps(hdc, LOGPIXELSY);
::DeleteDC(hdc);
}
}
}
//=============================================================================
CXFontSize::~CXFontSize()
//=============================================================================
{
}
//=============================================================================
int CXFontSize::GetFontPointSize(int nHeight)
//=============================================================================
{
Init();
int nPointSize = 0;
if (m_cyPixelsPerInch)
{
nPointSize = MulDiv(nHeight, 72, m_cyPixelsPerInch);
if (nPointSize < 0)
nPointSize = -nPointSize;
}
return nPointSize;
}
//=============================================================================
int CXFontSize::GetFontHeight(int nPointSize)
//=============================================================================
{
Init();
int nHeight = 0;
if (m_cyPixelsPerInch)
{
nHeight = -MulDiv(nPointSize, m_cyPixelsPerInch, 72);
}
return nHeight;
}

View File

@@ -0,0 +1,47 @@
// XFontSize.h Version 1.0
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XFONTSIZE_H
#define XFONTSIZE_H
//=============================================================================
class CXFontSize
//=============================================================================
{
// Construction
public:
CXFontSize();
virtual ~CXFontSize();
void Init();
// Operations
public:
int GetFontPointSize(int nHeight);
int GetFontHeight(int nPointSize);
// Implementation
private:
static int m_cyPixelsPerInch;
};
//=============================================================================
// CXFontSize instance
//
#ifndef XFONTSIZE_CPP
// include an instance in each file; the namespace insures uniqueness
namespace { CXFontSize FontSize; }
#endif
#endif //XFONTSIZE_H

View File

@@ -0,0 +1,629 @@
// XHyperLink.cpp Version 1.0
//
// XHyperLink static control. Will open the default browser with the given URL
// when the user clicks on the link.
//
// Copyright (C) 1997 - 1999 Chris Maunder
// All rights reserved. May not be sold for profit.
//
// Thanks to P<>l K. T<>nder for auto-size and window caption changes.
//
// "GotoURL" function by Stuart Patterson
// As seen in the August, 1997 Windows Developer's Journal.
// Copyright 1997 by Miller Freeman, Inc. All rights reserved.
// Modified by Chris Maunder to use TCHARs instead of chars.
//
// "Default hand cursor" from Paul DiLascia's Jan 1998 MSJ article.
//
// 2/29/00 -- P. Shaffer standard font mod.
//
///////////////////////////////////////////////////////////////////////////////
//
// Modified by: Hans Dietrich
// hdietrich@gmail.com
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XHyperLink.h"
#include "atlconv.h" // for Unicode conversion
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#pragma warning(disable : 4996) // This function or variable may be unsafe
#define TOOLTIP_ID 1
// Uncomment following line to enable error message box for URL navigation
//#define XHYPERLINK_REPORT_ERROR
#ifndef IDC_HAND
#define IDC_HAND MAKEINTRESOURCE(32649) // From WINUSER.H
#endif
// sends message to parent when hyperlink is clicked (see SetNotifyParent())
UINT WM_XHYPERLINK_CLICKED = ::RegisterWindowMessage(_T("WM_XHYPERLINK_CLICKED"));
///////////////////////////////////////////////////////////////////////////////
// CXHyperLink
BEGIN_MESSAGE_MAP(CXHyperLink, CStatic)
//{{AFX_MSG_MAP(CXHyperLink)
ON_WM_CTLCOLOR_REFLECT()
ON_WM_SETCURSOR()
ON_WM_MOUSEMOVE()
ON_WM_TIMER()
ON_CONTROL_REFLECT(STN_CLICKED, OnClicked)
ON_WM_ERASEBKGND()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////////
// ctor
CXHyperLink::CXHyperLink()
{
m_hLinkCursor = NULL; // No cursor as yet
m_crLinkColour = RGB(0,0,238); // Blue
m_crVisitedColour = RGB(85,26,139); // Purple
m_crHoverColour = RGB(255,0,0); // Red
m_bOverControl = FALSE; // Cursor not yet over control
m_bVisited = FALSE; // Hasn't been visited yet.
m_nUnderline = ulHover; // Underline the link?
m_bAdjustToFit = TRUE; // Resize the window to fit the text?
m_strURL = _T("");
m_nTimerID = 100;
m_bNotifyParent = FALSE; // TRUE = notify parent
m_bIsURLEnabled = TRUE; // TRUE = navigate to url
m_bToolTip = TRUE; // TRUE = display tooltip
m_crBackground = (UINT) -1; // set to default (no bg color)
m_bAlwaysOpenNew = FALSE; // TRUE = always open new browser window
}
///////////////////////////////////////////////////////////////////////////////
// dtor
CXHyperLink::~CXHyperLink()
{
TRACE(_T("in CXHyperLink::~CXHyperLink\n"));
if (m_hLinkCursor)
DestroyCursor(m_hLinkCursor);
m_hLinkCursor = NULL;
m_UnderlineFont.DeleteObject();
if (m_Brush.GetSafeHandle())
m_Brush.DeleteObject();
}
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink overrides
///////////////////////////////////////////////////////////////////////////////
// DestroyWindow
BOOL CXHyperLink::DestroyWindow()
{
KillTimer(m_nTimerID);
return CStatic::DestroyWindow();
}
///////////////////////////////////////////////////////////////////////////////
// PreTranslateMessage
BOOL CXHyperLink::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CStatic::PreTranslateMessage(pMsg);
}
///////////////////////////////////////////////////////////////////////////////
// PreSubclassWindow
void CXHyperLink::PreSubclassWindow()
{
// We want to get mouse clicks via STN_CLICKED
DWORD dwStyle = GetStyle();
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle | SS_NOTIFY);
// Set the URL as the window text
if (m_strURL.IsEmpty())
GetWindowText(m_strURL);
// Check that the window text isn't empty. If it is, set it as the URL.
CString strWndText;
GetWindowText(strWndText);
if (strWndText.IsEmpty())
{
ASSERT(!m_strURL.IsEmpty()); // Window and URL both NULL. DUH!
SetWindowText(m_strURL);
}
CFont* pFont = GetFont();
if (!pFont)
{
HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
if (hFont == NULL)
hFont = (HFONT) GetStockObject(ANSI_VAR_FONT);
if (hFont)
pFont = CFont::FromHandle(hFont);
}
ASSERT(pFont->GetSafeHandle());
// Create the underline font
LOGFONT lf;
pFont->GetLogFont(&lf);
m_StdFont.CreateFontIndirect(&lf);
lf.lfUnderline = (BYTE) TRUE;
m_UnderlineFont.CreateFontIndirect(&lf);
PositionWindow(); // Adjust size of window to fit URL if necessary
SetDefaultCursor(); // Try and load up a "hand" cursor
SetUnderline();
// Create the tooltip
if (m_bToolTip)
{
CRect rect;
GetClientRect(rect);
m_ToolTip.Create(this);
m_ToolTip.AddTool(this, m_strURL, rect, TOOLTIP_ID);
}
CStatic::PreSubclassWindow();
}
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink message handlers
///////////////////////////////////////////////////////////////////////////////
// OnClicked
void CXHyperLink::OnClicked()
{
m_bOverControl = FALSE;
int result = HINSTANCE_ERROR + 1;
if (m_bIsURLEnabled)
result = (int)(INT_PTR)GotoURL(m_strURL, SW_SHOW, m_bAlwaysOpenNew);
m_bVisited = (result > HINSTANCE_ERROR);
if (!m_bVisited)
{
MessageBeep(MB_ICONEXCLAMATION); // Unable to follow link
ReportError(result);
}
else
SetVisited(); // Repaint to show visited colour
NotifyParent();
}
///////////////////////////////////////////////////////////////////////////////
// CtlColor
#ifdef _DEBUG
HBRUSH CXHyperLink::CtlColor(CDC* pDC, UINT nCtlColor)
#else
HBRUSH CXHyperLink::CtlColor(CDC* pDC, UINT /*nCtlColor*/)
#endif
{
ASSERT(nCtlColor == CTLCOLOR_STATIC);
if (m_bOverControl)
pDC->SetTextColor(m_crHoverColour);
else if (m_bVisited)
pDC->SetTextColor(m_crVisitedColour);
else
pDC->SetTextColor(m_crLinkColour);
// transparent text.
pDC->SetBkMode(TRANSPARENT);
if (m_Brush.GetSafeHandle())
{
pDC->SetBkColor(m_crBackground);
return (HBRUSH) m_Brush;
}
else
{
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
}
///////////////////////////////////////////////////////////////////////////////
// OnMouseMove
void CXHyperLink::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bOverControl) // Cursor has just moved over control
{
m_bOverControl = TRUE;
if (m_nUnderline == ulHover)
SetFont(&m_UnderlineFont);
Invalidate();
SetTimer(m_nTimerID, 100, NULL);
}
CStatic::OnMouseMove(nFlags, point);
}
///////////////////////////////////////////////////////////////////////////////
// OnTimer
void CXHyperLink::OnTimer(UINT nIDEvent)
{
CPoint p(GetMessagePos());
ScreenToClient(&p);
CRect rect;
GetClientRect(rect);
if (!rect.PtInRect(p))
{
m_bOverControl = FALSE;
KillTimer(m_nTimerID);
if (m_nUnderline != ulAlways)
SetFont(&m_StdFont);
rect.bottom+=10;
InvalidateRect(rect);
}
CStatic::OnTimer(nIDEvent);
}
///////////////////////////////////////////////////////////////////////////////
// OnSetCursor
BOOL CXHyperLink::OnSetCursor(CWnd* /*pWnd*/, UINT /*nHitTest*/, UINT /*message*/)
{
if (m_hLinkCursor)
{
::SetCursor(m_hLinkCursor);
return TRUE;
}
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
// OnEraseBkgnd
BOOL CXHyperLink::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(rect);
if (m_crBackground != (UINT)-1)
pDC->FillSolidRect(rect, m_crBackground);
else
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink operations
///////////////////////////////////////////////////////////////////////////////
// SetURL
void CXHyperLink::SetURL(CString strURL)
{
m_strURL = strURL;
if (::IsWindow(GetSafeHwnd()))
{
PositionWindow();
m_ToolTip.UpdateTipText(strURL, this, TOOLTIP_ID);
}
}
///////////////////////////////////////////////////////////////////////////////
// SetColours
void CXHyperLink::SetColours(COLORREF crLinkColour,
COLORREF crVisitedColour,
COLORREF crHoverColour /* = -1 */)
{
m_crLinkColour = crLinkColour;
m_crVisitedColour = crVisitedColour;
if (crHoverColour == -1)
m_crHoverColour = ::GetSysColor(COLOR_HIGHLIGHT);
else
m_crHoverColour = crHoverColour;
if (::IsWindow(m_hWnd))
Invalidate();
}
///////////////////////////////////////////////////////////////////////////////
// SetBackgroundColour
void CXHyperLink::SetBackgroundColour(COLORREF crBackground)
{
m_crBackground = crBackground;
if (m_Brush.GetSafeHandle())
m_Brush.DeleteObject();
m_Brush.CreateSolidBrush(m_crBackground);
}
///////////////////////////////////////////////////////////////////////////////
// SetVisited
void CXHyperLink::SetVisited(BOOL bVisited /* = TRUE */)
{
m_bVisited = bVisited;
if (::IsWindow(GetSafeHwnd()))
Invalidate();
}
///////////////////////////////////////////////////////////////////////////////
// SetLinkCursor
void CXHyperLink::SetLinkCursor(HCURSOR hCursor)
{
m_hLinkCursor = hCursor;
if (m_hLinkCursor == NULL)
SetDefaultCursor();
}
///////////////////////////////////////////////////////////////////////////////
// SetUnderline
void CXHyperLink::SetUnderline(int nUnderline /*=ulHover*/)
{
if (m_nUnderline == nUnderline)
return;
if (::IsWindow(GetSafeHwnd()))
{
if (nUnderline == ulAlways)
SetFont(&m_UnderlineFont);
else
SetFont(&m_StdFont);
Invalidate();
}
m_nUnderline = nUnderline;
}
///////////////////////////////////////////////////////////////////////////////
// SetAutoSize
void CXHyperLink::SetAutoSize(BOOL bAutoSize /* = TRUE */)
{
m_bAdjustToFit = bAutoSize;
if (::IsWindow(GetSafeHwnd()))
PositionWindow();
}
///////////////////////////////////////////////////////////////////////////////
// SetWindowText
void CXHyperLink::SetWindowText(LPCTSTR lpszString)
{
ASSERT(lpszString);
if (!lpszString)
return;
CStatic::SetWindowText(_T(""));
RedrawWindow();
CStatic::SetWindowText(lpszString);
PositionWindow();
}
///////////////////////////////////////////////////////////////////////////////
// PositionWindow
// Move and resize the window so that the window is the same size
// as the hyperlink text. This stops the hyperlink cursor being active
// when it is not directly over the text. If the text is left justified
// then the window is merely shrunk, but if it is centred or right
// justified then the window will have to be moved as well.
//
// Suggested by P<>l K. T<>nder
//
void CXHyperLink::PositionWindow()
{
if (!::IsWindow(GetSafeHwnd()) || !m_bAdjustToFit)
return;
// Get the current window position
CRect WndRect, ClientRect;
GetWindowRect(WndRect);
GetClientRect(ClientRect);
ClientToScreen(ClientRect);
CWnd* pParent = GetParent();
if (pParent)
{
pParent->ScreenToClient(WndRect);
pParent->ScreenToClient(ClientRect);
}
// Get the size of the window text
CString strWndText;
GetWindowText(strWndText);
CDC* pDC = GetDC();
CFont* pOldFont = pDC->SelectObject(&m_UnderlineFont);
CSize Extent = pDC->GetTextExtent(strWndText);
pDC->SelectObject(pOldFont);
ReleaseDC(pDC);
// Adjust for window borders
Extent.cx += WndRect.Width() - ClientRect.Width();
Extent.cy += WndRect.Height() - ClientRect.Height();
// Get the text justification via the window style
DWORD dwStyle = GetStyle();
// Recalc the window size and position based on the text justification
if (dwStyle & SS_CENTERIMAGE)
WndRect.DeflateRect(0, (WndRect.Height() - Extent.cy)/2);
else
WndRect.bottom = WndRect.top + Extent.cy;
if (dwStyle & SS_CENTER)
WndRect.DeflateRect((WndRect.Width() - Extent.cx)/2, 0);
else if (dwStyle & SS_RIGHT)
WndRect.left = WndRect.right - Extent.cx;
else // SS_LEFT = 0, so we can't test for it explicitly
WndRect.right = WndRect.left + Extent.cx;
// Move the window
SetWindowPos(NULL,
WndRect.left, WndRect.top,
WndRect.Width(), WndRect.Height(),
SWP_NOZORDER);
}
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink implementation
///////////////////////////////////////////////////////////////////////////////
// SetDefaultCursor
void CXHyperLink::SetDefaultCursor()
{
if (m_hLinkCursor == NULL) // No cursor handle - try to load one
{
// First try to load the Win98 / Windows 2000 hand cursor
TRACE(_T("loading from IDC_HAND\n"));
m_hLinkCursor = AfxGetApp()->LoadStandardCursor(IDC_HAND);
if (m_hLinkCursor == NULL) // Still no cursor handle -
// load the WinHelp hand cursor
{
// The following appeared in Paul DiLascia's Jan 1998 MSJ articles.
// It loads a "hand" cursor from the winhlp32.exe module.
TRACE(_T("loading from winhlp32\n"));
// Get the windows directory
CString strWndDir;
GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH);
strWndDir.ReleaseBuffer();
strWndDir += _T("\\winhlp32.exe");
// This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
HMODULE hModule = LoadLibrary(strWndDir);
if (hModule)
{
HCURSOR hHandCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
if (hHandCursor)
m_hLinkCursor = CopyCursor(hHandCursor);
FreeLibrary(hModule);
}
}
}
}
///////////////////////////////////////////////////////////////////////////////
// GetRegKey
LONG CXHyperLink::GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata)
{
HKEY hkey;
LONG retval = RegOpenKeyEx(key, subkey, 0, KEY_QUERY_VALUE, &hkey);
if (retval == ERROR_SUCCESS)
{
long datasize = MAX_PATH;
TCHAR data[MAX_PATH];
RegQueryValue(hkey, NULL, data, &datasize);
_tcscpy(retdata, data);
RegCloseKey(hkey);
}
return retval;
}
///////////////////////////////////////////////////////////////////////////////
// ReportError
void CXHyperLink::ReportError(int nError)
{
#ifdef XHYPERLINK_REPORT_ERROR
CString str;
switch (nError)
{
case 0: str = "The operating system is out\nof memory or resources."; break;
case SE_ERR_PNF: str = "The specified path was not found."; break;
case SE_ERR_FNF: str = "The specified file was not found."; break;
case ERROR_BAD_FORMAT: str = "The .EXE file is invalid\n(non-Win32 .EXE or error in .EXE image)."; break;
case SE_ERR_ACCESSDENIED: str = "The operating system denied\naccess to the specified file."; break;
case SE_ERR_ASSOCINCOMPLETE: str = "The filename association is\nincomplete or invalid."; break;
case SE_ERR_DDEBUSY: str = "The DDE transaction could not\nbe completed because other DDE transactions\nwere being processed."; break;
case SE_ERR_DDEFAIL: str = "The DDE transaction failed."; break;
case SE_ERR_DDETIMEOUT: str = "The DDE transaction could not\nbe completed because the request timed out."; break;
case SE_ERR_DLLNOTFOUND: str = "The specified dynamic-link library was not found."; break;
case SE_ERR_NOASSOC: str = "There is no application associated\nwith the given filename extension."; break;
case SE_ERR_OOM: str = "There was not enough memory to complete the operation."; break;
case SE_ERR_SHARE: str = "A sharing violation occurred. ";
default: str.Format(_T("Unknown Error (%d) occurred."), nError); break;
}
str = "Unable to open hyperlink:\n\n" + str;
AfxMessageBox(str, MB_ICONEXCLAMATION | MB_OK);
#else
UNUSED_ALWAYS(nError);
#endif // XHYPERLINK_REPORT_ERROR
}
///////////////////////////////////////////////////////////////////////////////
// NotifyParent
void CXHyperLink::NotifyParent()
{
if (m_bNotifyParent)
{
CWnd *pParent = GetParent();
if (pParent && ::IsWindow(pParent->m_hWnd))
{
// wParam will contain control id
pParent->SendMessage(WM_XHYPERLINK_CLICKED, GetDlgCtrlID());
}
}
}
///////////////////////////////////////////////////////////////////////////////
// GotoURL
HINSTANCE CXHyperLink::GotoURL(LPCTSTR url, int showcmd, BOOL bAlwaysOpenNew /*= FALSE*/)
{
// if no url then this is not an internet link
if (!url || url[0] == _T('\0'))
return (HINSTANCE) HINSTANCE_ERROR + 1;
TCHAR key[MAX_PATH*2];
// First try ShellExecute()
TCHAR *verb = _T("open");
if (bAlwaysOpenNew)
verb = _T("new");
HINSTANCE result = ShellExecute(NULL, verb, url, NULL,NULL, showcmd);
// If it failed, get the .htm regkey and lookup the program
if (result <= (HINSTANCE)HINSTANCE_ERROR)
{
if (GetRegKey(HKEY_CLASSES_ROOT, _T(".htm"), key) == ERROR_SUCCESS)
{
_tcscat(key, _T("\\shell\\open\\command"));
if (GetRegKey(HKEY_CLASSES_ROOT,key,key) == ERROR_SUCCESS)
{
TCHAR *pos;
pos = _tcsstr(key, _T("\"%1\""));
if (pos == NULL)
{ // No quotes found
pos = _tcsstr(key, _T("%1")); // Check for %1, without quotes
if (pos == NULL) // No parameter at all...
pos = key + _tcslen(key)-1;
else
*pos = _T('\0'); // Remove the parameter
}
else
{
*pos = _T('\0'); // Remove the parameter
}
_tcscat(pos, _T(" "));
_tcscat(pos, url);
USES_CONVERSION;
result = (HINSTANCE) (UINT_PTR) WinExec(T2A(key),showcmd);
}
}
}
return result;
}

View File

@@ -0,0 +1,185 @@
// XHyperLink.h Version 1.0
//
// XHyperLink static control. Will open the default browser with the given URL
// when the user clicks on the link.
//
// Copyright Chris Maunder, 1997-1999 (cmaunder@mail.com)
// Feel free to use and distribute. May not be sold for profit.
//
// 2/29/00 -- P. Shaffer standard font mod.
//
///////////////////////////////////////////////////////////////////////////////
//
// Modified by: Hans Dietrich
// hdietrich@gmail.com
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XHYPERLINK_H
#define XHYPERLINK_H
extern UINT WM_XHYPERLINK_CLICKED;
/////////////////////////////////////////////////////////////////////////////
// CXHyperLink window
class CXHyperLink : public CStatic
{
// Construction/destruction
public:
CXHyperLink();
virtual ~CXHyperLink();
public:
enum UnderLineOptions { ulHover = -1, ulNone = 0, ulAlways = 1};
// Attributes
public:
void SetURL(CString strURL);
CString GetURL() const
{
return m_strURL;
}
void EnableURL(BOOL bFlag) { m_bIsURLEnabled = bFlag; }
BOOL IsURLEnabled() const { return m_bIsURLEnabled; }
void SetColours(COLORREF crLinkColour,
COLORREF crVisitedColour,
COLORREF crHoverColour = -1);
COLORREF GetLinkColour() const
{
return m_crLinkColour;
}
COLORREF GetVisitedColour() const
{
return m_crVisitedColour;
}
COLORREF GetHoverColour() const
{
return m_crHoverColour;
}
void SetBackgroundColour(COLORREF crBackground);
COLORREF GetBackgroundColour() const
{
return m_crBackground;
}
void SetVisited(BOOL bVisited = TRUE);
BOOL GetVisited() const
{
return m_bVisited;
}
void SetLinkCursor(HCURSOR hCursor);
HCURSOR CXHyperLink::GetLinkCursor() const
{
return m_hLinkCursor;
}
void SetUnderline(int nUnderline = ulHover);
int GetUnderline() const
{
return m_nUnderline;
}
void SetAutoSize(BOOL bAutoSize = TRUE);
BOOL GetAutoSize() const
{
return m_bAdjustToFit;
}
void SetNotifyParent(BOOL bFlag) { m_bNotifyParent = bFlag; }
BOOL GetNotifyParent() const { return m_bNotifyParent; }
void EnableTooltip(BOOL bFlag)
{
m_bToolTip = bFlag;
m_ToolTip.Activate(m_bToolTip);
}
BOOL IsTooltipEmabled() const
{
return m_bToolTip;
}
void SetAlwaysOpenNew(BOOL bFlag)
{
m_bAlwaysOpenNew = bFlag;
}
BOOL GetAlwaysOpenNew() const
{
return m_bAlwaysOpenNew;
}
void SetWindowText(LPCTSTR lpszString);
// Operations
public:
static HINSTANCE GotoURL(LPCTSTR url, int showcmd, BOOL bAlwaysOpenNew = FALSE);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXHyperLink)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
virtual BOOL DestroyWindow();
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
protected:
static LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
void NotifyParent();
void PositionWindow();
void ReportError(int nError);
void SetDefaultCursor();
// Protected attributes
protected:
COLORREF m_crLinkColour; // Hyperlink colours
COLORREF m_crVisitedColour;
COLORREF m_crHoverColour; // Hover colour
COLORREF m_crBackground; // background color
CBrush m_Brush; // background brush
BOOL m_bOverControl; // cursor over control?
BOOL m_bVisited; // Has it been visited?
int m_nUnderline; // underline hyperlink?
BOOL m_bAdjustToFit; // Adjust window size to fit text?
CString m_strURL; // hyperlink URL
CFont m_UnderlineFont; // Font for underline display
CFont m_StdFont; // Standard font
HCURSOR m_hLinkCursor; // Cursor for hyperlink
CToolTipCtrl m_ToolTip; // The tooltip
UINT m_nTimerID;
BOOL m_bIsURLEnabled; // TRUE = navigate to url
BOOL m_bNotifyParent; // TRUE = notify parent
BOOL m_bToolTip; // TRUE = display tooltip
BOOL m_bAlwaysOpenNew; // TRUE = always open new browser window
// Generated message map functions
protected:
//{{AFX_MSG(CXHyperLink)
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnClicked();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif //XHYPERLINK_H

View File

@@ -0,0 +1,424 @@
// XMonoFontDialog.cpp Version 1.1
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// Description:
// XMonoFontDialog.cpp implements CXMonoFontDialog, a class to display
// a customized CFontDialog.
//
// History
// Version 1.1 - 2008 October 29
// - Fixed problem with small point sizes
//
// Version 1.0 - 2008 October 22
// - Initial public release
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XMonoFontDialog.h"
#include "XMonoFontDialogRes.h"
#include "XFontSize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifndef __noop
#if _MSC_VER < 1300
#define __noop ((void)0)
#endif
#endif
#undef TRACE
#define TRACE __noop
//=============================================================================
// if you want to see the TRACE output, uncomment this line:
//#include "XTrace.h"
//=============================================================================
#pragma warning(disable : 4996) // disable bogus deprecation warning
#define TIMER_FONTLIST_SELCHANGE 1
#define TIMER_FONTSIZES_SELCHANGE 2
#define TIMER_FONTSIZES_UPDATE 3
static int CALLBACK EnumFontFamExProcSizes(const ENUMLOGFONTEX *lpelfe,
const NEWTEXTMETRICEX *lpntme,
DWORD FontType,
LPARAM lParam);
IMPLEMENT_DYNAMIC(CXMonoFontDialog, CDialog)
//=============================================================================
BEGIN_MESSAGE_MAP(CXMonoFontDialog, CDialog)
//=============================================================================
//{{AFX_MSG_MAP(CXMonoFontDialog)
ON_WM_CTLCOLOR()
ON_WM_TIMER()
ON_CBN_SELCHANGE(IDC_FONT_LIST, OnSelchangeFontList)
ON_CBN_SELCHANGE(IDC_FONT_SIZE, OnSelchangeFontSize)
ON_CBN_EDITCHANGE(IDC_FONT_SIZE, OnEditchangeFontSize)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//=============================================================================
CXMonoFontDialog::CXMonoFontDialog(LPLOGFONT lplfInitial,
DWORD /*dwFlags*/, // compatibility with CFontDialog
CDC* /*pdcPrinter*/, // compatibility with CFontDialog
CWnd* pParentWnd /*= NULL*/) :
// use string resource name to avoid resource id conflicts
CDialog(_T("IDD_XMONOFONTDIALOG"), pParentWnd)
//CDialog(IDD_XMONOFONTDIALOG, pParentWnd)
//=============================================================================
{
m_strFaceName = _T("");
m_strCaption = _T("Font");
m_strSampleText = _T("AaBbYyZz 0123456789");
m_strMonospacedLabel = _T("MONOSPACED");
m_Height = 0;
m_dwFontFilter = 0;
m_bShowMonospacedLabel = TRUE;
m_bShowMonospacedAsBold = TRUE;
memset(&m_lfInitial, 0, sizeof(LOGFONT));
memset(&m_lfCurrent, 0, sizeof(LOGFONT));
if (lplfInitial)
{
memcpy(&m_lfInitial, lplfInitial, sizeof(LOGFONT));
}
else
{
m_lfInitial.lfCharSet = DEFAULT_CHARSET;
_tcscpy(m_lfInitial.lfFaceName, _T("Courier"));
m_lfInitial.lfHeight = FontSize.GetFontHeight(10);
}
memcpy(&m_lfCurrent, &m_lfInitial, sizeof(LOGFONT));
m_nPointSize = FontSize.GetFontPointSize(m_lfInitial.lfHeight);
m_strFaceName = m_lfInitial.lfFaceName;
}
//=============================================================================
CXMonoFontDialog::~CXMonoFontDialog()
//=============================================================================
{
if (m_SampleFont.GetSafeHandle())
m_SampleFont.DeleteObject();
}
//=============================================================================
void CXMonoFontDialog::DoDataExchange(CDataExchange* pDX)
//=============================================================================
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CXMonoFontDialog)
DDX_Control(pDX, IDC_FONT_SIZE, m_FontSizes);
DDX_Control(pDX, IDC_FONT_SAMPLE, m_Sample);
DDX_Control(pDX, IDC_FONT_MONOSPACED, m_MonospacedLabel);
DDX_Control(pDX, IDC_FONT_LIST, m_FontList);
//}}AFX_DATA_MAP
}
//=============================================================================
BOOL CXMonoFontDialog::OnInitDialog()
//=============================================================================
{
m_FontList.SetFontFilter(m_dwFontFilter)
.SetFont(m_lfInitial)
.ShowMonospacedAsBold(m_bShowMonospacedAsBold);
CDialog::OnInitDialog();
// at this point the font list combo has been filled with font names
m_MonospacedLabel.SetWindowText(m_strMonospacedLabel);
int h = m_FontList.GetItemHeight(0);
m_FontSizes.SetItemHeight(-1, h);
SetWindowText(m_strCaption);
m_Sample.SetWindowText(m_strSampleText);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
//=============================================================================
HBRUSH CXMonoFontDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
//=============================================================================
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// set MONOSPACED label to blue
CWnd *pMonoSpaced = GetDlgItem(IDC_FONT_MONOSPACED);
if (pMonoSpaced && pWnd)
{
if (pWnd->m_hWnd == pMonoSpaced->m_hWnd)
pDC->SetTextColor(RGB(0,0,255));
}
return hbr;
}
//=============================================================================
void CXMonoFontDialog::GetCurrentFont(LPLOGFONT lplf)
//=============================================================================
{
ASSERT(lplf);
if (lplf)
memcpy(lplf, &m_lfCurrent, sizeof(LOGFONT));
}
//=============================================================================
// called when user selects size in combo list
void CXMonoFontDialog::OnSelchangeFontSize()
//=============================================================================
{
TRACE(_T("in CXMonoFontDialog::OnSelchangeFontSize\n"));
SetTimer(TIMER_FONTSIZES_SELCHANGE, 50, 0);
}
//=============================================================================
// called when user types in size combo edit box
void CXMonoFontDialog::OnEditchangeFontSize()
//=============================================================================
{
TRACE(_T("in CXMonoFontDialog::OnEditchangeFontSize\n"));
SetTimer(TIMER_FONTSIZES_UPDATE, 50, 0);
}
//=============================================================================
// called when user selects font in combo list
void CXMonoFontDialog::OnSelchangeFontList()
//=============================================================================
{
TRACE(_T("in CXMonoFontDialog::OnSelchangeFontList\n"));
CString s = _T("");
CString strFont = _T("");
int index = m_FontList.GetCurSel();
if (index != CB_ERR)
{
m_FontList.GetLBText(index, strFont);
m_FontList.SetWindowText(strFont);
m_FontSizes.ResetContent();
DWORD dwFlags = m_FontList.GetItemData(index);
if (dwFlags & (XFONT_TRUETYPE | XFONT_OPENTYPE | XFONT_VECTOR))
{
// use standard set of sizes
TRACE(_T("open or true type or vector\n"));
static int nSizes[] = { 8, 9, 10, 11, 12, 14, 16, 18,
20, 22, 24, 26, 28, 36, 48, 72, -1 };
for (int i = 0; nSizes[i] != -1; i++)
{
s.Format(_T("%d"), nSizes[i]);
m_FontSizes.AddString(s);
}
}
else
{
// some other font type - enumerate sizes
m_FontList.GetLBText(index, s);
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfCharSet = DEFAULT_CHARSET;
_tcsncpy(lf.lfFaceName, s, sizeof(lf.lfFaceName)/sizeof(TCHAR)-1);
CClientDC dcClient(this);
TRACE(_T("===== STARTING SIZE ENUMERATION ===========\n"));
EnumFontFamiliesEx(dcClient, &lf,
(FONTENUMPROC) EnumFontFamExProcSizes, (LPARAM)&m_FontSizes, 0);
TRACE(_T("===== ENDING SIZE ENUMERATION ===========\n"));
}
}
// clear size selection
m_FontSizes.SetCurSel(-1);
// set size in combo edit box
s.Format(_T("%d"), m_nPointSize);
m_FontSizes.SetWindowText(s);
// try to select size in combo
index = m_FontSizes.FindStringExact(-1, s);
if (index != CB_ERR)
m_FontSizes.SetCurSel(index);
SetCurFont();
}
//=============================================================================
void CXMonoFontDialog::SetCurFont()
//=============================================================================
{
TRACE(_T("in CXMonoFontDialog::SetCurFont\n"));
int index = m_FontList.GetCurSel();
if (index != CB_ERR)
{
m_dwXFontFlags = m_FontList.GetItemData(index);
m_FontList.GetLBText(index, m_strFaceName);
}
CString s = _T("");
m_FontSizes.GetWindowText(s);
if (s.IsEmpty())
s = _T("10");
int n = _ttoi(s);
if (n > 0)
m_nPointSize = n;
TRACE(_T("SetCurFont: setting font to %s(%d)\n"), m_strFaceName, m_nPointSize);
// set sample font
memset(&m_lfCurrent, 0, sizeof(LOGFONT));
m_lfCurrent.lfHeight = FontSize.GetFontHeight(m_nPointSize);
m_Height = m_lfCurrent.lfHeight;
m_lfCurrent.lfCharSet = DEFAULT_CHARSET;
_tcsncpy(m_lfCurrent.lfFaceName, m_strFaceName,
sizeof(m_lfCurrent.lfFaceName)/sizeof(TCHAR)-1);
DWORD weight = (m_dwXFontFlags & XFONT_WEIGHT_MASK) >> 16;
m_lfCurrent.lfWeight = weight;
m_lfCurrent.lfItalic = (BYTE) (m_dwXFontFlags & XFONT_ITALIC);
if (m_SampleFont.GetSafeHandle())
m_SampleFont.DeleteObject();
m_SampleFont.CreateFontIndirect(&m_lfCurrent);
m_Sample.SetFont(&m_SampleFont);
// show / hide MONOSPACED label
BOOL bIsMonospaced = m_dwXFontFlags & XFONT_MONOSPACED;
m_MonospacedLabel.ShowWindow((bIsMonospaced && m_bShowMonospacedLabel) ?
SW_SHOW : SW_HIDE);
// enable bold typeface in combo list
m_FontList.SetBold(bIsMonospaced && m_bShowMonospacedAsBold);
}
//=============================================================================
void CXMonoFontDialog::OnOK()
//=============================================================================
{
CString s = _T("");
m_FontSizes.GetWindowText(s);
if (s.IsEmpty())
s = _T("10");
m_nPointSize = _ttoi(s);
if (m_nPointSize <= 0)
m_nPointSize = 10;
memset(&m_lfCurrent, 0, sizeof(LOGFONT));
m_lfCurrent.lfHeight = FontSize.GetFontHeight(m_nPointSize);
m_Height = m_lfCurrent.lfHeight;
m_lfCurrent.lfCharSet = DEFAULT_CHARSET;
_tcsncpy(m_lfCurrent.lfFaceName, m_strFaceName,
sizeof(m_lfCurrent.lfFaceName)/sizeof(TCHAR)-1);
DWORD weight = (m_dwXFontFlags & XFONT_WEIGHT_MASK) >> 16;
m_lfCurrent.lfWeight = weight;
m_lfCurrent.lfItalic = (BYTE) (m_dwXFontFlags & XFONT_ITALIC);
CDialog::OnOK();
}
//=============================================================================
void CXMonoFontDialog::OnTimer(UINT nIDEvent)
//=============================================================================
{
KillTimer(nIDEvent);
if (nIDEvent == TIMER_FONTSIZES_SELCHANGE)
{
SetCurFont();
}
else if (nIDEvent == TIMER_FONTSIZES_UPDATE)
{
// user is typing into combo edit box - check if what he has typed
// so far is a valid size, and select it if it is
CString strSize = _T("");
m_FontSizes.GetWindowText(strSize);
int index = m_FontSizes.FindStringExact(-1, strSize);
if (index != CB_ERR)
{
TRACE(_T("found size at %d\n"), index);
m_FontSizes.SetCurSel(index);
}
OnSelchangeFontSize();
}
CDialog::OnTimer(nIDEvent);
}
#pragma warning(push)
#pragma warning(disable: 4100)
//=============================================================================
// This function is the enumeration callback for font sizes.
// Its purpose is to fill the size combo with non-duplicate
// sizes, making sure that they are entered in numerical order.
int CALLBACK EnumFontFamExProcSizes(const ENUMLOGFONTEX *lpelfe,
const NEWTEXTMETRICEX *lpntme,
DWORD FontType,
LPARAM lParam)
//=============================================================================
{
// the lParam is a pointer to the size combobox
CComboBox *pCombo = (CComboBox *) lParam;
ASSERT(pCombo);
ASSERT(IsWindow(pCombo->m_hWnd));
int nFontHeight = lpntme->ntmTm.tmHeight - lpntme->ntmTm.tmInternalLeading;
int nPointSize = FontSize.GetFontPointSize(nFontHeight);
TRACE(_T("_____ %s nPointSize=%d FontType=0x%X\n"),
lpelfe->elfLogFont.lfFaceName,
nPointSize,
FontType);
TCHAR szSize[100];
_stprintf(szSize, _T("%d"), nPointSize);
if (pCombo->FindStringExact(-1, szSize) == CB_ERR)
{
// size is not in list
// the sizes are not always enumerated in numerical order,
// so we have to check where to insert this size
// (example: Terminal font)
BOOL bAdded = FALSE;
int n = 0;
int count = pCombo->GetCount();
TCHAR szEntry[100];
for (int i = 0; i < count; i++)
{
szEntry[0] = 0;
pCombo->GetLBText(i, szEntry);
n = _ttoi(szEntry);
if (nPointSize < n)
{
VERIFY(pCombo->InsertString(i, szSize) >= 0);
bAdded = TRUE;
break;
}
}
if (!bAdded)
VERIFY(pCombo->AddString(szSize) >= 0);
}
return TRUE; // continue enumeration
}
#pragma warning(pop)

View File

@@ -0,0 +1,152 @@
// XMonoFontDialog.h Version 1.1
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XMONOFONTDIALOG_H
#define XMONOFONTDIALOG_H
#include "XMonoFontListCombo.h"
//=============================================================================
// font filters
//=============================================================================
#define XFONT_SHOW_SYMBOL 0x01 // show symbol fonts
#define XFONT_SHOW_MONOSPACED 0x02 // show monospaced fonts
#define XFONT_SHOW_BOLD 0x04 // show bold fonts
#define XFONT_SHOW_ITALIC 0x08 // show italic fonts
#define XFONT_SHOW_NORMAL 0x10 // show normal fonts
#define XFONT_SHOW_ALL 0xFF // show all
//=============================================================================
// bit definitions for m_dwXFontFlags
//=============================================================================
#define XFONT_TRUETYPE 0x00000001
#define XFONT_OPENTYPE 0x00000002
#define XFONT_RASTER 0x00000004
#define XFONT_VECTOR 0x00000008
#define XFONT_FAMILY_MASK 0x000000F0
#define XFONT_BOLD 0x00000100
#define XFONT_ITALIC 0x00000200
#define XFONT_SYMBOL 0x00000400
#define XFONT_MONOSPACED 0x00000800
#define XFONT_OEM 0x00001000
#define XFONT_WEIGHT_MASK 0x0FFF0000
//=============================================================================
class CXMonoFontDialog : public CDialog
//=============================================================================
{
DECLARE_DYNAMIC(CXMonoFontDialog)
// Construction
public:
CXMonoFontDialog(LPLOGFONT lplfInitial = NULL,
DWORD dwFlags = 0,
CDC *pdcPrinter = NULL,
CWnd *pParentWnd = NULL);
virtual ~CXMonoFontDialog();
// Dialog Data
//{{AFX_DATA(CXMonoFontDialog)
CXMonoFontListCombo m_FontList;
CComboBox m_FontSizes;
CStatic m_Sample;
CStatic m_MonospacedLabel;
//}}AFX_DATA
// Attributes
public:
// CFontDialog
COLORREF GetColor() const { return RGB(0,0,0); }
void GetCurrentFont(LPLOGFONT lplf);
CString GetFaceName() const { return m_strFaceName; }
int GetSize() const { return 10*m_nPointSize; }
CString GetStyleName() const { return _T(""); }
int GetWeight() const
{ return (m_dwXFontFlags & XFONT_WEIGHT_MASK) >> 16; }
// the following 4 functions report the selection in the style combo,
// which we do not use
BOOL IsBold() const { return FALSE; }
BOOL IsItalic() const { return FALSE; }
BOOL IsStrikeOut() const { return FALSE; }
BOOL IsUnderline() const { return FALSE; }
// CXMonoFontDialog
CString GetCaption() { return m_strCaption; }
DWORD GetFontData() { return m_dwXFontFlags; }
DWORD GetFontFilter() { return m_dwFontFilter; }
CString GetSampleText() { return m_strSampleText; }
LONG GetTmHeight() { return m_Height; }
BOOL IsMonospaced() { return (m_dwXFontFlags & XFONT_MONOSPACED); }
BOOL IsOpenType() { return (m_dwXFontFlags & XFONT_OPENTYPE); }
BOOL IsSymbol() { return (m_dwXFontFlags & XFONT_SYMBOL); }
BOOL IsTrueType() { return (m_dwXFontFlags & XFONT_TRUETYPE); }
BOOL IsVector() { return (m_dwXFontFlags & XFONT_VECTOR); }
CXMonoFontDialog& SetCaption(LPCTSTR strCaption)
{ m_strCaption = strCaption; return *this; }
CXMonoFontDialog& SetFontFilter(DWORD dwFontFilter)
{ m_dwFontFilter = dwFontFilter; return *this; }
CXMonoFontDialog& SetMonospacedLabel(LPCTSTR lpszLabel)
{ m_strMonospacedLabel = lpszLabel; return *this; }
CXMonoFontDialog& SetSampleText(LPCTSTR lpszSampleText)
{ m_strSampleText = lpszSampleText; return *this; }
CXMonoFontDialog& ShowMonospacedLabel(BOOL bShow)
{ m_bShowMonospacedLabel = bShow; return *this; }
CXMonoFontDialog& ShowMonospacedAsBold(BOOL bShow)
{ m_bShowMonospacedAsBold = bShow; return *this; }
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
LOGFONT m_lfInitial;
CFont m_SampleFont;
CString m_strCaption;
CString m_strSampleText;
CString m_strMonospacedLabel;
DWORD m_dwFontFilter;
BOOL m_bShowMonospacedLabel;
BOOL m_bShowMonospacedAsBold;
CImageList m_FontType;
// current font
CString m_strFaceName;
LONG m_Height;
int m_nPointSize;
LOGFONT m_lfCurrent;
DWORD m_dwXFontFlags;
void SetCurFont();
//{{AFX_MSG(CXMonoFontDialog)
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeFontList();
afx_msg void OnSelchangeFontSize();
afx_msg void OnEditchangeFontSize();
afx_msg void OnTimer(UINT nIDEvent);
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTDIALOG_H

View File

@@ -0,0 +1,110 @@
//Microsoft Developer Studio generated resource script.
//
#include "XMonoFontDialogRes.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"XMonoFontDialogRes.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_XMONOFONTDIALOG DIALOG DISCARDABLE 0, 0, 235, 170
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Font"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "&Font:",IDC_STATIC,11,7,17,8
LTEXT "MONOSPACED",IDC_FONT_MONOSPACED,49,7,55,8,NOT
WS_VISIBLE
LTEXT "&Size:",IDC_STATIC,144,7,30,9,NOT WS_GROUP
COMBOBOX IDC_FONT_LIST,10,16,130,97,CBS_SIMPLE |
CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT |
CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL |
WS_TABSTOP
COMBOBOX IDC_FONT_SIZE,144,16,30,97,CBS_SIMPLE |
CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Sample",IDC_STATIC,10,118,215,43,WS_GROUP
CTEXT "AaBbYyZz 0123456789",IDC_FONT_SAMPLE,15,129,205,25,
SS_NOPREFIX | SS_CENTERIMAGE
DEFPUSHBUTTON "OK",IDOK,182,16,44,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,182,34,44,14,WS_GROUP
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_XMONOFONTDIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 163
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,20 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by XMonoFontDialog.rc
//
//#define IDD_XMONOFONTDIALOG 999
#define IDC_FONT_LIST 1001
#define IDC_FONT_SIZE 1002
#define IDC_FONT_SAMPLE 1003
#define IDC_FONT_MONOSPACED 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,52 @@
// XMonoFontDialogTest.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "XMonoFontDialogTest.h"
#include "XMonoFontDialogTestDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CXMonoFontDialogTestApp
BEGIN_MESSAGE_MAP(CXMonoFontDialogTestApp, CWinApp)
//{{AFX_MSG_MAP(CXMonoFontDialogTestApp)
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CXMonoFontDialogTestApp construction
CXMonoFontDialogTestApp::CXMonoFontDialogTestApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CXMonoFontDialogTestApp object
CXMonoFontDialogTestApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CXMonoFontDialogTestApp initialization
BOOL CXMonoFontDialogTestApp::InitInstance()
{
#if _MFC_VER < 0x700
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
CXMonoFontDialogTestDlg dlg;
m_pMainWnd = &dlg;
dlg.DoModal();
return FALSE;
}

View File

@@ -0,0 +1,42 @@
// XMonoFontDialogTest.h
//
#ifndef XMONOFONTDIALOGTEST_H
#define XMONOFONTDIALOGTEST_H
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CXMonoFontDialogTestApp:
// See XMonoFontDialogTest.cpp for the implementation of this class
//
class CXMonoFontDialogTestApp : public CWinApp
{
public:
CXMonoFontDialogTestApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontDialogTestApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CXMonoFontDialogTestApp)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTDIALOGTEST_H

View File

@@ -0,0 +1,258 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""XMonoFontDialog.rc""\r\n"
"#endif\r\n"
"#ifdef _VC60\r\n"
"/////////////////////////////////////////////////////////////////////////////\r\n"
"//\r\n"
"// 24\r\n"
"//\r\n"
"1 24 MOVEABLE PURE ""app.manifest""\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "hans.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 270, 131
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About XMonoFontDialogTest"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,14,20,20,SS_CENTERIMAGE |
WS_BORDER
LTEXT "XMonoFontDialogTest Version 1.1",IDC_STATIC,40,13,140,8,
SS_NOPREFIX
LTEXT "Copyright <20> 2008 Hans Dietrich",IDC_STATIC,40,27,165,8
LTEXT "This software is released into the public domain. You are free to use it in any way you like.",
IDC_STATIC,40,43,165,18
LTEXT "This software is provided ""as is"" with no expressed or implied warranty. I accept no liability for any damage or loss of business that this software may cause. ",
IDC_STATIC,40,67,165,34
LTEXT "Send email to Hans Dietrich",IDC_ABOUT_EMAIL,90,113,90,
8,SS_CENTERIMAGE
DEFPUSHBUTTON "OK",IDOK,209,9,50,14,WS_GROUP
END
IDD_XMONOFONTDIALOGTEST_DIALOG DIALOGEX 0, 0, 305, 262
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "XMonoFontDialogTest"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Sample",IDC_GROUPBOX,10,8,285,50,WS_GROUP
CTEXT "This is a sample 0123456789",IDC_SAMPLE,20,16,265,40,
SS_CENTERIMAGE
LTEXT "",IDC_PROPERTIES,10,58,285,10,SS_SUNKEN
LTEXT "Note: GetSize() returns tenths of a point",IDC_NOTE,13,
69,157,8,NOT WS_VISIBLE
GROUPBOX "Filters",IDC_STATIC,10,84,285,56,WS_GROUP
CONTROL "Show all fonts",IDC_ALL_FONTS,"Button",
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,18,97,60,10
CONTROL "Show symbol fonts only",IDC_SYMBOL,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,18,108,89,10
CONTROL "Show all fonts except symbol fonts",IDC_EXCEPT_SYMBOL,
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,119,124,10
CONTROL "Show monospaced fonts only",IDC_MONOSPACED,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,148,97,109,10
CONTROL "Show all fonts except monospaced fonts",
IDC_EXCEPT_MONOSPACED,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,148,108,143,10
CONTROL "Show all fonts except monospaced and symbol fonts",
IDC_EXCEPT_MONOSPACED_AND_SYMBOL,"Button",
BS_AUTORADIOBUTTON | BS_TOP | BS_MULTILINE | WS_TABSTOP,
148,119,141,16
GROUPBOX "Sample Text",IDC_STATIC,10,186,285,35,WS_GROUP
EDITTEXT IDC_SAMPLE_TEXT,20,200,265,12,ES_AUTOHSCROLL | WS_GROUP
PUSHBUTTON "CFontDialog",IDC_TEST2,10,230,80,23,WS_GROUP
DEFPUSHBUTTON "CXMonoFontDialog",IDC_TEST,106,230,94,23
PUSHBUTTON "Help",IDC_ONLINE_HELP,215,230,80,23
GROUPBOX "Monospaced Options",IDC_STATIC,10,146,285,34,WS_GROUP
CONTROL "Show Monospaced Label",IDC_SHOW_MONOSPACED_LABEL,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,19,161,99,10
CONTROL "Show Monospaced As Bold",IDC_SHOW_MONOSPACED_AS_BOLD,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,161,105,10
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,0,1
PRODUCTVERSION 1,1,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "Article", "www.codeproject.com\0"
VALUE "E-mail", "hdietrich@gmail.com\0"
VALUE "FileDescription", "XMonoFontDialogTest.exe\0"
VALUE "FileVersion", "1, 1, 0, 1\0"
VALUE "LegalCopyright", "Copyright <20> 2008 Hans Dietrich\0"
VALUE "OriginalFilename", "XMonoFontDialogTest.exe\0"
VALUE "ProductName", "XMonoFontDialogTest\0"
VALUE "ProductVersion", "1, 1, 0, 1\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_XMONOFONTDIALOGTEST_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 298
TOPMARGIN, 7
BOTTOMMARGIN, 255
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_ABOUTBOX "&About XMonoFontDialogTest..."
IDS_MAILTO "mailto:hdietrich@gmail.com?subject=XMonoFontDialog"
IDS_ONLINE_HELP "http://www.codeproject.com/KB/dialog/XMonoFontDialog.aspx"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "afxres.rc" // Standard components
#include "XMonoFontDialog.rc"
#endif
#ifdef _VC60
/////////////////////////////////////////////////////////////////////////////
//
// 24
//
1 24 MOVEABLE PURE "app.manifest"
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@@ -0,0 +1,341 @@
// XMonoFontDialogTestDlg.cpp : implementation file
//
#include "stdafx.h"
#include "XMonoFontDialogTest.h"
#include "XMonoFontDialogTestDlg.h"
#include "XMonoFontDialog.h"
#include "about.h"
#include "XTrace.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#pragma warning(disable : 4996) // disable bogus deprecation warning
//=============================================================================
BEGIN_MESSAGE_MAP(CXMonoFontDialogTestDlg, CDialog)
//=============================================================================
//{{AFX_MSG_MAP(CXMonoFontDialogTestDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_TEST, OnCXMonoFontDialog)
ON_BN_CLICKED(IDC_TEST2, OnCFontDialog)
ON_BN_CLICKED(IDC_ONLINE_HELP, OnOnlineHelp)
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//=============================================================================
CXMonoFontDialogTestDlg::CXMonoFontDialogTestDlg(CWnd* pParent /*=NULL*/)
: CDialog(CXMonoFontDialogTestDlg::IDD, pParent)
//=============================================================================
{
//{{AFX_DATA_INIT(CXMonoFontDialogTestDlg)
m_nFonts = 0;
m_strSampleText = _T("AaBbYyZz 0123456789");
m_bShowMonospacedAsBold = TRUE;
m_bShowMonospacedLabel = TRUE;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
//=============================================================================
CXMonoFontDialogTestDlg::~CXMonoFontDialogTestDlg()
//=============================================================================
{
m_font.DeleteObject();
m_buttonfont.DeleteObject();
}
//=============================================================================
void CXMonoFontDialogTestDlg::DoDataExchange(CDataExchange* pDX)
//=============================================================================
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CXMonoFontDialogTestDlg)
DDX_Control(pDX, IDC_NOTE, m_Note);
DDX_Control(pDX, IDC_PROPERTIES, m_Properties);
DDX_Control(pDX, IDC_SAMPLE, m_Sample);
DDX_Radio(pDX, IDC_ALL_FONTS, m_nFonts);
DDX_Text(pDX, IDC_SAMPLE_TEXT, m_strSampleText);
DDX_Check(pDX, IDC_SHOW_MONOSPACED_AS_BOLD, m_bShowMonospacedAsBold);
DDX_Check(pDX, IDC_SHOW_MONOSPACED_LABEL, m_bShowMonospacedLabel);
//}}AFX_DATA_MAP
}
//=============================================================================
BOOL CXMonoFontDialogTestDlg::OnInitDialog()
//=============================================================================
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
m_Sample.SetWindowText(m_strSampleText);
// create font for sample
LOGFONT lf;
CFont *pFont = GetFont();
pFont->GetLogFont(&lf);
m_nHeight = lf.lfHeight;
m_strFaceName = lf.lfFaceName;
m_font.CreateFontIndirect(&lf);
m_Sample.SetFont(&m_font);
if (lf.lfHeight < 0)
lf.lfHeight -= 1;
else
lf.lfHeight += 1;
//lf.lfWeight = FW_BOLD;
m_buttonfont.CreateFontIndirect(&lf);
GetDlgItem(IDC_TEST)->SetFont(&m_buttonfont);
GetDlgItem(IDC_TEST2)->SetFont(&m_buttonfont);
GetDlgItem(IDC_ONLINE_HELP)->SetFont(&m_buttonfont);
// display font name in sample groupbox
GetDlgItem(IDC_GROUPBOX)->SetWindowText(lf.lfFaceName);
return TRUE; // return TRUE unless you set the focus to a control
}
//=============================================================================
void CXMonoFontDialogTestDlg::OnSysCommand(UINT nID, LPARAM lParam)
//=============================================================================
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
//=============================================================================
void CXMonoFontDialogTestDlg::OnPaint()
//=============================================================================
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
//=============================================================================
HCURSOR CXMonoFontDialogTestDlg::OnQueryDragIcon()
//=============================================================================
{
return (HCURSOR) m_hIcon;
}
//=============================================================================
void CXMonoFontDialogTestDlg::OnCXMonoFontDialog()
//=============================================================================
{
UpdateData(TRUE);
// get font for current dialog, just to fill in LOGFONT
LOGFONT lf;
CFont *pFont = GetFont();
pFont->GetLogFont(&lf);
// use last font height
lf.lfHeight = m_nHeight;
// use last face name
_tcscpy(lf.lfFaceName, m_strFaceName);
TRACE(_T("m_strFaceName=%s\n"), m_strFaceName);
// display CXMonoFontDialog
CXMonoFontDialog dlg(&lf);
DWORD dwFonts = XFONT_SHOW_ALL;
// get font filters
switch (m_nFonts)
{
case 0:
dwFonts = XFONT_SHOW_ALL;
break;
case 1:
dwFonts = XFONT_SHOW_SYMBOL;
break;
case 2:
dwFonts &= ~XFONT_SHOW_SYMBOL;
break;
case 3:
dwFonts = XFONT_SHOW_MONOSPACED;
break;
case 4:
dwFonts &= ~XFONT_SHOW_MONOSPACED;
break;
case 5:
dwFonts &= ~(XFONT_SHOW_MONOSPACED|XFONT_SHOW_SYMBOL);
break;
default:
dwFonts = 0;
break;
}
dlg.SetFontFilter(dwFonts)
.SetCaption(_T("XMonoFontDialog"))
.SetSampleText(m_strSampleText)
.ShowMonospacedLabel(m_bShowMonospacedLabel)
.ShowMonospacedAsBold(m_bShowMonospacedAsBold);
if (dlg.DoModal() == IDOK)
{
// display properties for selected font
CString strProperties = _T("");
strProperties.Format(_T(" tmHeight = %d "), dlg.GetTmHeight());
CString str;
str.Format(_T("GetSize() = %d "), dlg.GetSize());
strProperties += str;
if (dlg.IsMonospaced())
strProperties += _T("Monospaced ");
if (dlg.IsSymbol())
strProperties += _T("Symbol ");
if (dlg.IsTrueType())
strProperties += _T("TrueType ");
if (dlg.IsOpenType())
strProperties += _T("OpenType ");
if (dlg.IsVector())
strProperties += _T("Vector ");
m_Properties.SetWindowText(strProperties);
m_Note.ShowWindow(SW_SHOW);
dlg.GetCurrentFont(&lf);
TRACE(_T("lfCharSet=%d\n"), lf.lfCharSet);
m_nHeight = lf.lfHeight;
m_strFaceName = lf.lfFaceName;
GetDlgItem(IDC_GROUPBOX)->SetWindowText(lf.lfFaceName);
m_font.DeleteObject();
m_font.CreateFontIndirect(&lf);
m_Sample.SetWindowText(m_strSampleText);
m_Sample.SetFont(&m_font);
}
}
//=============================================================================
void CXMonoFontDialogTestDlg::OnCFontDialog()
//=============================================================================
{
TRACE(_T("in CXMonoFontDialogTestDlg::OnCFontDialog\n"));
UpdateData(TRUE);
// get font for current dialog, just to fill in LOGFONT
LOGFONT lf;
CFont *pFont = GetFont();
pFont->GetLogFont(&lf);
// use last font height
lf.lfHeight = m_nHeight;
// use last face name
_tcscpy(lf.lfFaceName, m_strFaceName);
// display CFontDialog
CFontDialog dlg(&lf);
if (m_nFonts == 3)
dlg.m_cf.Flags |= CF_FIXEDPITCHONLY;
dlg.m_cf.Flags |= CF_PRINTERFONTS;
//dlg.m_cf.Flags &= ~CF_EFFECTS; // remove the Effects controls
//dlg.m_cf.Flags |= CF_NOSCRIPTSEL; // disable the script combo
if (dlg.DoModal() == IDOK)
{
CString strProperties = _T("");
CString str;
str.Format(_T(" GetSize() = %d "), dlg.GetSize());
strProperties += str;
m_Properties.SetWindowText(strProperties);
m_Note.ShowWindow(SW_SHOW);
dlg.GetCurrentFont(&lf);
m_nHeight = lf.lfHeight;
m_strFaceName = lf.lfFaceName;
TRACE(_T("lfCharSet=%d\n"), lf.lfCharSet);
//TRACE(_T("GetStyleName=%s\n"), dlg.GetStyleName());
TRACE(_T("IsBold=%d lfWeight=%d\n"), dlg.IsBold(), lf.lfWeight);
GetDlgItem(IDC_GROUPBOX)->SetWindowText(lf.lfFaceName);
m_font.DeleteObject();
m_font.CreateFontIndirect(&lf);
m_Sample.SetWindowText(m_strSampleText);
m_Sample.SetFont(&m_font);
}
}
//=============================================================================
void CXMonoFontDialogTestDlg::OnOnlineHelp()
//=============================================================================
{
CString strHelp = _T("");
VERIFY(strHelp.LoadString(IDS_ONLINE_HELP));
CXHyperLink::GotoURL(strHelp, SW_SHOW, TRUE);
}
//=============================================================================
HBRUSH CXMonoFontDialogTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
//=============================================================================
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
CWnd *pNote = GetDlgItem(IDC_NOTE);
if (pWnd->m_hWnd == pNote->m_hWnd)
pDC->SetTextColor(RGB(0,0,255));
return hbr;
}

View File

@@ -0,0 +1,59 @@
// XMonoFontDialogTestDlg.h : header file
//
#ifndef XMONOFONTDIALOGTESTDLG_H
#define XMONOFONTDIALOGTESTDLG_H
//=============================================================================
class CXMonoFontDialogTestDlg : public CDialog
//=============================================================================
{
// Construction
public:
CXMonoFontDialogTestDlg(CWnd* pParent = NULL); // standard constructor
virtual ~CXMonoFontDialogTestDlg();
// Dialog Data
//{{AFX_DATA(CXMonoFontDialogTestDlg)
enum { IDD = IDD_XMONOFONTDIALOGTEST_DIALOG };
CStatic m_Note;
CStatic m_Properties;
CStatic m_Sample;
int m_nFonts;
CString m_strSampleText;
BOOL m_bShowMonospacedAsBold;
BOOL m_bShowMonospacedLabel;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontDialogTestDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
CFont m_font;
CFont m_buttonfont;
CString m_strFaceName;
int m_nHeight;
// Generated message map functions
//{{AFX_MSG(CXMonoFontDialogTestDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnCXMonoFontDialog();
afx_msg void OnCFontDialog();
afx_msg void OnOnlineHelp();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTDIALOGTESTDLG_H

View File

@@ -0,0 +1,535 @@
// XMonoFontListCombo.cpp
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// Description:
// XMonoFontListCombo.cpp implements CXMonoFontListCombo, a class used by
// CXMonoFontDialog to display font names.
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XMonoFontListCombo.h"
#include "XMonoFontDialog.h"
#include "XFontSize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifndef __noop
#if _MSC_VER < 1300
#define __noop ((void)0)
#endif
#endif
#undef TRACE
#define TRACE __noop
//=============================================================================
// if you want to see the TRACE output, uncomment this line:
//#include "XTrace.h"
//=============================================================================
#pragma warning(disable : 4996) // disable bogus deprecation warning
#define GLYPH_SIZE 12
#define TIMER_INIT 1
static int CALLBACK EnumFontFamExProc(const ENUMLOGFONTEX *lpelfe,
const NEWTEXTMETRICEX *lpntme,
DWORD FontType,
LPARAM lParam);
//=============================================================================
BEGIN_MESSAGE_MAP(CXMonoFontListCombo, CComboBox)
//=============================================================================
//{{AFX_MSG_MAP(CXMonoFontListCombo)
ON_WM_TIMER()
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//=============================================================================
CXMonoFontListCombo::CXMonoFontListCombo()
//=============================================================================
{
m_bShowMonospacedAsBold = TRUE;
m_pDC = 0;
m_dwFontFilter = 0;
memset(&m_lfInitial, 0, sizeof(LOGFONT));
m_lfInitial.lfCharSet = DEFAULT_CHARSET;
_tcscpy(m_lfInitial.lfFaceName, _T("Courier"));
m_lfInitial.lfHeight = FontSize.GetFontHeight(8);
memcpy(&m_lfCurrent, &m_lfInitial, sizeof(LOGFONT));
}
//=============================================================================
CXMonoFontListCombo::~CXMonoFontListCombo()
//=============================================================================
{
if (m_BoldFont.GetSafeHandle())
m_BoldFont.DeleteObject();
m_FontType.DeleteImageList();
}
//=============================================================================
void CXMonoFontListCombo::PreSubclassWindow()
//=============================================================================
{
TRACE(_T("in CXMonoFontListCombo::PreSubclassWindow\n"));
TRACE(_T("m_dwFontFilter=%X\n"), m_dwFontFilter);
CreateFontTypeImages();
CFont *pFont = GetFont();
if (!pFont)
pFont = GetParent()->GetFont();
if (pFont)
{
LOGFONT lf;
pFont->GetLogFont(&lf);
lf.lfWeight = FW_BOLD;
m_BoldFont.CreateFontIndirect(&lf);
}
// enumerate fonts, fill combo
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfCharSet = DEFAULT_CHARSET;
m_pDC = GetDC(); // use one dc for enumeration
if (m_pDC)
{
int nSavedDC = m_pDC->SaveDC();
EnumFontFamiliesEx(m_pDC->m_hDC,
&lf,
(FONTENUMPROC)EnumFontFamExProc,
(LPARAM)this,
0);
TEXTMETRIC tm;
m_pDC->GetTextMetrics(&tm);
m_pDC->RestoreDC(nSavedDC);
ReleaseDC(m_pDC);
// set height of edit box and combo list entries
int h = tm.tmHeight - tm.tmInternalLeading;
SetItemHeight(0, h);
SetItemHeight(-1, h);
}
m_pDC = 0;
// select initial font
int index = FindStringExact(-1, m_lfInitial.lfFaceName);
if (index == CB_ERR)
{
if (GetCount() > 0)
index = 0;
}
m_CurIndex = index;
if (index >= 0)
{
SetCurSel(index);
SetTimer(TIMER_INIT, 50, 0);
}
TRACE(_T("exiting CXMonoFontListCombo::PreSubclassWindow\n"));
CComboBox::PreSubclassWindow();
}
//=============================================================================
void CXMonoFontListCombo::CreateFontTypeImages()
//=============================================================================
{
ASSERT(m_FontType.GetSafeHandle() == 0);
// We load the font type images from resource 38 in COMDLG32.DLL.
// This bitmap is 100 x 24, and has 2 rows of 5 images
HMODULE hModule = ::LoadLibraryEx(_T("COMDLG32.DLL"), NULL,
DONT_RESOLVE_DLL_REFERENCES);
ASSERT(hModule);
if (!hModule)
return;
HBITMAP hBmp = (HBITMAP)::LoadImage(hModule, MAKEINTRESOURCE(38),
IMAGE_BITMAP, 100, 24, LR_DEFAULTCOLOR);
::FreeLibrary(hModule);
ASSERT(hBmp);
if (!hBmp)
return;
CClientDC dcClient(this);
// We create one image list for the selected and non-selected
// glyphs. The images are:
// 0 - TrueType non-selected
// 1 - OpenType non-selected
// 2 - TrueType selected
// 3 - OpenType selected
if (m_FontType.Create(GLYPH_SIZE, GLYPH_SIZE, ILC_COLOR32 | ILC_MASK, 4, 1))
{
CDC dcMem;
dcMem.CreateCompatibleDC(&dcClient);
CBitmap *pBmp = CBitmap::FromHandle(hBmp);
CBitmap *pOldBitmap = dcMem.SelectObject(pBmp);
// dcMem now contains the 100 x 24 bitmap (2 rows) from COMDLG32.DLL.
// The individual images are at 0, 20, 40, 60, and 80.
// We want the images at 0 and 40 in each row.
CDC dcBitmap1;
dcBitmap1.CreateCompatibleDC(&dcClient);
CBitmap bmp1;
bmp1.CreateCompatibleBitmap(&dcClient, 2*GLYPH_SIZE, GLYPH_SIZE);
// extract non-selected images from top row
CBitmap *pOldBitmap1 = dcBitmap1.SelectObject(&bmp1);
dcBitmap1.FillSolidRect(0, 0, 2*GLYPH_SIZE, GLYPH_SIZE, GetSysColor(COLOR_WINDOW));
// we want 1st (TrueType) and 3rd (OpenType) images
dcBitmap1.BitBlt(0, 0, GLYPH_SIZE, GLYPH_SIZE, &dcMem, 3, 0, SRCCOPY);
dcBitmap1.BitBlt(GLYPH_SIZE, 0, GLYPH_SIZE, GLYPH_SIZE, &dcMem, 43, 0, SRCCOPY);
dcBitmap1.SelectObject(pOldBitmap1);
m_FontType.Add(&bmp1, RGB(0,0,255)); // different mask color for each row
// extract selected images from 2nd row
dcBitmap1.SelectObject(&bmp1);
dcBitmap1.FillSolidRect(0, 0, 2*GLYPH_SIZE, GLYPH_SIZE, GetSysColor(COLOR_WINDOW));
// we want 1st (TrueType) and 3rd (OpenType) images
dcBitmap1.BitBlt(0, 0, GLYPH_SIZE, GLYPH_SIZE, &dcMem, 3, GLYPH_SIZE, SRCCOPY);
dcBitmap1.BitBlt(GLYPH_SIZE, 0, GLYPH_SIZE, GLYPH_SIZE, &dcMem, 43, GLYPH_SIZE, SRCCOPY);
dcBitmap1.SelectObject(pOldBitmap1);
m_FontType.Add(&bmp1, RGB(255,0,255)); // different mask color for each row
dcBitmap1.DeleteDC();
bmp1.DeleteObject();
dcMem.SelectObject(pOldBitmap);
dcMem.DeleteDC();
}
::DeleteObject(hBmp);
}
//=============================================================================
CXMonoFontListCombo& CXMonoFontListCombo::SetFont(LOGFONT& lf)
//=============================================================================
{
memcpy(&m_lfInitial, &lf, sizeof(LOGFONT));
memcpy(&m_lfCurrent, &lf, sizeof(LOGFONT));
return *this;
}
//=============================================================================
void CXMonoFontListCombo::DrawItem(LPDRAWITEMSTRUCT lpDIS)
//=============================================================================
{
if (lpDIS->itemID == -1)
return;
ASSERT(lpDIS->CtlType == ODT_COMBOBOX);
CRect rect = lpDIS->rcItem;
int nSavedDC = ::SaveDC(lpDIS->hDC);
CDC dc;
dc.Attach(lpDIS->hDC);
if (lpDIS->itemState & ODS_FOCUS)
dc.DrawFocusRect(&rect);
COLORREF crText = ::GetSysColor(COLOR_WINDOWTEXT);
COLORREF crBackground = ::GetSysColor(COLOR_WINDOW);
if (lpDIS->itemState & ODS_SELECTED)
{
crText = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
crBackground = ::GetSysColor(COLOR_HIGHLIGHT);
}
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(crText);
dc.FillSolidRect(&rect, crBackground);
CString strFontName = _T("");
GetLBText(lpDIS->itemID, strFontName);
// draw the font type glyph
DWORD dwData = GetItemData(lpDIS->itemID);
//TRACE(_T("dwData=0x%X for %s\n"), dwData, strFontName);
CPoint point(rect.left+3, rect.top);
int nImage = -1;
if (dwData & XFONT_TRUETYPE)
nImage = 0;
else if (dwData & XFONT_OPENTYPE)
nImage = 1;
if (nImage != -1)
{
if (lpDIS->itemState & ODS_SELECTED)
nImage += 2;
if (m_FontType.GetSafeHandle())
m_FontType.Draw(&dc, nImage, point, ILD_TRANSPARENT);
}
if ((dwData & XFONT_MONOSPACED) && m_bShowMonospacedAsBold)
{
if (m_BoldFont.GetSafeHandle())
dc.SelectObject(&m_BoldFont);
}
rect.left += GLYPH_SIZE + 8;
// draw the text
dc.TextOut(rect.left, rect.top, strFontName);
dc.Detach();
::RestoreDC(lpDIS->hDC, nSavedDC);
}
//=============================================================================
// This function is the enumeration callback for font names.
// Its purpose is to fill the font combo with non-duplicate names,
// and screen out unwanted fonts based on font filter.
int CALLBACK EnumFontFamExProc(const ENUMLOGFONTEX *lpelfe,
const NEWTEXTMETRICEX *lpntme,
DWORD FontType,
LPARAM lParam)
//=============================================================================
{
CXMonoFontListCombo *pCombo = (CXMonoFontListCombo *) lParam;
ASSERT(lpelfe);
ASSERT(lpntme);
ASSERT(pCombo);
if (!lpelfe || !lpntme || !pCombo)
return FALSE; // something seriously wrong
if (pCombo->FindStringExact(-1, lpelfe->elfLogFont.lfFaceName) != CB_ERR)
{
// already in combo
return TRUE; // continue enumeration
}
// save font attributes - this will be stored in combobox item data
DWORD dwData = 0;
UINT fonttype = lpntme->ntmTm.tmPitchAndFamily & 0x6;
if (fonttype == 0)
dwData |= XFONT_RASTER;
if (fonttype == 2)
dwData |= XFONT_VECTOR;
if (lpntme->ntmTm.tmCharSet == OEM_CHARSET)
dwData |= XFONT_OEM;
if (lpntme->ntmTm.tmCharSet == SYMBOL_CHARSET)
dwData |= XFONT_SYMBOL;
if (lpntme->ntmTm.tmWeight > 600)
dwData |= XFONT_BOLD;
if (lpntme->ntmTm.tmItalic)
dwData |= XFONT_ITALIC;
DWORD weight = lpntme->ntmTm.tmWeight;
weight = weight << 16;
dwData |= weight;
UINT family = lpntme->ntmTm.tmPitchAndFamily & 0xF0;
dwData |= family;
// check if monospaced
if (pCombo->m_pDC)
{
BOOL bMonoSpaced = FALSE;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
_tcsncpy(lf.lfFaceName, lpelfe->elfLogFont.lfFaceName,
sizeof(lf.lfFaceName)/sizeof(TCHAR)-1);
lf.lfFaceName[sizeof(lf.lfFaceName)/sizeof(TCHAR)-1] = 0;
lf.lfWeight = FW_NORMAL;
lf.lfCharSet = DEFAULT_CHARSET;
HFONT hFont = ::CreateFontIndirect(&lf);
ASSERT(hFont);
if (hFont)
{
// font is monospaced if
// (1) width of W == width of !
// (2) it is not a symbol font
HFONT hFontOld = (HFONT)::SelectObject(pCombo->m_pDC->m_hDC, hFont);
TEXTMETRIC tm;
::GetTextMetrics(pCombo->m_pDC->m_hDC, &tm);
SIZE sizeChar1;
::GetTextExtentPoint32(pCombo->m_pDC->m_hDC, _T("W"), 1, &sizeChar1);
SIZE sizeChar2;
::GetTextExtentPoint32(pCombo->m_pDC->m_hDC, _T("!"), 1, &sizeChar2);
bMonoSpaced = sizeChar1.cx == sizeChar2.cx;
if (tm.tmCharSet == SYMBOL_CHARSET)
bMonoSpaced = FALSE;
if (hFontOld)
::SelectObject(pCombo->m_pDC->m_hDC, hFontOld);
::DeleteObject(hFont);
}
if (bMonoSpaced)
dwData |= XFONT_MONOSPACED;
}
BOOL bOkToAdd = TRUE;
TRACE(_T("m_dwFontFilter=%X\n"), pCombo->m_dwFontFilter);
if (bOkToAdd && ((pCombo->m_dwFontFilter & XFONT_SHOW_SYMBOL) == 0))
{
// don't show symbol fonts
if (dwData & XFONT_SYMBOL)
bOkToAdd = FALSE;
}
if (bOkToAdd && ((pCombo->m_dwFontFilter & XFONT_SHOW_ITALIC) == 0))
{
// don't show italic fonts
if (dwData & XFONT_ITALIC)
bOkToAdd = FALSE;
}
if (bOkToAdd && ((pCombo->m_dwFontFilter & XFONT_SHOW_BOLD) == 0))
{
// don't show bold fonts
if (dwData & XFONT_BOLD)
bOkToAdd = FALSE;
}
if (bOkToAdd && ((pCombo->m_dwFontFilter & XFONT_SHOW_MONOSPACED) == 0))
{
// don't show monospaced fonts
if (dwData & XFONT_MONOSPACED)
bOkToAdd = FALSE;
}
DWORD dwSpecial = XFONT_BOLD|XFONT_ITALIC|XFONT_SYMBOL|XFONT_MONOSPACED;
if (bOkToAdd && ((pCombo->m_dwFontFilter & XFONT_SHOW_NORMAL) == 0))
{
// don't show normal fonts
if ((dwData & dwSpecial) == 0)
bOkToAdd = FALSE;
}
if (bOkToAdd)
{
// According to docs, "The function uses the NEWTEXTMETRICEX structure
// for TrueType fonts; and the TEXTMETRIC structure for other fonts."
// In practice, it seems that a NEWTEXTMETRICEX struct is always returned,
// but just to be safe we prepare for an exception.
__try
{
if ((lpntme->ntmTm.ntmFlags & NTM_TT_OPENTYPE) ||
(lpntme->ntmTm.ntmFlags & NTM_PS_OPENTYPE))
{
dwData |= XFONT_OPENTYPE;
}
else if (FontType & TRUETYPE_FONTTYPE)
{
dwData |= XFONT_TRUETYPE;
}
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
TRACE(_T("ERROR: exception in EnumFontFamExProc()\n"));
}
int index = pCombo->AddString(lpelfe->elfLogFont.lfFaceName);
ASSERT(index >= 0);
if (index >= 0)
{
VERIFY(pCombo->SetItemData(index, dwData) != CB_ERR);
}
TRACE(_T("_____ added %s [%s] FontType=0x%X ntmFlags=0x%X tmCharSet=%d tmPitchAndFamily=0x%X dwData=0x%X \n"),
lpelfe->elfLogFont.lfFaceName,
lpelfe->elfFullName,
FontType,
lpntme->ntmTm.ntmFlags,
lpntme->ntmTm.tmCharSet,
lpntme->ntmTm.tmPitchAndFamily,
dwData);
}
return TRUE;
}
//=============================================================================
void CXMonoFontListCombo::OnTimer(UINT nIDEvent)
//=============================================================================
{
KillTimer(nIDEvent);
if (nIDEvent == TIMER_INIT)
{
// send initial selection message
GetParent()->SendMessage(WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(), CBN_SELCHANGE),
(LPARAM)m_hWnd);
if (m_CurIndex >= 0)
{
DWORD dwData = GetItemData(m_CurIndex);
// set bold typeface in edit box
SetBold(m_bShowMonospacedAsBold && (dwData & XFONT_MONOSPACED));
}
}
CComboBox::OnTimer(nIDEvent);
}
//=============================================================================
HBRUSH CXMonoFontListCombo::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
//=============================================================================
{
if (nCtlColor == CTLCOLOR_EDIT)
{
if (m_edit.GetSafeHwnd() == NULL)
{
// subclass edit box
m_edit.SubclassWindow(pWnd->GetSafeHwnd());
m_edit.SetReadOnly(TRUE);
}
}
return CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);
}
//=============================================================================
LRESULT CXMonoFontListCombo::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
//=============================================================================
{
if (message == WM_CHAR)
{
// try to match first character of font name
TCHAR s[2] = { 0 };
s[0] = (TCHAR) wParam;
int index = FindString(-1, s);
if (index >= 0)
{
SetCurSel(index);
// tell parent that selection has changed
GetParent()->SendMessage(WM_COMMAND,
MAKEWPARAM(GetDlgCtrlID(), CBN_SELCHANGE), (LPARAM)m_hWnd);
}
return TRUE;
}
return CComboBox::WindowProc(message, wParam, lParam);
}

View File

@@ -0,0 +1,90 @@
// XMonoFontListCombo.h
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XMONOFONTLISTCOMBO_H
#define XMONOFONTLISTCOMBO_H
#include "XMonoFontListComboEdit.h"
//=============================================================================
class CXMonoFontListCombo : public CComboBox
//=============================================================================
{
// Construction
public:
CXMonoFontListCombo();
virtual ~CXMonoFontListCombo();
// Attributes
public:
CDC * m_pDC;
DWORD m_dwFontFilter;
CXMonoFontListComboEdit m_edit;
CXMonoFontListCombo& SetBold(BOOL bBold)
{
if (IsWindow(m_edit.m_hWnd))
{
m_edit.SetBold(bBold);
m_edit.RedrawWindow();
}
return *this;
}
CXMonoFontListCombo& SetFont(LOGFONT& lf);
CXMonoFontListCombo& SetFontFilter(DWORD dwFontFilter)
{ m_dwFontFilter = dwFontFilter; return *this; }
CXMonoFontListCombo& ShowMonospacedAsBold(BOOL bShow)
{ m_bShowMonospacedAsBold = bShow; return *this; }
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontListCombo)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
CImageList m_FontType;
CFont m_BoldFont;
BOOL m_bShowMonospacedAsBold;
LOGFONT m_lfInitial;
LOGFONT m_lfCurrent;
int m_CurIndex;
void CreateFontTypeImages();
// Generated message map functions
protected:
//{{AFX_MSG(CXMonoFontListCombo)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTLISTCOMBO_H

View File

@@ -0,0 +1,233 @@
// XMonoFontListComboEdit.cpp
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// Description:
// XMonoFontListComboEdit.cpp implements CXMonoFontListComboEdit, a class
// used by CXMonoFontListCombo.
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "XMonoFontListComboEdit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifndef __noop
#if _MSC_VER < 1300
#define __noop ((void)0)
#endif
#endif
#undef TRACE
#define TRACE __noop
//=============================================================================
// if you want to see the TRACE output, uncomment this line:
//#include "XTrace.h"
//=============================================================================
//=============================================================================
BEGIN_MESSAGE_MAP(CXMonoFontListComboEdit, CEdit)
//=============================================================================
//{{AFX_MSG_MAP(CXMonoFontListComboEdit)
ON_CONTROL_REFLECT(EN_SETFOCUS, OnSetfocus)
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
ON_WM_PAINT()
END_MESSAGE_MAP()
//=============================================================================
CXMonoFontListComboEdit::CXMonoFontListComboEdit()
//=============================================================================
{
m_bBold = FALSE;
m_strText = _T("");
}
//=============================================================================
CXMonoFontListComboEdit::~CXMonoFontListComboEdit()
//=============================================================================
{
if (m_Font.GetSafeHandle())
m_Font.DeleteObject();
if (m_BoldFont.GetSafeHandle())
m_BoldFont.DeleteObject();
if (m_brush.GetSafeHandle())
m_brush.DeleteObject();
}
//=============================================================================
void CXMonoFontListComboEdit::PreSubclassWindow()
//=============================================================================
{
TRACE(_T("in CXMonoFontListComboEdit::PreSubclassWindow ================\n"));
// get current font
CFont* pFont = GetSafeFont();
// create the font for this control
LOGFONT lf;
pFont->GetLogFont(&lf);
m_Font.CreateFontIndirect(&lf);
lf.lfWeight = FW_BOLD;
m_BoldFont.CreateFontIndirect(&lf);
m_brush.CreateSolidBrush(GetSysColor(COLOR_WINDOW));
CEdit::PreSubclassWindow();
}
//=============================================================================
void CXMonoFontListComboEdit::OnPaint()
//=============================================================================
{
CPaintDC dc(this); // device context for painting
BOOL bFocus = FALSE;
CWnd *pWndFocus = GetFocus();
if (pWndFocus && IsWindow(pWndFocus->m_hWnd))
{
if (pWndFocus->m_hWnd == m_hWnd)
bFocus = TRUE;
}
CString strText = m_strText;
if (strText.IsEmpty())
GetWindowText(strText);
TRACE(_T("strText=%s\n"), strText);
CRect rc;
GetClientRect(&rc);
dc.FillSolidRect(&rc, GetSysColor(COLOR_WINDOW));
CEdit::SetSel(0, 0);
CFont *pOldFont = 0;
if (m_bBold)
pOldFont = dc.SelectObject(&m_BoldFont);
else
pOldFont = dc.SelectObject(&m_Font);
dc.SetBkMode(OPAQUE);
if (bFocus)
{
dc.SetTextColor(GetSysColor(COLOR_WINDOW));
dc.SetBkColor(GetSysColor(COLOR_HIGHLIGHT));
}
else
{
dc.SetTextColor(GetSysColor(COLOR_WINDOWTEXT));
dc.SetBkColor(GetSysColor(COLOR_WINDOW));
}
dc.TextOut(rc.left, rc.top, strText);
dc.SelectObject(pOldFont);
}
//=============================================================================
CFont * CXMonoFontListComboEdit::GetSafeFont()
//=============================================================================
{
// get current font
CFont *pFont = CWnd::GetFont();
if (pFont == 0)
{
// try to get parent font
CWnd *pParent = GetParent();
if (pParent && IsWindow(pParent->m_hWnd))
pFont = pParent->GetFont();
if (pFont == 0)
{
// no font, so get a system font
HFONT hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
if (hFont == 0)
hFont = (HFONT)::GetStockObject(SYSTEM_FONT);
if (hFont == 0)
hFont = (HFONT)::GetStockObject(ANSI_VAR_FONT);
if (hFont)
pFont = CFont::FromHandle(hFont);
}
}
return pFont;
}
//=============================================================================
void CXMonoFontListComboEdit::SetWindowText(LPCTSTR lpszString)
//=============================================================================
{
m_strText = lpszString;
RedrawWindow();
}
//=============================================================================
LRESULT CXMonoFontListComboEdit::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
//=============================================================================
{
if (message == WM_SETTEXT)
{
// don't allow CEdit to paint text
m_strText = (LPCTSTR) lParam;
lParam = (LPARAM)_T("");
RedrawWindow();
}
else if ((message == WM_LBUTTONDOWN) ||
(message == WM_LBUTTONDBLCLK))
{
GetParent()->SendMessage(message, wParam, lParam);
return TRUE;
}
else if (message == WM_CHAR)
{
// let combobox handle it
GetParent()->SendMessage(message, wParam, lParam);
return TRUE;
}
else if (message == WM_CONTEXTMENU)
{
// suppress context menu
return TRUE;
}
else if (message == WM_ERASEBKGND)
{
// entire control is painted in OnPaint
return TRUE;
}
return CEdit::WindowProc(message, wParam, lParam);
}
//=============================================================================
void CXMonoFontListComboEdit::OnSetfocus()
//=============================================================================
{
RedrawWindow();
}
//=============================================================================
HBRUSH CXMonoFontListComboEdit::CtlColor(CDC* /*pDC*/, UINT /*nCtlColor*/)
//=============================================================================
{
// this is necessary on Vista
return m_brush;
}

View File

@@ -0,0 +1,70 @@
// XMonoFontListComboEdit.h
//
// Author: Hans Dietrich
// hdietrich@gmail.com
//
// License:
// This software is released into the public domain. You are free to use
// it in any way you like, except that you may not sell this source code.
//
// This software is provided "as is" with no expressed or implied warranty.
// I accept no liability for any damage or loss of business that this
// software may cause.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XMONOFONTLISTCOMBOEDIT_H
#define XMONOFONTLISTCOMBOEDIT_H
//=============================================================================
class CXMonoFontListComboEdit : public CEdit
//=============================================================================
{
// Construction
public:
CXMonoFontListComboEdit();
virtual ~CXMonoFontListComboEdit();
// Attributes
public:
void SetBold(BOOL bBold) { m_bBold = bBold; }
void SetWindowText(LPCTSTR lpszString);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXMonoFontListComboEdit)
protected:
virtual void PreSubclassWindow();
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
public:
CFont m_Font;
CFont m_BoldFont;
BOOL m_bBold;
CString m_strText;
CBrush m_brush;
CFont * GetSafeFont();
// Generated message map functions
protected:
//{{AFX_MSG(CXMonoFontListComboEdit)
afx_msg void OnSetfocus();
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
//}}AFX_MSG
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif //XMONOFONTLISTCOMBOEDIT_H

View File

@@ -0,0 +1,299 @@
// XTrace.h Version 1.2
//
// Author: Paul Mclachlan
//
// Modified by: Hans Dietrich
// hdietrich@gmail.com
//
// Version 1.2 fixed macro redefinition warnings
//
// Version 1.1: added Unicode support
// added optional thread id to output string
// added option to enable/disable full path
// added TRACERECT macro
// changed name to avoid conflicts with Paul's class.
//
// This code was taken from article by Paul Mclachlan, "Getting around
// the need for a vararg #define just to automatically use __FILE__ and
// __LINE__ in a TRACE macro". For original article, see
// http://www.codeproject.com/useritems/location_trace.asp
//
// XTrace.h is a drop-in replacement for MFC's TRACE facility. It has no
// dependency on MFC. It is thread-safe and uses no globals or statics.
//
// It optionally adds source module/line number and thread id to each line
// of TRACE output. To control these features, use the following defines:
//
// XTRACE_SHOW_FULLPATH
// XTRACE_SHOW_THREAD_ID
//
// XTrace.h also provides the TRACERECT macro, which outputs the contents
// of a RECT struct. In Release builds, no output will be produced.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef XTRACE_H
#define XTRACE_H
#include <stdarg.h>
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
#pragma warning(push)
#pragma warning(disable : 4127) // conditional expression is constant
#pragma warning(disable : 4996) // disable bogus deprecation warning
#ifndef INVALID_SET_FILE_POINTER
#define INVALID_SET_FILE_POINTER ((DWORD)-1)
#endif
#define XTRACE_SHOW_FULLPATH FALSE // FALSE = only show base name of file
#define XTRACE_SHOW_THREAD_ID TRUE // TRUE = include thread id in output
#define XTRACE_FILE FALSE // TRUE = output to file
class xtracing_output_debug_string
{
public:
xtracing_output_debug_string(LPCTSTR lpszFile, int line) :
m_file(lpszFile),
m_line(line)
{
}
void operator() (LPCTSTR lpszFormat, ...)
{
va_list va;
va_start(va, lpszFormat);
TCHAR buf1[BUFFER_SIZE];
TCHAR buf2[BUFFER_SIZE];
// add the __FILE__ and __LINE__ to the front
TCHAR *cp = (LPTSTR) m_file;
if (!XTRACE_SHOW_FULLPATH)
{
cp = (TCHAR *)_tcsrchr(m_file, _T('\\'));
if (cp)
cp++;
}
if (XTRACE_SHOW_THREAD_ID)
{
if (_sntprintf(buf1, BUFFER_SIZE-1, _T("%s(%d) : [%X] %s"),
cp, m_line, GetCurrentThreadId(), lpszFormat) < 0)
buf1[BUFFER_SIZE-1] = _T('\0');
}
else
{
if (_sntprintf(buf1, BUFFER_SIZE-1, _T("%s(%d) : %s"),
cp, m_line, lpszFormat) < 0)
buf1[BUFFER_SIZE-1] = _T('\0');
}
// format the message as requested
if (_vsntprintf(buf2, BUFFER_SIZE-1, buf1, va) < 0)
buf2[BUFFER_SIZE-1] = _T('\0');
va_end(va);
if (XTRACE_FILE)
{
TCHAR szPathName[MAX_PATH*2] = { 0 };
::GetModuleFileName(NULL, szPathName, sizeof(szPathName)/sizeof(TCHAR)-2);
TCHAR *cp = _tcsrchr(szPathName, _T('\\'));
if (cp != NULL)
*(cp+1) = _T('\0');
_tcscat(szPathName, _T("\\_trace.log"));
HANDLE hFile = ::CreateFile(szPathName, GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
DWORD dwRC = ::SetFilePointer(hFile, // handle to file
0, // bytes to move pointer
NULL, // bytes to move pointer
FILE_END); // starting point
if (dwRC != INVALID_SET_FILE_POINTER)
{
DWORD dwWritten = 0;
::WriteFile(hFile, // handle to file
buf2, // data buffer
(DWORD)_tcslen(buf2)*sizeof(TCHAR), // number of bytes to write
&dwWritten, // number of bytes written
NULL); // overlapped buffer
}
::CloseHandle(hFile);
}
}
else
{
// write it out
OutputDebugString(buf2);
}
}
private:
LPCTSTR m_file;
int m_line;
enum { BUFFER_SIZE = 4096 };
};
class xtracing_entry_output_debug_string
{
public:
xtracing_entry_output_debug_string(LPCTSTR lpszFile, int line) :
m_file(lpszFile),
m_line(line)
{
}
~xtracing_entry_output_debug_string()
{
TCHAR buf3[BUFFER_SIZE*3];
_stprintf(buf3, _T("====== exiting scope: %s"), buf2);
OutputDebugString(buf3);
}
void operator() (LPCTSTR lpszFormat, ...)
{
va_list va;
va_start(va, lpszFormat);
TCHAR buf1[BUFFER_SIZE];
// add the __FILE__ and __LINE__ to the front
TCHAR *cp = (LPTSTR) m_file;
if (!XTRACE_SHOW_FULLPATH)
{
cp = (TCHAR *)_tcsrchr(m_file, _T('\\'));
if (cp)
cp++;
}
if (XTRACE_SHOW_THREAD_ID)
{
if (_sntprintf(buf1, BUFFER_SIZE-1, _T("%s(%d) : [%X] ====== %s"),
cp, m_line, GetCurrentThreadId(), lpszFormat) < 0)
buf1[BUFFER_SIZE-1] = _T('\0');
}
else
{
if (_sntprintf(buf1, BUFFER_SIZE-1, _T("%s(%d) : ====== %s"),
cp, m_line, lpszFormat) < 0)
buf1[BUFFER_SIZE-1] = _T('\0');
}
// format the message as requested
if (_vsntprintf(buf2, BUFFER_SIZE-1, buf1, va) < 0)
buf2[BUFFER_SIZE-1] = _T('\0');
va_end(va);
if (XTRACE_FILE)
{
TCHAR szPathName[MAX_PATH*2] = { 0 };
::GetModuleFileName(NULL, szPathName, sizeof(szPathName)/sizeof(TCHAR)-2);
TCHAR *cp = _tcsrchr(szPathName, _T('\\'));
if (cp != NULL)
*(cp+1) = _T('\0');
_tcscat(szPathName, _T("\\_trace.log"));
HANDLE hFile = ::CreateFile(szPathName, GENERIC_WRITE, FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
DWORD dwRC = ::SetFilePointer(hFile, // handle to file
0, // bytes to move pointer
NULL, // bytes to move pointer
FILE_END); // starting point
if (dwRC != INVALID_SET_FILE_POINTER)
{
DWORD dwWritten = 0;
::WriteFile(hFile, // handle to file
buf2, // data buffer
(DWORD)_tcslen(buf2)*sizeof(TCHAR), // number of bytes to write
&dwWritten, // number of bytes written
NULL); // overlapped buffer
}
::CloseHandle(hFile);
}
}
else
{
// write it out
OutputDebugString(buf2);
}
}
private:
LPCTSTR m_file;
int m_line;
enum { BUFFER_SIZE = 4096 };
TCHAR buf2[BUFFER_SIZE*2];
};
#undef TRACE
#undef TRACE0
#undef TRACE1
#undef TRACE2
#undef TRACERECT
#undef TRACEPOINT
#undef TRACESIZE
#undef TRACEHILO
#define _DEBUGnow
#ifdef _DEBUG
#define TRACE (xtracing_output_debug_string(_T(__FILE__), __LINE__ ))
#define TRACEENTRY (xtracing_output_debug_string(_T(__FILE__), __LINE__ ))
#define TRACEERROR (xtracing_output_debug_string(_T(__FILE__), __LINE__ ))
#define TRACE0 TRACE
#define TRACE1 TRACE
#define TRACE2 TRACE
#define TRACEHILO(d) \
WORD ___hi = HIWORD(d); WORD ___lo = LOWORD(d); \
TRACE(_T(#d) _T(": HIWORD = %u LOWORD = %u\n"), ___hi, ___lo)
#define TRACESIZE(s) TRACE(_T(#s) _T(": cx = %d cy = %d\n"), \
(s).cx, (s).cy)
#define TRACEPOINT(p) TRACE(_T(#p) _T(": x = %d y = %d\n"), \
(p).x, (p).y)
#define TRACERECT(r) TRACE(_T(#r) _T(": left = %d top = %d right = %d bottom = %d\n"), \
(r).left, (r).top, (r).right, (r).bottom)
#else
#ifndef __noop
#if _MSC_VER < 1300
#define __noop ((void)0)
#endif
#endif
#define TRACE __noop
#define TRACEERROR __noop
#define TRACE0 __noop
#define TRACE1 __noop
#define TRACE2 __noop
#define TRACERECT __noop
#define TRACEPOINT __noop
#define TRACESIZE __noop
#define TRACEHILO __noop
#endif //_DEBUG
#pragma warning(pop)
#endif //XTRACE_H

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.atest"
type="win32"
/>
<description>description</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,41 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by XMonoFontDialogTest.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_XMONOFONTDIALOGTEST_DIALOG 102
#define IDS_MAILTO 103
#define IDS_ONLINE_HELP 104
#define IDR_MAINFRAME 128
#define IDC_ABOUT_EMAIL 1001
#define IDC_ABOUT_HYPERLINK 1002
#define IDC_GROUPBOX 1003
#define IDC_SAMPLE 1004
#define IDC_ALL_FONTS 1005
#define IDC_SYMBOL 1006
#define IDC_EXCEPT_SYMBOL 1007
#define IDC_MONOSPACED 1008
#define IDC_EXCEPT_MONOSPACED 1009
#define IDC_EXCEPT_MONOSPACED_AND_SYMBOL 1010
#define IDC_PROPERTIES 1011
#define IDC_NOTE 1012
#define IDC_TEST 1013
#define IDC_TEST2 1014
#define IDC_SAMPLE_TEXT 1015
#define IDC_SCRIPT 1016
#define IDC_ONLINE_HELP 1017
#define IDC_SHOW_MONOSPACED_LABEL 1018
#define IDC_SHOW_MONOSPACED_AS_BOLD 1019
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1020
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif

View File

@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XMonoFontDialogTest", "XMonoFontDialogTest.vcproj", "{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}.Debug|Win32.ActiveCfg = Debug|Win32
{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}.Debug|Win32.Build.0 = Debug|Win32
{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}.Release|Win32.ActiveCfg = Release|Win32
{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,308 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="XMonoFontDialogTest"
ProjectGUID="{77B69CB3-4461-4711-9FD8-A5DC6846AEDC}"
RootNamespace="XMonoFontDialogTest"
Keyword="MFCProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
ValidateParameters="false"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"
MinimalRebuild="false"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="4"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\src\About.cpp"
>
</File>
<File
RelativePath="..\src\StdAfx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\XFontSize.cpp"
>
</File>
<File
RelativePath="..\src\XHyperLink.cpp"
>
</File>
<File
RelativePath="..\src\XMonoFontDialog.cpp"
>
</File>
<File
RelativePath="..\src\XMonoFontDialogTest.cpp"
>
</File>
<File
RelativePath="..\src\XMonoFontDialogTestDlg.cpp"
>
</File>
<File
RelativePath="..\src\XMonoFontListCombo.cpp"
>
</File>
<File
RelativePath="..\src\XMonoFontListComboEdit.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath="..\src\About.h"
>
</File>
<File
RelativePath="..\src\resource.h"
>
</File>
<File
RelativePath="..\src\StdAfx.h"
>
</File>
<File
RelativePath="..\src\XFontSize.h"
>
</File>
<File
RelativePath="..\src\XHyperLink.h"
>
</File>
<File
RelativePath="..\src\XMonoFontDialog.h"
>
</File>
<File
RelativePath="..\src\XMonoFontDialogRes.h"
>
</File>
<File
RelativePath="..\src\XMonoFontDialogTest.h"
>
</File>
<File
RelativePath="..\src\XMonoFontDialogTestDlg.h"
>
</File>
<File
RelativePath="..\src\XMonoFontListCombo.h"
>
</File>
<File
RelativePath="..\src\XMonoFontListComboEdit.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath="..\src\XMonoFontDialogTest.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,242 @@
-*- mode:text; coding:utf-8; -*-
GNU FreeFont Authors
====================
The FreeFont collection is being maintained by
Steve White <stevan.white AT googlemail.com>
The folowing list cites the other contributors that contributed to
particular ISO 10646 blocks.
* URW++ Design & Development GmbH <http://www.urwpp.de/>
Basic Latin (U+0041-U+007A)
Latin-1 Supplement (U+00C0-U+00FF) (most)
Latin Extended-A (U+0100-U+017F)
Spacing Modifier Letters (U+02B0-U+02FF)
Mathematical Operators (U+2200-U+22FF) (parts)
Block Elements (U+2580-U+259F)
Dingbats (U+2700-U+27BF)
* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John
Plaice <plaice AT omega.cse.unsw.edu.au>
Latin Extended-B (U+0180-U+024F)
IPA Extensions (U+0250-U+02AF)
Greek (U+0370-U+03FF)
Armenian (U+0530-U+058F)
Hebrew (U+0590-U+05FF)
Arabic (U+0600-U+06FF)
Currency Symbols (U+20A0-U+20CF)
Arabic Presentation Forms-A (U+FB50-U+FDFF)
Arabic Presentation Forms-B (U+FE70-U+FEFF)
* Yannis Haralambous and Wellcome Institute
Sinhala (U+0D80-U+0DFF)
* Young U. Ryu <ryoung AT utdallas.edu>
Arrows (U+2190-U+21FF)
Mathematical Symbols (U+2200-U+22FF)
Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
* Valek Filippov <frob AT df.ru>
Cyrillic (U+0400-U+04FF)
* Wadalab Kanji Comittee
Hiragana (U+3040-U+309F)
Katakana (U+30A0-U+30FF)
* Angelo Haritsis <ah AT computer.org>
Greek (U+0370-U+03FF)
* Yannis Haralambous and Virach Sornlertlamvanich
Thai (U+0E00-U+0E7F)
* Shaheed R. Haque <srhaque AT iee.org>
Bengali (U+0980-U+09FF)
* Sam Stepanyan <sam AT arminco.com>
Armenian (U+0530-U+058F)
* Mohamed Ishan <ishan AT mitf.f2s.com>
Thaana (U+0780-U+07BF)
* Sushant Kumar Dash <sushant AT writeme.com>
Oriya (U+0B00-U+0B7F)
* Harsh Kumar <harshkumar AT vsnl.com>
Devanagari (U+0900-U+097F)
Bengali (U+0980-U+09FF)
Gurmukhi (U+0A00-U+0A7F)
Gujarati (U+0A80-U+0AFF)
* Prasad A. Chodavarapu <chprasad AT hotmail.com>
Telugu (U+0C00-U+0C7F)
* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey
<apandey AT u.washington.edu>
Devanagari (U+0900-U+097F)
* Hardip Singh Pannu <HSPannu AT aol.com>
Gurmukhi (U+0A00-U+0A7F)
* Jeroen Hellingman <jehe AT kabelfoon.nl>
Oriya (U+0B00-U+0B7F)
Malayalam (U+0D00-U+0D7F)
* Thomas Ridgeway <email needed>
Tamil (U+0B80-U+0BFF)
* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>,
Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf
Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?>
Ethiopic (U+1200-U+137F)
* Maxim Iorsh <iorsh AT users.sourceforge.net>
Hebrew (U+0590-U+05FF)
* Vyacheslav Dikonov <sdiconov AT mail.ru>
Syriac (U+0700-U+074A)
Braille (U+2800-U+28FF)
* Panayotis Katsaloulis <panayotis AT panayotis.com>
Greek Extended (U+1F00-U+1FFF)
* M.S. Sridhar <mssridhar AT vsnl.com>
Devanagari (U+0900-U+097F)
Bengali (U+0980-U+09FF)
Gurmukhi (U+0A00-U+0A7F)
Gujarati (U+0A80-U+0AFF)
Oriya (U+0B00-U+0B7F)
Tamil (U+0B80-U+0BFF)
Telugu (U+0C00-U+0C7F)
Kannada (U+0C80-U+0CFF)
Malayalam (U+0D00-U+0D7F)
* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt
<nlevitt AT columbia.edu>
Sinhala (U+0D80-U+0DFF)
* Dan Shurovich Chirkov <dansh AT chirkov.com>
Cyrillic (U+0400-U+04FF)
* Abbas Izad <abbasizad AT hotmail.com>
Arabic (U+0600-U+06FF)
Arabic Presentation Forms-A (U+FB50-U+FDFF)
Arabic Presentation Forms-B (U+FE70-U+FEFF)
* Denis Jacquerye <moyogo AT gmail.com>
Latin Extended-B (U+0180-U+024F)
IPA Extensions (U+0250-U+02AF)
* K.H. Hussain <hussain AT kfri.org> and R. Chitrajan
Malayalam (U+0D00-U+0D7F)
* Solaiman Karim <solaiman AT ekushey.org> and Omi Azad <omi AT ekushey.org>
Bengali (U+0980-U+09FF)
* Sonali Sonania <sonalisonania AT gmail.com> and Monika Shah
<monikapatira AT gmail.com>
Devanagari (U+0900-U+097F)
Gujarati (U+0A80-U+0AFF)
* Pravin Satpute <pravin.d.s AT gmail.com>, Bageshri Salvi
<sbagrshri AT yahoo.co.in>, Rahul Bhalerao <b.rahul.pm AT gmail.com> and
Sandeep Shedmake <sandeep.shedmake AT gmail.com>
Devanagari (U+0900-U+097F)
Gujarati (U+0A80-U+0AFF)
Oriya (U+0B00-U+0B7F)
Malayalam (U+0D00-U+0D7F)
Tamil (U+0B80-U+0BFF)
* Kulbir Singh Thind
Gurmukhi (U+0A00-U+0A7F)
* Gia Shervashidze <giasher AT telenet.ge>
Georgian (U+10A0-U+10FF)
* Daniel Johnson
Armenian (serif) (U+0530-U+058F)
Cherokee (U+13A0-U+13FF)
Unified Canadian Aboriginal Syllabics (U+1400-U+167F)
UCAS Extended (U+18B0-U+18F5)
Tifinagh (U+2D30-U+2D7F)
Vai (U+A500-U+A62B)
Latin Extended-D (Mayanist letters) (U+A720-U+A7FF)
Kayah Li (U+A900-U+A92F)
Osmanya (U+10480-U+104a7)
* George Douros
Gothic (U+10330-U+1034F)
Phoenecian (U+10900-U+1091F)
Byzantine Musical Symbols (U+1D000-U+1D0FF)
Western Musical Symbols (U+1D100-U+1D1DF)
Mathematical Alphanumeric Symbols (U+1D400-U+1D7FF)
Mah Jong Tiles (U+1F000-U+1F02B)
Dominoes (U+1F030-U+1F093)
* Steve White <stevan_white AT gmail.com>
Glagolitic (U+2C00-U+2C5F)
Coptic (U+2C80-U+2CFF)
Arabic (U+0600-U+06FF) (Mono)
Old Italic (U+10300-U+1032F)
* Pavel Skrylev is responsible for
Cyrillic Extended-A (U+2DEO-U+2DFF)
as well as many of the additions to
Cyrillic Extended-B (U+A640-U+A65F)
* Mark Williamson
Made the MPH 2 Damase font, from which
Hanunóo (U+1720-U+173F)
Buginese (U+1A00-U+1A1F)
Tai Le (U+1950-U+197F)
Ugaritic (U+10380-U+1039F)
Old Persian (U+103A0-U+103DF)
* Masoud Pourmoosa
Arabic (U+0600-U+06FF)
* Emmanuel Vallois
Python scripts, support
* Primož Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si>
maintained FreeFont for several years, and is thanked for all his work.
Please see the CREDITS file for details on who contributed particular
subsets of the glyphs in font files.
--------------------------------------------------------------------------
$Id: AUTHORS,v 1.23 2010-09-11 13:24:11 Stevan_White Exp $

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,597 @@
-*- mode:text; coding:utf-8; -*-
GNU FreeFont Credits
====================
This file lists contributors and contributions to the GNU FreeFont project.
* URW++ Design & Development GmbH <http://www.urwpp.de/>
URW++ donated a set of 35 core PostScript Type 1 fonts to the
Ghostscript project <http://www.ghostscript.com/>, to be available
under the terms of GNU General Public License (GPL).
Basic Latin (U+0041-U+007A)
Latin-1 Supplement (U+00C0-U+00FF)
Latin Extended-A (U+0100-U+017F)
Spacing Modifier Letters (U+02B0-U+02FF)
Mathematical Operators (U+2200-U+22FF)
Block Elements (U+2580-U+259F)
Dingbats (U+2700-U+27BF)
* Yannis Haralambous <yannis.haralambous AT enst-bretagne.fr> and John
Plaice <plaice AT omega.cse.unsw.edu.au>
Yannis Haralambous and John Plaice are the authors of Omega typesetting
system, <http://omega.enstb.org/>. Omega is an extension of TeX.
Its first release, aims primarily at improving TeX's multilingual abilities.
In Omega all characters and pointers into data-structures are 16-bit wide,
instead of 8-bit, thereby eliminating many of the trivial limitations of TeX.
Omega also allows multiple input and output character sets, and uses
programmable filters to translate from one encoding to another, to perform
contextual analysis, etc. Internally, Omega uses the universal 16-bit Unicode
standard character set, based on ISO-10646. These improvements not only make
it a lot easier for TeX users to cope with multiple or complex languages,
like Arabic, Indic, Khmer, Chinese, Japanese or Korean, in one document, but
will also form the basis for future developments in other areas, such as
native color support and hypertext features. ... Fonts for UT1 (omlgc family)
and UT2 (omah family) are under development: these fonts are in PostScript
format and visually close to Times and Helvetica font families.
Omega fonts are available subject to GPL
Latin Extended-B (U+0180-U+024F)
IPA Extensions (U+0250-U+02AF)
Greek (U+0370-U+03FF)
Armenian (U+0530-U+058F)
Hebrew (U+0590-U+05FF)
Arabic (U+0600-U+06FF)
Currency Symbols (U+20A0-U+20CF)
Arabic Presentation Forms-A (U+FB50-U+FDFF)
Arabic Presentation Forms-B (U+FE70-U+FEFF)
Current info: <http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=omega>
* Valek Filippov <frob AT df.ru>
Valek Filippov added Cyrillic glyphs and composite Latin Extended A to
the whole set of the abovementioned URW set of 35 PostScript core fonts,
<ftp://ftp.gnome.ru/fonts/>. The fonts are available under GPL.
(The Cyrillic range was since replaced by another font.)
Latin Extended-A (U+0100-U+017F)
* Wadalab Kanji Comittee
Between April 1990 and March 1992, Wadalab Kanji Comittee put together a
series of scalable font files with Japanese scripts, in four forms:
Sai Micho, Chu Mincho, Cho Kaku and Saimaru.
The font files are written in custom file format, while tools for conversion
into Metafont and PostScript Type 1 are also supplied. The Wadalab Kanji
Comittee was later dismissed. The resulting files were once found on the FTP
server of the Department of Mathematical Engineering and Information Physics,
Faculty of Engineering, University of Tokyo. Some of these are available at
<http://www.ctan.org/tex-archive/fonts/wadalab>
Hiragana (U+3040-U+309F)
Katakana (U+30A0-U+30FF)
* Young U. Ryu <ryoung AT utdallas.edu>
Young Ryu is the author of Txfonts, a set of mathematical symbols
designed to accompany text typeset in Times or its variants. In the
documentation, Young adresses the design of mathematical symbols: "The
Adobe Times fonts are thicker than the CM fonts. Designing math fonts
for Times based on the rule thickness of Times = , , + , / , < ,
etc. would result in too thick math symbols, in my opinion. In the TX
fonts, these glyphs are thinner than those of original Times
fonts. That is, the rule thickness of these glyphs is around 85% of
that of the Times fonts, but still thicker than that of the CM fonts."
TX fonts are are distributed under the GNU public license (GPL).
<http://www.ctan.org/tex-archive/fonts/txfonts/>.
Arrows (U+2190-U+21FF)
Mathematical Symbols (U+2200-U+22FF)
* Angelo Haritsis <ah AT computer.org>
Angelo Haritsis has compiled a set of Greek Type 1 fonts, once available as
as a tarball named greekXfonts-Type1-1.1.tgz.
The glyphs from this source have been used to compose Greek glyphs in
FreeSans and FreeMono.
Angelo's licence says: "You can enjoy free use of these fonts for
educational or commercial purposes. All derived works should include
this paragraph. If you want to change something please let me have
your changes (via email) so that they can go into the next
version. You can also send comments etc to the above address."
Greek (U+0370-U+03FF)
* Yannis Haralambous and Virach Sornlertlamvanich
In 1999, Yannis Haralambous and Virach Sornlertlamvanich made a set of
glyphs covering the Thai national standard Nf3, in both upright and
slanted shape. The collection of glyphs have been made part of GNU
intlfonts 1.2 package and is available under the GPL at
<ftp://ftp.gnu.org/pub/gnu/intlfonts/>.
Thai (U+0E00-U+0E7F)
* Shaheed R. Haque <srhaque AT iee.org>
Shaheed Haque has developed a basic set of basic Bengali glyphs
(without ligatures), using ISO10646 encoding. They are available under
the XFree86 license at <http://www.btinternet.com/~shaheedhaque/>.
Copyright (C) 2001 S.R.Haque <srhaque AT iee.org>. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL S.R.HAQUE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of S.R.Haque shall not be
used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from
S.R.Haque.
Bengali (U+0980-U+09FF)
* Sam Stepanyan <sam AT arminco.com>
Sam Stepanyan created a set of Armenian sans serif glyphs visually
compatible with Helvetica or Arial. Available on
<http://www.editum.com.ar/mashtots/html/fonts/ara.tar.gz>. On
2002-01-24, Sam writes: "Arial Armenian font is free for
non-commercial use, so it is OK to use under GPL license."
Armenian (U+0530-U+058F)
* Mohamed Ishan <>
Mohamed Ishan started the Thaana Unicode Project and among other things
created a couple of Thaana fonts, available under FDL or BDF license.
Thaana (U+0780-U+07BF)
* Sushant Kumar Dash <sushant AT writeme.com> (*)
Sushant Dash has created a font in his mother tongue, Oriya. As he
states on his web page <http://sushantdash.tripod.com/>:
"Please feel free to foreword this mail to your Oriya friends. No
copyright law is applied for this font. It is totally free!!! Feel
free to modify this using any font editing tools. This is designed for
people like me, who are away from Orissa and want to write letters
home using Computers, but suffer due to unavailability of Oriya
fonts.(Or the cost of the available packages are too much)."
Oriya (U+0B00-U+0B7F)
* Harsh Kumar <harshkumar AT vsnl.com>
Harsh Kumar has started BharatBhasha <http://www.bharatbhasha.net/> -
an effort to provide "FREE software, Tutorial, Source Codes
etc. available for working in Hindi, Marathi, Gujarati, Gurmukhi and
Bangla. You can type text, write Web pages or develop Indian Languages
Applications on Windows and on Linux. We also offer FREE help to
users, enthusiasts and software developers for their work in Indian
languages."
Devanagari (U+0900-U+097F)
Bengali (U+0980-U+09FF)
Gurmukhi (U+0A00-U+0A7F)
Gujarati (U+0A80-U+0AFF)
* Prasad A. Chodavarapu <chprasad AT hotmail.com>
Prasad A. Chodavarapu created Tikkana, a Telugu font available in Type
1 and TrueType format on <http://chaitanya.bhaavana.net/fonts/>.
Tikkana exceeds the Unicode Telugu range with some composite glyphs.
Available under the GNU General Public License.
Telugu (U+0C00-U+0C7F)
* Frans Velthuis <velthuis AT rc.rug.nl> and Anshuman Pandey
<apandey AT u.washington.edu>
In 1991, Frans Velthuis from the Groningen University, The Netherlands,
released a Devanagari font as Metafont source, available under the terms of
GNU GPL. Later, Anshuman Pandey from the Washington University, Seattle, USA,
took over the maintenance of font. Zdeněk Wagner has provided a huge amount
of expert advice regarding the implementation of the font in FreeSerif.
Fonts can be found on CTAN,
<ftp://ftp.dante.de/tex-archive/language/devanagari/>.
Devanagari (U+0900-U+097F)
* Hardip Singh Pannu <HSPannu AT aol.com>
In 1991, Hardip Singh Pannu has created a free Gurmukhi TrueType font,
available as regular, bold, oblique and bold oblique form. Its license
says "Please remember that these fonts are copyrighted (by me) and are
for non-profit use only."
Gurmukhi (U+0A00-U+0A7F)
* Jeroen Hellingman <jehe AT kabelfoon.nl>
Jeroen Hellingman created a set of Malayalam metafonts in 1994, and a
set of Oriya metafonts in 1996. Malayalam fonts were created as
uniform stroke only, while Oriya metafonts exist in both uniform and
modulated stroke. From private communication: "It is my intention to
release the fonts under GPL, but not all copies around have this
notice on them." Metafonts can be found on CTAN,
<ftp://ftp.dante.de/tex-archive/language/oriya/> and
<ftp://ftp.dante.de/tex-archive/language/malayalam/>.
Oriya (U+0B00-U+0B7F)
Malayalam (U+0D00-U+0D7F)
* Thomas Ridgeway <> (*)
Thomas Ridgeway, then at the Humanities And Arts Computing Center,
Washington University, Seattle, USA, (now defunct), created a Tamil
metafont in 1990. Anshuman Pandey from the same university took over
the maintenance of font. Fonts can be found at CTAN,
<ftp://ftp.dante.de/tex-archive/language/tamil/wntamil/>.
Tamil (U+0B80-U+0BFF)
* Berhanu Beyene <1beyene AT informatik.uni-hamburg.de>,
Prof. Dr. Manfred Kudlek <kudlek AT informatik.uni-hamburg.de>, Olaf
Kummer <kummer AT informatik.uni-hamburg.de>, and Jochen Metzinger <?>
Beyene, Kudlek, Kummer and Metzinger from the Theoretical Foundations
of Computer Science, University of Hamburg, prepared a set of Ethiopic
metafonts, found on
<ftp://ftp.dante.de/tex-archive/language/ethiopia/ethiop/>. They also
maintain home page on the Ethiopic font project,
<http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/wimis/kummer/ethiop_eng.html>,
and can be reached at <ethiop AT informatik.uni-hamburg.de>. The current
version of fonts is 0.7 (1998), and they are released under GNU GPL. I
converted the fonts to Type 1 format using Péter Szabó's TeXtrace-A
program <http://www.inf.bme.hu/~pts/textrace/> and removed some
redundant control points with PfaEdit.
Ethiopic (U+1200-U+137F)
* Maxim Iorsh <iorsh AT users.sourceforge.net>
In 2002, Maxim Iorsh started the Culmus project, aiming at providing
Hebrew-speaking Linux and Unix community with a basic collection of
Hebrew fonts for X Windows. The fonts are visually compatible with
URW++ Century Schoolbook L, URW++ Nimbus Sans L and URW++ Nimbus Mono
L families, respectively, and are released under GNU GPL license. See
also <http://culmus.sourceforge.net/>.
Hebrew (U+0590-U+05FF)
* Panayotis Katsaloulis <panayotis AT panayotis.com>
Panayotis Katsaloulis helped fixing Greek accents in the Greek
Extended area.
Greek Extended (U+1F00-U+1FFF)
* Vyacheslav Dikonov <sdiconov AT mail.ru>
Vyacheslav Dikonov made a Braille unicode font that could be merged
with the UCS fonts to fill the 2800-28FF range completely. (uniform
scaling is possible to adapt it to any cell size). He also contributed
a free syriac font, whose glyphs (about half of them) are borrowed
from the "Carlo Ator" font by Tim Erickson.
Vyacheslav also filled in a few missing
spots in the U+2000-U+27FF area, e.g. the box drawing section, sets of
subscript and superscript digits and capital Roman numbers.
Syriac (U+0700-U+074A)
Box Drawing (U+2500-U+257F)
Braille (U+2800-U+28FF)
* Tim Erickson
Is the author of several Eurasian fonts, including "Carlo Ator".
He has given his written permission for glyphs from this font to be
included in FreeFont.
Syriac (U+0700-U+074A)
* M.S. Sridhar <mssridhar AT vsnl.com>
M/S Cyberscape Multimedia Limited, Mumbai, developers of Akruti
Software for Indian Languages (http://www.akruti.com/), have released
a set of TTF fonts for nine Indian scripts (Devanagari, Gujarati,
Telugu, Tamil, Malayalam, Kannada, Bengali, Oriya, and Gurumukhi)
under the GNU General Public License (GPL). You can download the fonts
from the Free Software Foundation of India WWW site
(http://www.gnu.org.in/akruti-fonts/) or from the Akruti website.
For any further information or assistance regarding these fonts,
please contact mssridhar AT vsnl.com.
Devanagari (U+0900-U+097F)
Bengali (U+0980-U+09FF)
Gurmukhi (U+0A00-U+0A7F)
Gujarati (U+0A80-U+0AFF)
Oriya (U+0B00-U+0B7F)
Tamil (U+0B80-U+0BFF)
Telugu (U+0C00-U+0C7F)
Kannada (U+0C80-U+0CFF)
Malayalam (U+0D00-U+0D7F)
* DMS Electronics, The Sri Lanka Tipitaka Project, and Noah Levitt
<nlevitt AT columbia.edu>
Noah Levitt found out that the Sinhalese fonts available on the site
<http://www.metta.lk/fonts/> are released under GNU GPL, or,
precisely, "Public Domain under GNU Licence
Produced by DMS
Electronics for The Sri Lanka Tipitaka Project" (taken from the font
comment), and took the effort of recoding the font to Unicode.
These glyphs were later replaced by those from the LKLUG font
<http://www.lug.lk/fonts/lklug>
Finally the range was completely replaced by glyphs from the sinh TeX
font, with much help and advice from Harshula Jayasuriya.
Sinhala (U+0D80-U+0DFF)
* Daniel Shurovich Chirkov <dansh AT chirkov.com>
Dan Chirkov updated the FreeSerif font with the missing Cyrillic
glyphs needed for conformance to Unicode 3.2. The effort is part of
the Slavjanskij package for Mac OS X,
<http://www.versiontracker.com/dyn/moreinfo/macosx/18680>.
Cyrillic (U+0400-U+04FF)
* Denis Jacquerye <moyogo AT gmail.com>
Denis Jacquerye added new glyphs and corrected existing ones in the
Latin Extended-B and IPA Extensions ranges.
Latin Extended-B (U+0180-U+024F)
IPA Extensions (U+0250-U+02AF)
* K.H. Hussain <hussain AT kfri.org> and R. Chitrajan
`Rachana' in Malayalam means `to write', `to create'. Rachana Akshara Vedi,
a team of socially committed information technology professionals and
philologists, has applied developments in computer technology and desktop
publishing to resurrect the Malayalam language from the disorder,
fragmentation and degeneration it had suffered since the attempt to adapt
the Malayalam script for using with a regular mechanical typewriter, which
took place in 1967-69. K.H. Hussein at the Kerala Forest Research Institute
has released "Rachana Normal" fonts with approximately 900 glyphs required
to typeset traditional Malayalam. R. Chitrajan apparently encoded the
glyphs in the OpenType table.
In 2008, the Malayalam ranges in FreeSerif were updated under the advise
and supervision of Hiran Venugopalan of Swathanthra Malayalam Computing,
to reflect the revised edition Rachana_04.
Malayalam (U+0D00-U+0D7F)
* Solaiman Karim <solaiman AT ekushey.org>
Bengali (U+0980-U+09FF)
Solaiman Karim has developed several OpenType Bangla fonts and
released them under GNU GPL on <http://www.ekushey.org>.
* Sonali Sonania <sonalisonania AT gmail.com> and Monika Shah
<monikapatira AT gmail.com>
Devanagari (U+0900-U+097F)
Gujarati (U+0A80-U+0AFF)
Glyphs were drawn by Cyberscape Multimedia Ltd., #101,Mahalakshmi
Mansion 21st Main 22nd "A" Cross Banashankari 2nd stage Banglore
560070, India. Converted to OTF by IndicTrans Team, Powai, Mumbai,
lead by Prof. Jitendra Shah. Maintained by Monika Shah and Sonali
Sonania of janabhaaratii Team, C-DAC, Mumbai. This font is released
under GPL by Dr. Alka Irani and Prof Jitendra Shah, janabhaaratii
Team, C-DAC, Mumabi. janabhaaratii is localisation project at C-DAC
Mumbai (formerly National Centre for Software Technology); funded by
TDIL, Govt. of India. Contact:monika_shah AT lycos.com,
sonalisonania AT yahoo.com, jitendras AT vsnl.com, alka AT ncst.ernet.in.
website: www.janabhaaratii.org.in.
* Pravin Satpute <pravin.d.s AT gmail.com>, Bageshri Salvi
<sbagrshri AT yahoo.co.in>, Rahul Bhalerao <b.rahul.pm AT
gmail.com> and Sandeep Shedmake <sandeep.shedmake AT gmail.com>
Devanagari (U+0900-U+097F)
Gujarati (U+0A80-U+0AFF)
Oriya (U+0B00-U+0B7F)
Malayalam (U+0D00-U+0D7F)
Tamil (U+0B80-U+0BFF)
In December 2005 the team at www.gnowledge.org released a set of two
Unicode pan-Indic fonts: "Samyak" and "Samyak Sans". "Samyak" font
belongs to serif style and is an original work of the team; "Samyak
Sans" font belongs to sans serif style and is actually a compilation
of already released Indic fonts (Gargi, Padma, Mukti, Utkal, Akruti
and ThendralUni). Both fonts are based on Unicode standard.
The fonts are now hosted at Sarovar.org:
http://sarovar.org/projects/samyak/
* Kulbir Singh Thind
Gurmukhi (U+0A00-U+0A7F)
Dr. Kulbir Singh Thind designed a set of Gurmukhi Unicode fonts,
AnmolUni and AnmolUni-Bold, which are available under the terms of GNU
Generel Public License from the Punjabu Computing Resource Center,
http://guca.sourceforge.net/typography/fonts/anmoluni/.
* Gia Shervashidze <giasher AT telenet.ge>
Georgian (U+10A0-U+10FF)
Starting in mid-1990s, Gia Shervashidze designed many
Unicode-compliant Georgian fonts: Times New Roman Georgian, Arial
Georgian, Courier New Georgian. His work on Georgian localization can
be reached at http://www.gia.ge/.
* Primož Peterlin <primoz.peterlin AT biofiz.mf.uni-lj.si>
Primož Peterlin filled in missing glyphs here and there (e.g. Latin
Extended-B and IPA Extensions ranges in the FreeMono familiy), and
created the following UCS blocks:
Latin Extended-B (U+0180-U+024F)
IPA Extensions (U+0250-U+02AF)
Arrows (U+2190-U+21FF)
Box Drawing (U+2500-U+257F)
Block Elements (U+2580-U+259F)
Geometrical Shapes (U+25A0-U+25FF)
* Mark Williamson
Made the MPH 2 Damase font, from which
Hanunóo (U+1720-U+173F)
Buginese (U+1A00-U+1A1F)
Tai Le (U+1950-U+197F)
Ugaritic (U+10380-U+1039F)
Old Persian (U+103A0-U+103DF)
* Jacob Poon
Submitted a very thorough survey of glyph problems and other suggestions.
* Alexey Kryukov
Made the TemporaLCGUni fonts, based on the URW++ fonts, from which at one
point FreeSerif Cyrillic, and some of the Greek, was drawn. He also provided
valuable direction about Cyrillic and Greek typesetting.
Cyrillic (U+0400-U+04FF)
* George Douros
The creator of several fonts focusing on ancient scripts and symbols.
Many of the glyphs are created by making outlines from scanned images
of ancient sources.
Aegean: Phoenecian
Analecta: Gothic (U+10330-U+1034F)
Musical: Byzantine & Western
Unicode: many Miscellaneous Symbols, Miscellaneous Technical, OCR,
supplemental Symbols, and Mathematical Alphanumeric symbols,
Mah Jong, and the outline of the Domino.
* Daniel Johnson
Created by hand a Cherokee range specially for FreeFont to be "in line with
the classic Cherokee typefaces used in 19th century printing", but also to
fit well with ranges previously in FreeFont. Then he made Unified Canadian
Syllabics in Sans, and a Cherokee and Kayah Li in Mono! And never to be
outdone by himself, then did UCAS Extended and Osmanya.... What next?
Armenian (serif) (U+0530-U+058F)
Cherokee (U+13A0-U+13FF)
Unified Canadian Aboriginal Syllabics (U+1400-U+167F)
UCAS Extended (U+18B0-U+18F5)
Kayah Li (U+A900-U+A92F)
Tifinagh (U+2D30-U+2D7F)
Vai (U+A500-U+A62B)
Latin Extended-D (Mayanist letters) (U+A720-U+A7FF)
Osmanya (U+10480-U+104a7)
* Yannis Haralambous and Wellcome Institute
In 1994, The Wellcome Library
The Wellcome Institute for the History of Medicine
183 Euston Road, London NW1 2BE, England.
commissioned Mr. Haralambous to produce a Sinhalese font for them.
We have received 03/09 official notice from Robert Kiley, Head of e-Strategy
for the Wellcome Library, that Yannis' font could be included in GNU
FreeFont under its GNU license.
Thanks to Dominik Wujastyk, for providing us with feedback and contacts
to repsonsible people at the Trust.
Sinhala (U+0D80-U+0DFF)
* The Sinhala font project http://sinhala.sourceforge.net/
The Sinhala font project has taken the glyphs from Yannis Haralambous'
Sinhala font, to produce a Unicode TrueType font, LKLUG. These glyphs
were for a while included in FreeFont.
Sinhala (U+0D80-U+0DFF)
* Steve White <stevan.white AT googlemail.com>
Filled in a lot of missing characters, got some font features working,
left fingerprints almost everywhere, and is responsible for these blocks:
Runic (U+16A0-U+16F0)
Glagolitic (U+2C00-U+2C5F)
Coptic (U+2C80-U+2CFF)
Old Italic (U+10300-U+1032F)
(The design of Runic is based roughly on one originally submitted by
Vyacheslav Dikonov)
* Pavel Skrylev is responsible for
Cyrillic Extended-A (U+2DEO-U+2DFF)
as well as many of the additions to
Cyrillic Extended-B (U+A640-U+A65F)
* Masoud Pourmoosa corrected several letters in Arabic for Persian:
Arabic (U+0600-U+06FF)
Notes:
*: The glyph collection looks license-compatible, but its author has
not yet replied and agreed on their work being used in part of
this glyph collection.
--------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,98 @@
Installing GNU FreeFont
=======================
GNU FreeFont can be used in any modern operating system.
This document explains how to install FreeFont on some common systems.
UNIX/GNU/Linux/BSD Systems
--------------------------
FreeFont works with any system using the free font rasterizer FreeType
<http://www.freetype.org/>. Some features such as glyph substitution and
positioning may be handled by the text layout library
Pango <http://www.pango.org/>.
Most recent systems using FreeType2 and Pango handle OpenType fonts well,
but on older systems TrueType may perform better.
* Debian GNU/Linux
Users of Debian GNU/Linux system will probably want to use the Debian package,
named 'ttf-freefont', available from the Debian Linux site.
Install the fonts by issuing the command
apt-get install ttf-freefont
* KDE local installation
Users of KDE can install .ttf files on a per-user basis using the KDE
Control Center module "kcmfontinst", which may appear in the menu as
Settings -> System Administration -> Font Installer
This is especially helpful for developers and testers.
* Generic X Window systems
1) Fetch the freefont-ttf.tar.gz package with Free UCS outline fonts
in the TrueType format.
2) Unpack TrueType fonts into a suitable directory,
e.g. /usr/local/share/fonts/default/TrueType/
3) If you have chosen any other directory, make sure the directory you
used to install the fonts is listed in the path searched by the X
Font Server by editing the config file in /etc/X11/.
In some systems, you list the directory in the item "catalogue="
in the file /etc/X11/fs/config.
4) Run ttmkfdir in the directory where you unpacked the fonts.
Microsoft Windows 95/98/NT/2000/XP; Vista/7
-------------------------------------------
Note that in at least Windows 7, Vista, XP and 2000, the TrueType versions
perform much better than, and are recommended over, the OpenType ones.
For good font smoothing in Windows, Microsoft ClearType must be enabled.
The native Windows web browser must be used to install, enable, and configure
ClearType. A web search for "ClearType Tuner" will find the proper web pages.
Recent versions of the browser raise a security block (a yellow bar at the
top of the window), which you must act upon to allow installation. A
checkbox in the window turns ClearType on (in Win-speek, "Turn on ClearType").
The change happens immediately.
* Vista, Windows 7:
1) From the Start menu, open Control Panels
2) Drag-n-drop font files onto Fonts control panel
You may get a dialog saying
"Windows needs your permission to continue"
a) Click Continue
* 95/98/NT:
The font installation is similar to Vista.
In order to use OpenType, users of Windows 95, 98 and NT 4.0 can
install Adobe's 'Type Manager Light', which may be obtained from
the Adobe web site.
Otherwise, use the TrueType versions.
Apple Mac OS X
--------------
Support for OpenType on MacOS X started with OS 10.4, and has been improved
gradually in later versions.
Installing on Mac OS X consists of moving the font files to either
/Library/Fonts/ or ~/Library/Fonts/
depending on whether they should be available to all users on your system
or just to your own user.
--------------------------------------------------------------------------
$Id: INSTALL,v 1.11 2011-06-12 07:14:12 Stevan_White Exp $

View File

@@ -0,0 +1,127 @@
-*-text-*-
GNU FreeFont
The GNU FreeFont project aims to provide a useful set of free scalable
(i.e., OpenType) fonts covering as much as possible of the ISO 10646/Unicode
UCS (Universal Character Set).
Statement of Purpose
--------------------
The practical reason for putting glyphs together in a single font face is
to conveniently mix symbols and characters from different writing systems,
without having to switch fonts.
Coverage
--------
FreeFont covers the following character ranges
* Latin, Cyrillic, and Arabic, with supplements for many languages
* Greek, Hebrew, Armenian, Georgian, Thaana, Syriac
* Devanagari, Bengali, Gujarati, Gurmukhi, Sinhala, Tamil, Malayalam
* Thai, Tai Le, Kayah Li, Hanunóo, Buginese
* Cherokee, Unified Canadian Aboriginal Syllabics
* Ethiopian, Tifnagh, Vai, Osmanya, Coptic
* Glagolitic, Gothic, Runic, Ugaritic, Old Persian, Phoenician, Old Italic
* Braille, International Phonetic Alphabet
* currency symbols, general punctuation and diacritical marks, dingbats
* mathematical symbols, including much of the TeX repertoire of symbols
* technical symbols: APL, OCR, arrows,
* geometrical shapes, box drawing
* musical symbols, gaming symbols, miscellaneous symbols
etc.
For more detail see <http://www.gnu.org/software/freefont/coverage.html>
Editing
-------
The free outline font editor, George Williams' FontForge
<http://fontforge.sourceforge.net/> is used for editing the fonts.
Design Issues
-------------
Which font shapes should be made? Historical style terms like Renaissance
or Baroque letterforms cannot be applied beyond Latin/Cyrillic/Greek
scripts to any greater extent than Kufi or Nashki can be applied beyond
Arabic script; "italic" is strictly meaningful only for Latin letters,
although many scripts such as Cyrillic have a history with "cursive" and
many others with "oblique" faces.
However, most modern writing systems have typographic formulations for
contrasting uniform and modulated character stroke widths, and since the
advent of the typewriter, most have developed a typographic style with
uniform-width characters.
Accordingly, the FreeFont family has one monospaced - FreeMono - and two
proportional faces (one with uniform stroke - FreeSans - and one with
modulated stroke - FreeSerif).
The point of having characters from different writing systems in one font
is that mixed text should look good, and so each FreeFont face contains
characters of similar style and weight.
Licensing
---------
Free UCS scalable fonts is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
The fonts are distributed in the hope that they will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, if you create a document which uses this font, and
embed this font or unaltered portions of this font into the document, this
font does not by itself cause the resulting document to be covered by the
GNU General Public License. This exception does not however invalidate any
other reasons why the document might be covered by the GNU General Public
License. If you modify this font, you may extend this exception to your
version of the font, but you are not obligated to do so. If you do not
wish to do so, delete this exception statement from your version.
Files and their suffixes
------------------------
The files with .sfd (Spline Font Database) are in FontForge's native format.
They may be used to modify the fonts.
TrueType fonts are the files with the .ttf (TrueType Font) suffix. These
are ready to use in Linux/Unix, on Apple Mac OS, and on Microsoft Windows
systems.
OpenType fonts (with suffix .otf) are preferred for use on Linux/Unix,
but *not* for recent Microsoft Windows systems.
See the INSTALL file for more information.
Web Open Font Format files (with suffix .woff) are for use in Web sites.
See the webfont_guidelines.txt for further information.
Further information
-------------------
Home page of GNU FreeFont:
http://www.gnu.org/software/freefont/
More information is at the main project page of Free UCS scalable fonts:
http://savannah.gnu.org/projects/freefont/
To report problems with GNU FreeFont, it is best to obtain a Savannah
account and post reports using that account on
https://savannah.gnu.org/bugs/
Public discussions about GNU FreeFont may be posted to the mailing list
freefont-bugs@gnu.org
--------------------------------------------------------------------------
Original author: Primoz Peterlin
Current administrator: Steve White <stevan.white@googlemail.com>
$Id: README,v 1.10 2011-06-12 07:14:12 Stevan_White Exp $

View File

@@ -0,0 +1,115 @@
Troubleshooting GNU FreeFont
So your text looks lousy, although you installed FreeFont and you seem to be
using it. What do you do?
Before you blame the problem on FreeFont, take the time to double-check that
the text you are looking at is really rendered with FreeFont.
Be aware that not all Unicode characters are supported by FreeFont, and
even characters supported by one face, such as Serif, might not be
supported by other faces such as Sans.
Also, some systems have settings that strongly affect the rendering
of fonts. It may be worth tweaking these.
glyph substitution
==================
When given the task of displaying characters in text, modern font rendering
software usually tries to display *something*, even if the font it is
*supposed* to be using does not contain glyphs for all the characters in the
text. The software will snoop through all the fonts on the system to find
one that has a glyph for the one missing in the desired font. So although
you have specified FreeSans-bold, you may be looking at a letter from quite
a different font.
First double-check that the font in question really contains the character
in question. If you don't have font development software, this can be
tricky. In the case of FreeFont, you can check if a given character
range is supported: <http://www.gnu.org/software/freefont/coverage.html>
Next double-check that your application (web browser, text editor, etc)
has indeed been properly instructed to use the font.
Then double-check that the font is really installed in the system.
(This depends on the operating system, of course.)
Linux and Unix
==============
Modern Linux systems use a system called fontconfig, which maintains a font
cache, for efficiency.
The font cache can really complicate font installation and troubleshooting
however. It can happen that when a font is newly installed, what is
displayed is coming out of an old cache entry rather than the new font.
Just what to do depends on how and where the font was installed.
Fonts installed system-wide are usually put in a directory such as
/usr/share/fonts/
the font cache for these might be in
/var/cache/fontconfig/
Fonts installed just for one user account will typically be in
~/.fonts/
and the cache will be
~/.fontconfig/
You can clean your local cache merely by emptying the directory
~/.fontconfig/
In any case, to clean the cache, you can use the fontconfig command
fc-cache -vf
If run as root, it will clean the system cache, if run as a normal user,
it cleans only the normal user's cache.
The procedure for local fonts is:
1) shut off any program using the fonts in question
2) clean the cache
3) re-start the program
The procedure for system-wide fonts is:
1) log out of the X Windows session
2) in a console, clean the cache
3) log in to an X Windows session
LibreOffice / OpenOffice
========================
These products have their own font rendering libraries, which have
idiosyncratic behavior.
It has recently been reported that as of LibreOffice 3.5.1, font features
are disabled for OpenType fonts. If you use FreeFont with these products,
you may want to install the TrueType versions of the fonts.
Windows
=======
The most common complaint has to do with "blurry text". There are two
causes.
The first is that ClearType smoothing is turned off. The best way to check
is to use the native Windows Web browser. Do a search for "ClearType Tuner".
The Microsoft pages install a tuner for ClearType. A security block notice
will appear at the top of the window--you have to allow the installation.
Then check the box "Turn on ClearType". The change happens immediately.
The secont cause is that the FreeFont version with cubic spline outlines is
installed. As of the 2012 GNU FreeFont release, the TrueType builds have
quadratic splines, which work best with Windows' rendering software.
TTF (TrueType) quadratic splines Windows 7, Vista, Windows XP.
OTF (OpenType) cubic splines Linux, Mac
Note also: Firefox has a setting for ClearType:
gfx.font_rendering.cleartype_params.rendering_mode
A value of 2 sets it to old-style GDI rendering, while -1 is the default.
reporting problems
==================
If you really think you're seeing a bug in FreeFont, or if you have
a suggestion, consider opening a problem report at
https://savannah.gnu.org/bugs/?group=freefont
It is best that you make a Savannah account and log in with that, so
you can be e-mailed whenever changes are made to your report.
$Id: troubleshooting.txt,v 1.10 2011-07-16 08:38:06 Stevan_White Exp $

View File

@@ -0,0 +1,185 @@
Usage of GNU FreeFont
Language scripts and faces
==========================
There are three faces (serif, sans-serif, and monospace), and four styles
(regular, bold, cursive/italic, and bold cursive/italic) for each face.
There is one font file per face/style combination: 12 files in total.
The letters for various languages, as well as specialized symbols, exist
among the various font files, but they are not uniformly populated.
All the fonts have complete support for Latin, Cyrillic, and Greek, as
well as most of the extensions for those scripts.
At this time, serif regular has by far the largest number of letters, and
supports the largest number of writing scripts. However there are writing
scripts supported by the sans-serif but not by serif.
For an overview of which scripts and sets of symbols are supported by
which face, see the FreeFont 'coverage' web page.
Font features
=============
FreeFont has numerous font "features" that perform alterations to the basic
letters of the font, replacing them with other letters, or positioning them
with respect to other letters.
Many features are activated automatically, but in some environments, they
present some user control. This documents those features with user control.
Language-specific features
==========================
Some OpenType font features are activated only when the text is specified to
be of a certain language.
This is done in HTML by enclosing the text with a tag whose 'lang' attribute
is set to the appropriate ISO 632.2 language code. In a word processor,
any block of text can be given a language setting.
Latin
-----
Catalan ligature improving l·l
Dutch ligatures for ij, IJ
Sami localized form for letter Eng
Turkish overrides ligatures fi ffi of Latin
Cyrillic
--------
Ukrainian ligature for double i-diaresis
Serbian/Macedonian localized letters be, and more in italic
Bulgarian style set for modern glyphs
Hebrew
------
Yiddish raised vowels under yo
Devanagari
----------
Sanskrit much larger set of ligatures
Hindi, Marathi better spacing of Western punctuation marks
Indic languages
---------------
The 'danda' character is encoded in Unicode only in the Devanagari range.
When writing in scripts of other Indic languages, this same character is to
be used. But the shapes and line thicknesses of glyphs vary slightly from
one script to another, so the same glyph for 'danda' may not fit all scripts.
By specifying the language of the text, an appropriate glyph for 'danda'
will be obtained.
Style sets
==========
These replacements are activated by specifying a "Style Set".
These features are accessible only from typesetting software.
Cyrillic Bulgarian modern (ss01)
Devanagari Bombay (ss02), Calcutta (ss03), Nepali (ss04)
Discretionary features
======================
These features are accessible only from typesetting software.
Typically the user must specifically request them.
Unless otherwise noted, these are available only in FreeSerif.
Ligatures and substitutions
---------------------------
Arabic, Armenian, Hebrew, German, Dutch
Small captials
--------------
A limited set of specially drawn small capital letters in Latin.
Superscript and subscript
-------------------------
Transform a limited set of characters--mostly Latin letters and numerals--
to versions well-sized and positioned as superscript or subscript.
Numeral styles
--------------
The default numerals of FreeSerif are mono-spaced and of even height.
It also features proportionally-spaced numerals, and "old-style" numerals--
those which vary in height and sometimes go beneath the baseline.
These can be had at discretion.
Diagonal fractions
------------------
A limited set of diagonal fraction substitutions are available at discretion.
The set is more than what is encoded in Unicode.
They work with the ASCII slash or the mathematical slash U+2215.
The transform a sequence "number-slash-number" to a diagonal form.
Zero
----
A slashed form of the numeral zero is available at discretion.
Available in all faces.
Alternative characters
======================
FreeSerif has some listings of alternatives for specific characters.
Again this is use primarily in specialized typesetting software.
Greek, Latin
Use in LaTeX
============
It is possible to use Unicode fonts in recent LaTeX implementations, but in
LuaTeX http://www.luatex.org/ and
XeTeX http://tug.org/xetex/
it is particularly easy to use Unicode text, and to enable font features.
Recent versions of these systems use the 'fontspec' package to choose fonts
and features.
A very simple document might contain the lines
---------------------------------------------------------------------------
\documentclass{ltxdockit}
\usepackage{fontspec}
\usepackage{xunicode}
\setmainfont[]{FreeSerif}
\begin{document}
{\fontspec[Script=Default,Fractions={On}]{FreeSerif}
1/7 3/10 7/10}
x\raisebox{-0.5ex}{{\scriptsize ai}}
x{\fontspec[Script=Default,VerticalPosition={Inferior}]{FreeSerif}
abcdefghijklmnopqrstuvwxyz+(0123456789)} \\
x\raisebox{0.85ex}{{\scriptsize ai}}
x{\fontspec[Script=Default,VerticalPosition={Superior}]{FreeSerif}
abcdefghijklmnopqrstuvwxyz+(0123456789)}
{\fontspec[Script=Latin]{FreeSerif}
\textsc{Small Caps} }
{ Bсички хора се раждат свободни и равни по достойнство и права.
\fontspec[Script=Cyrillic,Language=Bulgarian,Variant={1}]{FreeSerif} \selectfont
Bсички хора се раждат свободни и равни по достойнство и права. }
\end{document}
---------------------------------------------------------------------------
Here are some 'fontspec' setting-value pairs meaningful for FreeFont.
Numbers: Lining OldStyle Proportional SlashedZero
Fractions: On
VerticalPosition: Superior Inferior
Ligatures: Common Historical
Letters: UppercaseSmallCaps
Variant: 1 (etc. -- must be in {} picks style set.)
---------------------------------------------------------------------------
$Id: usage.txt,v 1.10 2011-07-16 08:38:06 Stevan_White Exp $

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.