+ Reply to Thread
Results 1 to 7 of 7

How do I determine which fonts are fixed width?

  1. #1
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    How do I determine which fonts are fixed width?

    I have a code that uses a Word application object to get a list of installed fonts which works great. Does anyone know if there's some way I can determine which of them are fixed width fonts? I am writing an add-in for public release and obviously won't know what fonts are installed on a given system. I could keep a list of the most common monospace fonts and compare the list of installed fonts to that to pick out the fixed width ones but was hoping for a more dynamic solution.
    Please click *Add Reputation if I've helped

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How do I determine which fonts are fixed width?

    I think a list would be easiest -- there aren't many monospaced fonts, and there is no font property that tells you if it's monospaced.

    Otherwise, I think you'd need to write code that writes a string of i's and a string of w's and compare width.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: How do I determine which fonts are fixed width?

    Actually that's not a bad solution shg. How would I compare the physical length of a string though?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How do I determine which fonts are fixed width?


  5. #5
    Forum Contributor
    Join Date
    05-27-2014
    Location
    Belfast, Northern Ireland
    MS-Off Ver
    2007 & 2010
    Posts
    273

    Re: How do I determine which fonts are fixed width?

    Quote Originally Posted by shg View Post
    Thanks shg. That got me on the right track and I got exactly what I needed. For the benefit of any others in need; I'm using a userform so when I came across Dustin's answer here I set up the label the way he described and did something like this:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How do I determine which fonts are fixed width?

    Good job, thanks for posting back.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How do I determine which fonts are fixed width?

    Another way, using Excel:

    Please Login or Register  to view this content.
    Last edited by shg; 12-01-2015 at 02:09 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Importing fixed width .txt files
    By MarmaladeLover in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2014, 08:41 AM
  2. Fixed Width Text to Excel with fixed break lines.
    By jameel30 in forum Word Formatting & General
    Replies: 1
    Last Post: 08-10-2012, 08:57 PM
  3. Fixed Width Formula
    By rmikulas in forum Excel General
    Replies: 1
    Last Post: 01-18-2011, 04:13 PM
  4. Fixed column width
    By Terriz in forum Excel General
    Replies: 2
    Last Post: 07-22-2009, 05:18 AM
  5. Create fixed width from worksheet
    By Dylan&Hayden in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-23-2009, 07:13 PM
  6. Fixed width with CONCATENATE
    By ducecoop in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-19-2008, 05:29 PM
  7. fixed width file?
    By kwiklearner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-13-2006, 05:10 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1