Add additional font size to dropdown

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Add additional font size to dropdown

Post by lidds »

Some of my customers are working on large paper size drawings e.g. A0 paper size. At the moment the smallest font size you can select from the font size dropdown is "8 pt", is there a way that I could add 7, 6, 5, 4, 3, 2 pt to the dropdown?

Thanks in advance

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add additional font size to dropdown

Post by Sasha - Tracker Dev Team »

Hi Simon,

A little illustration would help understanding what font size exactly are you referencing.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Willy Van Nuffel
User
Posts: 2384
Joined: Wed Jan 18, 2006 12:10 pm

Re: Add additional font size to dropdown

Post by Willy Van Nuffel »

I suppose it must be in the "Page Content Properties"-toolbar (Classic toolbars) or in the "Format"-ribbon (Ribbon UI), where the smallest value for the "Font Size" is "8 pt".

In case you like smaller values, you must type them manually.

Best regards.
Attachments
PDF-XChange Editor - Select Font Size 1.png
PDF-XChange Editor - Select Font Size 2.png
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Add additional font size to dropdown

Post by lidds »

Hi,

Yes this was the font size dropdown I was referring to. I know you can enter a smaller value in the text field, however I was to add the values to the dropdown so the user can select them.

Is something like this possible
viewtopic.php?f=66&t=31093

Thanks

Simon
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Add additional font size to dropdown

Post by lidds »

Is this possible?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add additional font size to dropdown

Post by Sasha - Tracker Dev Team »

Hello Simon,

Here's what I'm thinking. You can create a custom command handler as listener https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6
Then you will need the OnCreateNewCtl method, where you can obtain the overloaded IUIX_Obj control after you have called the same method of the old command handler. This object is a combo box - you should query the implementation of it and then just simply insert the needed values into it.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Add additional font size to dropdown

Post by lidds »

Hi Alex,

Working on customising the font size dropdown by implementing the custom commandhandler, which is all working, thanks for that. The only problem is that the font size dropdown width has reduced and you can see the font size you have selected.
fontDropdownSize.png
fontDropdownSize.png (8.13 KiB) Viewed 1582 times
I am using the following code:

Code: Select all

        Public Sub OnGetCtlSizes(pItem As IUIX_CmdItem, ByRef nSize As tagSIZE, ByRef nMinSize As tagSIZE, ByRef nMaxSize As tagSIZE) Implements IUIX_CmdHandler.OnGetCtlSizes
            If pItem.Cmd.ID = m_nFontSizeID Then
                m_OldFontSizeHandler.OnGetCtlSizes(pItem, nSize, nMinSize, nMaxSize)
            End If
        End Sub
Even if I try to increase the control size or min size, like below this has no effect.

Code: Select all

        Public Sub OnGetCtlSizes(pItem As IUIX_CmdItem, ByRef nSize As tagSIZE, ByRef nMinSize As tagSIZE, ByRef nMaxSize As tagSIZE) Implements IUIX_CmdHandler.OnGetCtlSizes
            If pItem.Cmd.ID = m_nFontSizeID Then
                nSize.cy = 400
                nMinSize.cy = 400
                m_OldFontSizeHandler.OnGetCtlSizes(pItem, nSize, nMinSize, nMaxSize)
            End If
        End Sub
Do you have any idea how to get around this?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Add additional font size to dropdown

Post by Sasha - Tracker Dev Team »

Hello Simon,

For starters, you should not change the height of the control, only the width. Also, try changing the values after you have called the m_OldFontSizeHandler.OnGetCtlSizes(pItem, nSize, nMinSize, nMaxSize) method as they are being rewritten inside.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: Add additional font size to dropdown

Post by lidds »

Hi Alex,

Don't know how I missed I was changing the height, not the width of the control, second set of eyes I guess 😁

Also setting the font values after the OnGetCtlSizes event worked, thanks for the help.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Add additional font size to dropdown

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply