nunocoracao / blowfish

Personal Website & Blog Theme for Hugo
https://blowfish.page
MIT License
1.35k stars 380 forks source link

🎏 Custom Chinese font setting Failed #1559

Open djl777 opened 2 months ago

djl777 commented 2 months ago

Problem description

I'm following https://blowfish.page/docs/advanced-customisation/#using-additional-fonts to set custom font. This is my dir structure.

And this is my custom.css.

However, the font does not change when I do things above. It seems like before.

The font I use is at https://github.com/lxgw/LxgwWenKai. I don't know if it's because it only contains Chinese fonts, so I tried another font https://github.com/lxgw/LxgwBright that includes both Chinese and English fonts, but there was still no change.

I also refer to https://github.com/chawyehsu/lxgw-wenkai-webfont but still failed.

So I ask for some help.

hugo v0.127.0 blowfish v2.71.0

Update 2024.6.25

Today I have tried changing English fonts, and it is successfully changed. So it seems like there's an issue with the Chinese fonts. I've tried many Chinese fonts but all failed. I am looking forward to an answer and reply. (I have already set hasCJKLanguage = true.)

You could see that English words(Hugo, 0x3f, blowfish...) are changed but chinese characters are not changed.

And this is my updated custom.css. font1 is Chinese font and font2 is English.

Fush1ch0u commented 1 month ago

This happened once when I was creating my blog using blowfish. I was wondering if this only happened when you choose the custom layout. I've tried to change the homepage layout to "background" and then it works.

image
djl777 commented 1 month ago

This happened once when I was creating my blog using blowfish. I was wondering if this only happened when you choose the custom layout. I've tried to change the homepage layout to "background" and then it works. image

I'm just using "background" layout. It seems to be an issue with the Chinese font. Could you recommend the Chinese font that you use?

Fush1ch0u commented 1 month ago

This happened once when I was creating my blog using blowfish. I was wondering if this only happened when you choose the custom layout. I've tried to change the homepage layout to "background" and then it works. image

I'm just using "background" layout. It seems to be an issue with the Chinese font. Could you recommend the Chinese font that you use?

In fact I'm using a Japanese font made by MODI but it also works well for both Chinese and English, here's the link: https://modi.jpn.org/font_irohamaru.php I just checked your blog and it looks like the fonts are displayed properly 😆

djl777 commented 1 month ago

This happened once when I was creating my blog using blowfish. I was wondering if this only happened when you choose the custom layout. I've tried to change the homepage layout to "background" and then it works. image

I'm just using "background" layout. It seems to be an issue with the Chinese font. Could you recommend the Chinese font that you use?

In fact I'm using a Japanese font made by MODI but it also works well for both Chinese and English, here's the link: https://modi.jpn.org/font_irohamaru.php I just checked your blog and it looks like the fonts are displayed properly 😆

The blog shows properly is because I have just rewrote the extend-head.html file, but I don't think it's a good solution as it would override the font contents of custom.css; therefore, I did not update the solution. 😰 image

Thanks for your recommendation!