Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Font Kerning

Font Kerning

Scheduled Pinned Locked Moved C#
graphicshelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jjvainav
    wrote on last edited by
    #1

    I am trying to accomplish Kerning, so far I have it somewhat working. By using the win32 function [DllImport("gdi32.dll", EntryPoint= "SetTextCharacterExtra")] public static extern int SetTextCharacterExtra(IntPtr hdc, int nCharExtra); I am getting spacing between characters. The issue is no matter what value I put for the nCharExtra parameter the spacing is always the same. Here is how I am trying to do it. win32.SetTextCharacterExtra(g.Graphics.GetHdc(), horizontalSpacing); g.ReleaseHdc(); g.DrawString(holdText, this.Font, new SolidBrush(this.ForeColor), 0, 2); I have also tried doing IntPtr hdc = e.Graphics.GetHdc(); Rect bounds = new Rect(e.ClipRectangle); win32.SetTextCharacterExtra(hdc, horizontalSpacing); win32.SetBkMode(hdc, win32.TRANSPARENT); win32.SetBkColor(hdc, ColorTranslator.ToWin32(Color.Black)); win32.DrawText(hdc, holdText, holdText.Length, ref bounds, win32.DT_LEFT); Does anyone know a solution to this issue, or another way in which I can accomplish Kerning? Thanks, Jeremy

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups