Author Topic: Text Box appear differently on different PC's  (Read 18727 times)

0 Members and 1 Guest are viewing this topic.

sunnyimran

  • Jr. Member
  • **
  • Posts: 52
Re: Text Box appear differently on different PC's
« Reply #15 on: October 16, 2019, 02:34:55 AM »
Option-(a): reducing left/right margins:
                        It was             left:4     right:4     
                       Changing to      left:0     right:0    fits text in box correctly

That's puzzling that on PC1   left:4 and right:4  gives correct results. anyways we have to solve

Option-(b): reducing character spacing
                  'Expanded' by 2
change to    'Expanded' by 1.5 also solves the problem


Now please suggest which is more better to alter. Kindly also give an example to iterate through each file and change shapesheet property of that specific shape. I mean how to open VSDX in a loop one by one. using file system object or using File handle etc. how?

thanks



vojo

  • Hero Member
  • *****
  • Posts: 1711
Re: Text Box appear differently on different PC's
« Reply #16 on: October 17, 2019, 08:51:58 AM »
Are you sure that PC1 = PC2 windows settings ==> font scale   are same
In otherwords, in a given windows, you can set the font scaling of the PC.  I don't think it adjusts graphics, just the font scale.
I believe on windows 10, you get 3 choices now  80% 100%, 125%

are you sure both instances of visio are using same units  (mm vs inches)

older versions of visio picked font based on a "blind" number
so if fonts on PC1 were say Calibri, times roman, arieal…...PC2  is Calibri, areal, times roman
font = 2 would be times roman on PC1....areal on PC2
(I think later versions used font name not a blind number...so maybe a ghost).

There are tricks you can use to scale or antiscale fonts in visio  (this can be handy if you have a shape that may scale significantly...and maintain readability - 10mm that grows to 100mm, might want font to scale from 10pt to 40pt automatically

Original shape is 10mm X 10mm
font could be     20pt * scale factor * width/10mm    // scaling       bigger shape, bigger font...scale factor can temper scaling

font could be  20pt *scale factor *10mm/width       // antiscaling   smaller shape, bigger font

Finally, could look at txttranform in shapesheet...might be some knobs / switches in that
(its a special section...not where the character size, spacing, bullets  info called out)

sunnyimran

  • Jr. Member
  • **
  • Posts: 52
Re: Text Box appear differently on different PC's
« Reply #17 on: December 02, 2019, 09:26:01 AM »
Are you sure that PC1 = PC2 windows settings ==> font scale   are same
In otherwords, in a given windows, you can set the font scaling of the PC.  I don't think it adjusts graphics, just the font scale.
I believe on windows 10, you get 3 choices now  80% 100%, 125%

are you sure both instances of visio are using same units  (mm vs inches)

older versions of visio picked font based on a "blind" number
so if fonts on PC1 were say Calibri, times roman, arieal…...PC2  is Calibri, areal, times roman
font = 2 would be times roman on PC1....areal on PC2
(I think later versions used font name not a blind number...so maybe a ghost).

There are tricks you can use to scale or antiscale fonts in visio  (this can be handy if you have a shape that may scale significantly...and maintain readability - 10mm that grows to 100mm, might want font to scale from 10pt to 40pt automatically

Original shape is 10mm X 10mm
font could be     20pt * scale factor * width/10mm    // scaling       bigger shape, bigger font...scale factor can temper scaling

font could be  20pt *scale factor *10mm/width       // antiscaling   smaller shape, bigger font

Finally, could look at txttranform in shapesheet...might be some knobs / switches in that
(its a special section...not where the character size, spacing, bullets  info called out)

I have double checked everything compares same on both PC's.
Sorry for the late update. I am done with all those VSDX files by using/printing them o the PC where they were appearing correct. For next files, I have updated my template with slight settings change textbox properties. I have made textbox margin to zero. This way newly generated files appear OK on my all systems.

While somehow my task is accomplished but the issue remains unresolved and mysterious. Can't figure out is it Visio-2016 or Graphics driver or resolution or what.

thanks everyone for help

sunnyimran

  • Jr. Member
  • **
  • Posts: 52
Re: Text Box appear differently on different PC's
« Reply #18 on: April 25, 2020, 12:30:26 PM »
OK guys problem long ago, got caught
problem of text-box text overflow on different systems. problem found!

Recently I got exact same issue as in my first post. I have another text-box whose text appeared overflowed on another PC. both PC's got same version of visio and mostly similar configuration. In my original visio drawing, I used a font "Franklin Gothic Medium Cond" which was not available on my second PC. the substituted font on second PC was "Ebrima". I verified this issue by keeping everything exact same and by installing "Franklin Gothic Medium Cond" on my second PC and voila! the text didn't overflowed on second PC

Hence my finding:
The font I used in my original drawing was not available on my second PC and this font got substituted by some other font. It caused text to overflow because of certain settings like character spacing values working differently for different fonts.

To safeguard such issues I decided to do additional things to my shapes that contain  text:
1- Find out what fonts are used in my original drawing and make these fonts available on other PC's .
2- Reduce text-block left and right margins from default '4' to '2' or '0' in shapes that contain text.
3- Increase the 'width' of text-box a bit as far as it doesn't affect required design.

Thanks everyone for their suggestions.

Surrogate

  • Hero Member
  • *****
  • Posts: 1844
    • ShapeSheet™ Knowledge Base
Re: Text Box appear differently on different PC's
« Reply #19 on: April 26, 2020, 11:20:46 AM »
In ShapeSheet you can find Characters section, and there you can find Font cell. In this cell you can find integer as value. It is ID of font which is registred in PC's OS.
On different PC one font can have different font' ID!


If you want have desired font in shape write formula in font cell
Code
Guard(FONT("Arial"))
« Last Edit: April 28, 2020, 03:50:05 PM by Surrogate »

sunnyimran

  • Jr. Member
  • **
  • Posts: 52
Re: Text Box appear differently on different PC's
« Reply #20 on: April 27, 2020, 01:25:38 PM »
Thanks surrogate for the mention, I will give it a try.

something similar I have done using shapesheet is like this:
- get the required font index value and store it in a variable
          FontIndex = ActiveDocument.Fonts("Calibri").Index

- draw a shape and set its font to font index variable
          vsoShpRect.CellsSRC(visSectionCharacter, 0, visCharacterFont).FormulaU = FontIndex

and it is doing fine. Haven't worked on how I can check for a font's existence prior to creating shapes using my script.


wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4917
  • Ideas Visio-lized into solutions
Re: Text Box appear differently on different PC's
« Reply #21 on: April 27, 2020, 02:22:52 PM »
You could use the following macro to get all the fonts and their IDs on a page.  If you create an array to store the results, say using the ID as array index, you could step thru all pages, store results, and compare with each "current" search value to automatically eliminate duplications.

Code
Sub GetFontsUsed()
    Dim FontName As String
    Dim FontID As Integer
    Dim vShp as Visio.Shape
   
    For Each vshp In ActivePage.Shapes
        FontID = vshp.Cells("Char.Font").ResultStr(visNone)
        FontName = ActiveDocument.Fonts.ItemFromID(FontID)
        Debug.Print FontID & "   " & FontName
    Next
   
End Sub
Visio 2019 Pro

sunnyimran

  • Jr. Member
  • **
  • Posts: 52
Re: Text Box appear differently on different PC's
« Reply #22 on: May 01, 2020, 12:39:56 PM »
Thanks for the Macro, I will give it a try as soon as i get some time