Hello Avijit,

You would ideally use an additional TTF file when you wish to generate PDF
files or create Desktop applications.

If you wish to use additional TTF file to generate PDF file then I will
recommend you to look for fop.properties
file(OFBIZ_HOME/framework/webapp/config/fop.properties)
Please also refer following location where additional 'NotoSans' font
specific files are present:
OFBIZ_HOME/framework/resources/fonts

Also refer to the following content from file -
OFBIZ_HOME/applications/content/widget/CommonScreens.xml:
Here you can see how the fop property "fop.font.family" is being read from
the fop.properties file.
You can easily find alternatives to read these properties in Java code.

<screen name="fonts.fo">
    <section>
        <actions>
            <property-to-field resource="fop.properties"
field="defaultFontFamily" property="fop.font.family"
default="NotoSans" />
        </actions>
        <widgets>
            <platform-specific>
                <xsl-fo><html-template
location="component://content/template/Fonts.fo.ftl"/></xsl-fo>
            </platform-specific>
        </widgets>
    </section>
</screen>

If you are following this path then you will be able to build a platform
independent application, just put your TTF file inside OFBiz file system
and use it. Else you need to do adjustments while deploying your
application in Windows/Linux/MacOS.

The reference link shared by Jacques is also a very important one.

--
Kind Regards,
Ashish Vijaywargiya
Vice President of Operations
*HotWax Systems*
*Enterprise open source experts*
http://www.hotwaxsystems.com



On Wed, Jun 22, 2022 at 7:46 PM Avijit Bose <[email protected]> wrote:

> This might be helpful to others.
>
> Ofbiz is taking fonts from "c:\windows\fonts" folder so as all the
> browsers. To change fonts in any ofbiz theme, change your fonts in
>
> body, textarea, input, select {
>     font-family: Quicksand, Verdana, Arial, Helvetica, sans-serif;
> }
>
> in the "style.css" file of the respective theme.
>
> And put the font files (*.TTF) in the "c:\windows\fonts" folder. Restart
> OFBIZ.
>
> regards
> Avijit
>
>
>
> On Wed, Jun 22, 2022 at 1:02 PM Jacques Le Roux <
> [email protected]> wrote:
>
> > Hi Avijit,
> >
> > I'm very bad at CSS but Mozilla team is not:
> > https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
> >
> > Jacques
> >
> > Le 22/06/2022 à 06:38, Avijit Bose a écrit :
> > > Referring to my previous mail.... I have found out a piece of css code
> in
> > > the following file...
> > >
> > > OFBIZ_HOME/themes/flatgrey/webapp/flatgrey/style.css
> > >
> > > body, textarea, input, select {
> > >      font-family: Quicksand, Verdana, Arial, Helvetica, sans-serif;
> > > }
> > >
> > > Question: from where ofbiz is picking up the above mentioned font
> > families?
> > > Is it taking from the windows OS (system) which are already installed?
> > >
> > > Comments: If it takes from the system, then one can install any fonts
> in
> > > the windows system and ofbiz is supposed to pick up that specific font,
> > if
> > > it is mentioned in the above css code. Am I thinking correctly?
> > >
> > > Pls let us know.
> > >
> > > regards
> > > Avijit
> > >
> > > On Tue, Jun 21, 2022 at 12:09 PM Avijit Bose <[email protected]>
> > wrote:
> > >
> > >> Dear Sir,
> > >>
> > >> I am making an app in Ofbiz. I need to change the font of the whole
> app.
> > >>
> > >> If I change in (OFBIZ_HOME/themes/flatgrey/webapp/flatgrey/style.css),
> > >> then where will I put the font  .TTF files. Example like:
> > "Roboto-Light.ttf"
> > >>
> > >> regards
> > >> Avijit
> > >>
> > >> On Tue, Jun 21, 2022 at 12:02 PM Ashish Vijaywargiya <
> > >> [email protected]> wrote:
> > >>
> > >>> Hello Avijit,
> > >>>
> > >>> What are you trying to do? Can you please provide additional details?
> > >>>
> > >>> Apache OFBiz is a theme driven project and there are a few themes
> that
> > are
> > >>> available out of the box(OOTB).
> > >>>
> > >>> Please refer: OFBIZ_HOME/themes folder. Here you can see the
> style.css
> > >>> file
> > >>> present inside a
> > >>> flatgrey theme(OFBIZ_HOME/themes/flatgrey/webapp/flatgrey/style.css).
> > Same
> > >>> style.css file is also present in other themes as well.
> > >>>
> > >>> --
> > >>> Kind Regards,
> > >>> Ashish Vijaywargiya
> > >>> Vice President of Operations
> > >>> *HotWax Systems*
> > >>> *Enterprise open source experts*
> > >>> http://www.hotwaxsystems.com
> > >>>
> > >>>
> > >>>
> > >>> On Tue, Jun 21, 2022 at 10:59 AM Avijit Bose <[email protected]>
> > >>> wrote:
> > >>>
> > >>>> Hi,
> > >>>>
> > >>>> Pls let me know how a different font could be used in ofbiz and
> where
> > to
> > >>>> put the files.
> > >>>>
> > >>>> regards
> > >>>> Avijit
> > >>>>
> >
>

Reply via email to