From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing fonts

Hi all,

 

New to the forum and looking for help.

 

The company I work for is changing it logo/font. This means we have to go through our calibration sheets and change the font. So far so good. Problem is, we have aprox. 300 calibration sheets in Diadem. Each has several textboxes/graphs/tables and doing it by hand is quite the challenge. They do not share the same layout, so some kind of script to change them will not work. 

 

Does anybody have a good idea how to change the font for the entire report? Talked to NI support and they did not have a fix-all solution.

Any help or suggestion is appreciated.

 

Best Regards,

Morten

0 Kudos
Message 1 of 7
(3,188 Views)

Hi Morten,

Have you tried this?

Report.Settings.DefaultFontType = eDefaultFontTypeOwn
Report.Settings.DefaultFontName = "Times New Roman"
call Report.Refresh()

This only works if all of your fonts are set to default.

But then you can change everything at once with these commands.

Christian
CLA, CTA, CLED
0 Kudos
Message 2 of 7
(3,176 Views)

As TDR Report files are XML files you could also try to parse and replace every occurrence in the file

For example replace all "Arial" with "Times New Roman".

I tested this for a very simple TDR file and it worked.

But I'm not sure if there are any disadvantages when doing it like this.

For sure I cannot officially recommend this but as a workaround it could be ok.

Christian
CLA, CTA, CLED
0 Kudos
Message 3 of 7
(3,170 Views)

If you have special computer dedicated only for doing graphs in DIAdem, the other workaround would be, to replace the fonts with new ones and keep the same names as the old ones. So, you don't have to change anything. Maybe it's stupid containment, but if you are not using those fonts for anything else, could be the fastest fix.

0 Kudos
Message 4 of 7
(3,153 Views)

Hi,

 

Thanks for the suggestion. I was looking at that solution, but there is some problems. 

 

In the report I'm testing uses "Verdana" as the font. When I search through the TDR there is no mention of Verdana. However, I can find "Times New Roman" and "Arial". If I change these to the new font "Rubik" nothing happens in the report, it's still "Verdana".

Now comes the added problem: If I change the fonts manually in Diadem from "Verdana" to "Rubik", the TDR file now has "Rubik" in the spots where there use to be "Times New Roman" or "Arial". 

 

It seems to me that the report is settings the fonts in some other way until I change it manually.

 

Suggestions?

0 Kudos
Message 5 of 7
(3,145 Views)

I was trying the same with a twist. I tried to uninstall all other fonts exept the one I need. Open the reports and see if they defaulted to the only font available and then save them.

Problem is that there are a lot of system fonts that cannot be removed and DIAdem will probably default to times new roman or some other system font.

 

I like the idea, but we have a lot of computers running Diadem and changing the underlying font will give rise to uncertanties, especially if the computers are upgraded and someone forgets to do the font-hack.

0 Kudos
Message 6 of 7
(3,142 Views)

Hi Morton,

 

I would prefer to have script, changing the fonts of each object on each REPORT page. I created an example starting with a few objects. I hope this will help.

dim iLoopS, iLoopO, i
dim oCurrSheet, oCurrObject

for iLoopS = 1 to Report.Sheets.Count
  set oCurrSheet = Report.Sheets(iLoopS)
  for iLoopO = 1 to oCurrSheet.Objects.Count
    set oCurrObject = oCurrSheet.Objects(iLoopO)
  
    select case oCurrObject.ObjectType
      case eReportObject2DAxisSystem
        oCurrObject.XAxis.Label.Font.Name = "Arial"
        oCurrObject.YAxis.Label.Font.Name = "Arial"
        for i = 1 to oCurrObject.YAxisList.Count
          oCurrObject.YAxisList(i).Label.Font.Name = "Arial"
        next
      case eReportObject2DTable 
        for i = 1 to oCurrObject.Columns.Count
          oCurrObject.Columns(i).Settings.Font.Name = "Arial"
        next
      case eReportObjectPolarSystem 
      case eReportObject3DAxisSystem  
      case eReportObject3DTable 
      case eReportObjectText
        oCurrObject.Font.Name = "Arial"
      case eReportObjectFrame 
      case eReportObjectImage 
      case eReportObjectRTFText 
      case eReportObjectArrow  
      case eReportObjectComment 
      case eReportObjectCircle  
      case eReportObjectFormulaDisplay  
    end select
  next
next

Greetings

Walter

0 Kudos
Message 7 of 7
(3,130 Views)