likemike Posted April 11, 2021 Share Posted April 11, 2021 Hello! I'm using the font Tahoma in different sizes (depending on the resolution of the frontend device). In Delphi it looks like this: But on all devices it looks like this: The font with size 16 is much too small in comparison to the other font-sizes. Any idea, what is reponsible for that behaviar and how to fix it? Best regards Mike Link to comment Share on other sites More sharing options...
Sherzod Posted April 11, 2021 Share Posted April 11, 2021 14 minutes ago, likemike said: The font with size 16 is much too small in comparison to the other font-sizes. Any idea, what is reponsible for that behaviar and how to fix it? Hello, How can we reproduce this issue? Please provide more information. Link to comment Share on other sites More sharing options...
likemike Posted April 11, 2021 Author Share Posted April 11, 2021 That's quite easy. You can use any of your demos and add 5 labels with font sizes 20, 19,18,17,16. As an example I add the Form-Controls-Demo which is modified (5 labels are added).FormControls.rar I've tried it with different devices (Tablet, Desktop...) and different browsers (Chrome, Edge, Safari). Link to comment Share on other sites More sharing options...
Sherzod Posted April 12, 2021 Share Posted April 12, 2021 13 hours ago, likemike said: That's quite easy. You can use any of your demos and add 5 labels with font sizes 20, 19,18,17,16. As an example I add the Form-Controls-Demo which is modified (5 labels are added).FormControls.rar I've tried it with different devices (Tablet, Desktop...) and different browsers (Chrome, Edge, Safari). Can you try this approach for now?: UniMainModule -> OnNewComponent event procedure TUniMainModule.UniGUIMainModuleNewComponent(AComponent: TComponent); begin if (AComponent is TUnimLabel) then (AComponent as TUnimLabel).JSInterface.JSConfig('style', [(AComponent as TUnimLabel).Font.ToString(True, False, True)]); end; Link to comment Share on other sites More sharing options...
likemike Posted April 12, 2021 Author Share Posted April 12, 2021 This seems to work - but I have the same problem with TUnimMemo, so I've tried the same code: if (AComponent is TUnimMemo) then (AComponent as TUnimMemo).JSInterface.JSConfig('style', [(AComponent as TUnimMemo).Font.ToString(True, False, True)]); But this won't work. Why? Link to comment Share on other sites More sharing options...
Sherzod Posted April 12, 2021 Share Posted April 12, 2021 I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted April 13, 2021 Share Posted April 13, 2021 15 hours ago, likemike said: but I have the same problem with TUnimMemo procedure TUniMainModule.UniGUIMainModuleNewComponent(AComponent: TComponent); begin if (AComponent is TUnimLabel) then (AComponent as TUnimLabel).JSInterface.JSConfig('style', [(AComponent as TUnimLabel).Font.ToString(True, False, True)]) else if (AComponent is TUnimMemo) then (AComponent as TUnimMemo).JSInterface.JSAddListener('painted', 'function(me){me.inputElement.applyStyles('''+ (AComponent as TUnimMemo).Font.ToString(True, False, True) +'''); me.inputElement.setStyle("line-height", me.inputElement.getStyle("font-size"));}'); end; Link to comment Share on other sites More sharing options...
likemike Posted April 13, 2021 Author Share Posted April 13, 2021 That works, but I think, I'll never be able to solve those things by myself 😞 Link to comment Share on other sites More sharing options...
Recommended Posts