Andrii Havrylyak
Andrii Havrylyak

Reputation: 675

How to change the font in the theme apex oracle 21

I have an application that is written in the apex oracle environment, but I want to change the font in this application (for example on "Calibri". I downlad this font: enter image description here

But I can't find how to do it. I also tried to Theme Roller the css in the topic with the help of this code, but it did not help. enter image description here

I will be grateful for the help.

Upvotes: 1

Views: 8126

Answers (1)

davidm
davidm

Reputation: 1750

Yes you can add your custom font to Oracle APEX by following the next steps (tried with .otf file not .ttf):

  1. Add the .otf file to your application Static Application Files (for example: your-custom-font.otf)

  2. Add an Application item called FONT

  3. Create an Application process:

  • Process Point: On Load: Before Header (page template header)
  • Code
begin
    :FONT := '<style type="text/css">
     @font-face {
      font-family: "DefaultFont";
      src: url(#APP_IMAGES#your-custom-font.otf);
    }
    body {
        font-family: "DefaultFont" !important;
    }

    .ui-widget {
       font-family: "DefaultFont" !important;
    }
   </style> ';
end;
  1. On every page where you want to use this custom font, on page level section HTML Header > HTML Header set the substitution string &FONT.

The described process is very helpful if you need different fonts for different users, but if all your users have the same font. Then you just need following Inline CSS to the page:

@font-face {
 font-family: "DefaultFont";
 src: url(#APP_IMAGES#your-custom-font.otf);
}
body {
   font-family: "DefaultFont" !important;
}

.ui-widget {
  font-family: "DefaultFont" !important;
}

Or for Calibri add this CSS:

body {
    font-family: Calibri, sans-serif !important;
}

Also when choosing font consider this.

Upvotes: 2

Related Questions