Recent

Author Topic: [OK]LAMW : custom font in actionbar  (Read 2619 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 497
[OK]LAMW : custom font in actionbar
« on: April 15, 2017, 07:45:13 pm »
Hi
how can i use custom font in tabs of actionbar?
« Last Edit: April 20, 2017, 02:56:15 pm by majid.ebru »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: LAMW : custom font in actionbar
« Reply #1 on: April 15, 2017, 08:19:57 pm »

I will try some solution!

good suggestion!

Thank you!
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

jmpessoa

  • Hero Member
  • *****
  • Posts: 2301
Re: LAMW : custom font in actionbar
« Reply #2 on: April 16, 2017, 05:48:27 am »

Solution: you need make a "custom" tab view

1) drag and drop  a jPanel  on jForm     [ex. jPanel5]
2) drag and drop  a jTextView  on jPanel  [ex. jTextView4]

configure as here:
Code: Pascal  [Select][+][-]
  1.   object jPanel5: jPanel
  2.     MarginLeft = 0
  3.     MarginTop = 0
  4.     MarginRight = 0
  5.     MarginBottom = 0
  6.     Visible = False
  7.     LayoutParamWidth = lp96px
  8.     LayoutParamHeight = lpWrapContent
  9.     BackgroundColor = colbrDefault
  10.     object jTextView4: jTextView
  11.       Visible = True
  12.       PosRelativeToAnchor = []
  13.       PosRelativeToParent = [rpCenterVertical]
  14.       LayoutParamWidth = lpWrapContent
  15.       LayoutParamHeight = lpWrapContent
  16.       Text = 'CUSTOMFONT'
  17.       FontColor = colbrWhite
  18.       FontSize = 12
  19.     end
  20.   end
  21.  

3) Put a custom [bold] font in your  project folder "...\assets"

4) draft code:

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3.  
  4.     ..........................
  5.     //prepare custom tab view - jPanel5
  6.     jTextView4.SetFontFromAssets('MyCustomBoldFont.trf');  
  7.     jPanel5.MatchParent();
  8.     jActionBarTab1.Add('CUSTOM', jPanel4.View{sheet view}, jPanel5.View {custom tab view!});
  9.     ....................
  10.  
  11. end;
  12.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

majid.ebru

  • Sr. Member
  • ****
  • Posts: 497
Re: LAMW : custom font in actionbar
« Reply #3 on: April 17, 2017, 10:20:45 am »
Thank you :-*

 

TinyPortal © 2005-2018