none
Iterating through PowerPoint.Presentation.Fonts very slow if any fonts are not installed RRS feed

  • Question

  • If I iterate through .Fonts of a Presentation and all fonts are installed in Windows then this completes quickly. If any font is not installed it can takes several seconds per font to step through this collection.

    Can anyone explain this behaviour and is there any way to mitigate it.

    Thanks in advance,

    Dave

    ps PowerPoint 2010

    Tuesday, November 3, 2015 11:23 PM

All replies

  • Hi Dave,

    >> Iterating through PowerPoint.Presentation.Fonts very slow if any fonts are not installed
    I am not sure whether they are related. I made a test with your description, but I failed to reproduce your issue. I delete the “Agency FB” font, and use the code below to loop Fonts, it worked very fast.

    Sub test()
        For Each Item In ActivePresentation.Fonts
            Debug.Print Item.Name
        Next
    End Sub
    //result
    Microsoft YaHei UI
    Calibri
    +mn-lt
    Agency FB

    It would be helpful if you could share us details steps to reproduce your issue. Are they in the same PC? If you install all the fonts in the slow pc, will it work fast?

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, November 4, 2015 3:26 AM
  • Thanks Edward for taking a look. I found and installed the missing fonts and ran your code with a stopwatch. It seems to be no quicker.

    Timings for a full loop gives me these results:

    A 27 slide presentation with 4 fonts, 1 of which is not installed = 275ms

    A 14 slide presentation with 2 fonts, all installed = 145ms

    A 16 slide presentation with 6 fonts, 5 not installed = 11519ms

    A 16 slide presentation with 6 fonts, all installed = 11400ms

    So perhaps there is something peculiar about that last presentation. I can't share it here at it might contain sensitive information. Email me at dave @ irisdown.co.uk and I will give you a download link.

    These fonts are also not showing up in InstalledFontCollection and have extension .otf

    Many thanks

    Dave

    Wednesday, November 4, 2015 2:36 PM
  • Hi Dave,

    How did you get exact timings? In your test, are the presentation same? It seems not, I suggest you test the same presentation with fonts installed or not.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, November 6, 2015 6:24 AM