chargebee / chargebee-js-wrappers

25 stars 10 forks source link

Vue wrapper custom font using url src not working #138

Open mcelligottnick opened 1 year ago

mcelligottnick commented 1 year ago

Following the example here, part of my component configuration looks like;

fonts: [
    {
        src: 'https://MYPUBLICURL/Poppins-Regular.woff',
        fontStyle: 'normal',
        fontFamily: 'Poppins',
        fontWeight: '400',
    },
    {
        src: 'https://MYPUBLICURL/Poppins-Bold.woff',
        fontStyle: 'normal',
        fontFamily: 'Poppins',
        fontWeight: '700',
    },
],

However when the component loads the font does not work. If I change the above to;

fonts: [
    {
        src: 'https://MYPUBLICURL/Poppins-Regular.woff',
        fontStyle: 'normal',
        fontFamily: 'Poppins',
        fontWeight: '400',
    },
    {
        src: 'https://MYPUBLICURL/Poppins-Bold.woff',
        fontStyle: 'normal',
        fontFamily: 'Poppins',
        fontWeight: '700',
    },
        'https://fonts.googleapis.com/css?family=Poppins',
],

I do see the Poppins font correctly.

If I visit https://MYPUBLICURL/Poppins-Regular.woff in an incognito browser it downloads the font as expected.

cb-dinesh commented 1 year ago

Hi @mcelligottnick For security reasons, we do not support custom font URLs.

mcelligottnick commented 1 year ago

@cb-dinesh alright thanks mate, you should remove it from the docs then.

damyco commented 1 year ago

Hi @mcelligottnick For security reasons, we do not support custom font URLs.

Please remove this from the docs for React too, I wasted a lot of time because of this...