RE: Excel column width question again



Hello Dave,

1) How do I determine what font and point size to use?
The definition of 'Width' tells us that column width is measured as the
number of characters of the maximum digit width of the numbers 0,1,2,¡­,9
as rendered in the *normal style's font*. (Please notice the bold part). We
do not need to determine what font and point size to use. It is decided by
the Excel setting of 'Normal Font', namely, normal style's font. When Excel
renders width to pixel in runtime, it will read the setting for 'Normal
Font' and use the formula '=Truncate(((256 * {width} +
Truncate(128/{Maximum Digit Width}))/256)*{Maximum Digit Width})' to
calculate the pixel. 'Normal Font' can be set at Format->Styles¡­->Choose
'Normal' in the style name list.

2) Does it always use the character 0 at that width?
No, it uses the maximum character width of the normal font among 0,1,2,¡­,9.

3) What is the correct formula to get the exact full width?
As we discussed in the post "XLSX cell width - in twips?",
The correct method to convert width to pixel is:
Pixel =Truncate(((256 * {width} + Truncate(128/{Maximum Digit
Width}))/256)*{Maximum Digit Width})
The correct method to convert pixel to width is:
1. use the formula =Truncate(({pixels}-5)/{Maximum Digit Width} *
100+0.5)/100 to convert pixel to character number.
2. use the formula width = Truncate([{Number of Characters} * {Maximum
Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256 to convert
the character number to width.

If you have any other questions or concerns, please feel free to let me
know.

Happy New Year!

Regards,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: What am I missing without mutt?
    ... Or you can use the font LatArCyrHeb-16. ... it is the hack for the 512 character limit... ... heavy changed and does now support the shaping and oter stuff. ... Debian GNU/Linux Consultant ...
    (Debian-User)
  • Re: bullets have all changed into infinity signs
    ... I should have realized it was the Symbol font! ... I called MS support. ... Character Palette to find the character you want and then replace the ...
    (microsoft.public.mac.office.word)
  • RE: Latin, FarEast, Complex unicode ranges
    ... A good question brought up about this today - which font is used for Thai ... It's ranges like that that are why we are asking for the OpenXML ... you are wondering the character range of some ... Microsoft Online Community Support ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: keyboard shortcuts
    ... Depends on what font you are using, and what program you are trying to ... If the font set or the program doesn't support this ... get this character adhocly is to use the character map program ... With that program it reports that ALT + 0241 is the correct keystrokes for ñ ...
    (microsoft.public.windowsxp.general)
  • Unicode text editor mined 2000 release 11
    ... are not aware of (like auto-detection features and automatic handling ... It was the first editor that supported Unicode in a plain-text terminal. ... Combining character width properties. ... Added keyboard configuration examples for Control-function key detection for rxvt and mlterm to the runtime support library. ...
    (comp.editors)

Quantcast