Visio Guy

Visio Discussions => Visio 2016 Issues => Topic started by: sunnyimran on September 26, 2019, 03:09:19 AM

Title: Text Box appear differently on different PC's
Post by: sunnyimran on September 26, 2019, 03:09:19 AM
Hi there,

I am having a strange problem when viewing a Visio file, page-1, textbox on two different PC's they appear differently

There is a textbox with text in it on first page of Visio. When opening Visio file on PC1 it appears OK. On PC2 the text scrolls out of the box from down side  and text lines wraps down from right side of the textbox. I have same version of Visio-2016 on both PC's.

I have tried to compare all possible settings, options, selections like paragraph spacing, box margins etc. in Visio and found same on both PCs. Also I have tried various display settings etc. in both PC's . I can not figure it out what could be the reason.

Problem is not only in viewing but also in printing same Visio page. It prints differently from PC1 and PC2. it prints as it appears on screen.

PC-1 Text Box appear OK
Dipslay resolution:         1366 X 768 (Recommended)
Change the size of text, apps...   100%

PC-2 Text Box does not appear OK
Dipslay resolution:         1600 X 900 (Recommended)
Change the size of text, apps...   125%

Two screenshots attached

Please tell your idea where could be the difference?
Title: Re: Text Box appear differently on different PC's
Post by: Yacine on September 26, 2019, 03:49:23 AM
It's only a tweak, but you may try to set the font size in length units (inches or millimeters) instead of points (pt.).
Title: Re: Text Box appear differently on different PC's
Post by: wapperdude on September 26, 2019, 09:24:17 AM
Have you tried setting g screen resolution of PC1 to be same as PC2?

Another thing to try, change the page scale factor.  Default is 1 to 1, no explicit dimensions.  Try 1 inch = 1 inch.

Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran on October 11, 2019, 05:54:52 AM
Well, thanks

I have tried and compared everything between PC1 and PC2. Even tested same screen resolution, even swapped monitors but no avail.

I did try setting font units as on PC2 (where Text does not appear ok)
Actual setting on PC1 and PC2:            Textbox -> shapesheet -> Character -> Size -> 36 pt
New setting on PC2:                            Textbox -> shapesheet -> Character -> Size -> 12.7 mm
But text appears as before, that is it flows out of the box.

But I did found that if I do anything like (in Pt or in mm doesn't matter):
- reducing font size
- reducing 'line spacing' value
- reducing 'paragraph spacing After' value
- reducing 'Character Spacing' value

It does solve the matter but then my text does not have same dimensions as required.

OK so finally I have decided to reduce
         'character spacing = expanded by 2pt'
         'character spacing = expanded by 1.5pt'

This fits the text in its box and appears correct on PC2. This also changes my actual text dimensions on PC1 but I have to accept it.

Now the problem is:
I have generated 7,000 VSDX files using VBA which have text overflow problem on PC2 but ok on PC1
Further 18,000 VSDX files will be generated after I alter the 'character spacing' value that would be OK on PC2 and PC1 both.

Q. Is there a possible way to alter 'character spacing = expanded by 1.5pt' of those previously generated 7,000 VSDX files?

Please suggest




Title: Re: Text Box appear differently on different PC's
Post by: wapperdude on October 11, 2019, 08:43:17 AM
You indicate you swapped monitors, but the problem remained with the PC.  That is, it didn't track with the monitors.  Not expected.  Have you tried upgrading the video drivers?

Also, can you upload a misbehaving shape?  That way there can be a wider sample base.  Perhaps easier solution???
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran on October 12, 2019, 01:11:45 AM
I have played with monitor drivers on PC2. Actually PC2 is just one of the others from where my VSDX files will be printed. It prints as it appears on screen on the PC from where it is printed. At the moment Textbox appears correct only on PC1 so I am utilizing PC1 for printing too beside other tasks.

Yes I have swapped monitors too

Image samples are attached in my first post.
Title: Re: Text Box appear differently on different PC's
Post by: wapperdude on October 12, 2019, 08:19:12 AM
No Visio upload?
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran on October 14, 2019, 04:16:34 AM
Here is the Visio 2016 VSDX file attached having pages with problem Text box only

Still waiting for answer
Q. Is there a cure for already generated 7,000 VSDX before continuing to next 18,000 files?

Title: Re: Text Box appear differently on different PC's
Post by: Nikolay on October 14, 2019, 07:04:09 AM
Just a thought, maybe the set of fonts is different on these PCs?
So the font you used to create these diagrams on PC1 is not installed on PC2 (and gets substituted using the "best match" which may have slightly different sizes)
Title: Re: Text Box appear differently on different PC's
Post by: Yacine on October 14, 2019, 10:54:46 AM
Could you leave some of the shapes in the drawing? Just to check how they are formatted  and to evaluate the effort of modifying them.
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran on October 14, 2019, 12:53:34 PM
Just a thought, maybe the set of fonts is different on these PCs?
So the font you used to create these diagrams on PC1 is not installed on PC2 (and gets substituted using the "best match" which may have slightly different sizes)

Compared almost all configuration on both PC's and they are the same. Screenshots of TextBox properties in Visio is attached
Title: Re: Text Box appear differently on different PC's
Post by: wapperdude on October 14, 2019, 07:31:11 PM
I see the same problem when viewed on my PC.   It looks like the font is too large @ 36 pt.  Fits fine at 30 pt.  Is that font available on both PC's?
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran on October 15, 2019, 07:57:21 AM
Yes the font is installed at both PC's. One more test I have done is I have copied all fonts of PC1 the correct PC to PC2 but no avail.

I observed if I alter character spacing:
On PC2 (incorrect text):
       Character spacing : 'Expanded'    By: 2pt
change to:
      Character spacing : 'Expanded'    By: 1.5pt

Then text fits inside its box correctly. This will resolve problem for future 18,000 VSDX files that I will produce. The problem is for already produced 7,000 VSDX files. How I remedy them?





Title: Re: Text Box appear differently on different PC's
Post by: Surrogate on October 15, 2019, 08:05:34 AM
You could create these over9000 vsdx-documents. Try these steps:
1. Iterate each document
2. In each document iterate each shape
3. If shape have expanded text, you need change it to 'right' characters space.

Title: Re: Text Box appear differently on different PC's
Post by: wapperdude on October 15, 2019, 10:42:12 AM
As Surrogate indicates, some code to go thru documents, pages, shapes.  But, you might be able to merely change the spacing on all shapes instead of just the problem shapes.   It's not a big change.  The other possibilities include (a) reducing left/right margins if not already set to zero, (b) reducing the font size slightly.  Option (A) is poosibly moreg global.  Option (B) would be restricted to sit h Dr the font style or, more likely, the troublesome shape.
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran 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


Title: Re: Text Box appear differently on different PC's
Post by: vojo 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)
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran 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
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran 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.
Title: Re: Text Box appear differently on different PC's
Post by: Surrogate 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!
(https://i.ibb.co/WVGrgrB/image.png)

If you want have desired font in shape write formula in font cell
Code
Guard(FONT("Arial"))
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran 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.

Title: Re: Text Box appear differently on different PC's
Post by: wapperdude 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
Title: Re: Text Box appear differently on different PC's
Post by: sunnyimran 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