Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter sg23838586

    (@sg23838586)

    Hey and thanks for checking this out.

    I am also no longer able to replicate the problem. Let’s close this and I shall make a new post if it happens again.

    Thread Starter sg23838586

    (@sg23838586)

    After hours I finally understood why this is happening 😁

    Since the fontFamily name is used directly in the CSS the fontFamily name must be enclosed in apostrophes (U+0027) like so: "fontFamily": "'Source Serif 4'" else it will read as Serif.

    This solved the problem. I guess this is indeed a flaw in the theme.json functionality, not this plugin.

    As for the “corrupted” TTF files, this was an issue caused by the font files having insufficient read rights in Windows. I am not sure why this happens, but I have a feeling it is because of how Wamp-server creates new files. Anyhow, it should not be a problem on a live site (I think)

    Thread Starter sg23838586

    (@sg23838586)

    Upon investigating I can see that once “Create Block Theme” has fetched the desired fonts from Google, the actual font files are just empty files. That is, they don’t contain any data if I open them in a text editor. Is that how it’s supposed to be? In my mind one should see a bunch of binary data.

    Also, regarding the slug name, is that an issue with the plugin or WordPress core code?

    Thread Starter sg23838586

    (@sg23838586)

    Also, note that Source Serif 4 looks like this on my computer: https://imgur.com/a/alWzpd0, but only in Firefox, not Edge…

    Thread Starter sg23838586

    (@sg23838586)

    If I change the fontFamily slug in theme.json from Source Serif 4 to BananaFont everything works as it should. 🤯 WTH!!!

    • This reply was modified 3 years ago by sg23838586.
    • This reply was modified 3 years ago by sg23838586.
    Thread Starter sg23838586

    (@sg23838586)

    Thanks for such a quick response!

    I can see that the fonts have been successfully added to the manage fonts section.

    Here is a video recording (a bad one sorry 😅): https://imgur.com/lvcxGXx

    theme.json looks like this:

    {
    	"$schema": "https://schemas.wp.org/wp/6.2/theme.json",
    	"settings": {
    		"appearanceTools": true,
    		"layout": {
    			"contentSize": "620px",
    			"wideSize": "1000px"
    		},
    		"spacing": {
    			"units": [
    				"%",
    				"px",
    				"em",
    				"rem",
    				"vh",
    				"vw"
    			]
    		},
    		"typography": {
    			"fontFamilies": [
    				{
    					"fontFamily": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
    					"name": "System Font",
    					"slug": "system-font"
    				},
    				{
    					"fontFamily": "Source Serif 4",
    					"slug": "source-serif-4",
    					"fontFace": [
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "200",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_200.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "300",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_300.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "400",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_400.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "500",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_500.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "600",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_600.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "700",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_700.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "800",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_800.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "normal",
    							"fontWeight": "900",
    							"src": [
    								"file:./assets/fonts/source-serif-4_normal_900.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "200",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_200.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "300",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_300.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "400",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_400.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "500",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_500.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "600",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_600.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "700",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_700.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "800",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_800.ttf"
    							]
    						},
    						{
    							"fontFamily": "Source Serif 4",
    							"fontStyle": "italic",
    							"fontWeight": "900",
    							"src": [
    								"file:./assets/fonts/source-serif-4_italic_900.ttf"
    							]
    						}
    					]
    				}
    			]
    		}
    	},
    	"templateParts": [
    		{
    			"area": "header",
    			"name": "header"
    		},
    		{
    			"area": "footer",
    			"name": "footer"
    		}
    	],
    	"version": 2
    }

    However, the fonts seem to be corrupted. If I try to open the TTF files on Windows I get an error saying:

    ---------------------------
    Windows Font Viewer 
    ---------------------------
    The requested file C:\wamp64\www\thebananasite\wp-content\themes\cloudberry\assets\fonts\source-serif-4_normal_400.ttf is not a valid font file. 
    ---------------------------
    OK   
    ---------------------------

    Other fonts (such as Inter) work. That is, I can see them load in DevTools and they appear to load fine. But I also get the “is not a valid font file” for Inter.

    It’s very confusing because if I save the font from DevTools, the font will open correctly in Windows. But if I try to open a newly downloaded font from this plugin in Windows I get the “ttf is not a valid font file” message.

    Perhaps it is best to ignore the “ttf is not a valid font file” for now. I don’t think it has anything to do with the font not displaying.

    • This reply was modified 3 years ago by sg23838586.
    • This reply was modified 3 years ago by sg23838586.
    Thread Starter sg23838586

    (@sg23838586)

    Hi Matias,

    That’s the thing, I don’t have an error since the font is not loaded in the site rendering. There is no loading of any font whatsoever. It just uses the browser font instead.

    Perhaps you can try to see if Source Serif 4 works in any of your themes?

    If I make an empty new theme using this plugin and add Source Serif 4, nothing happens, even after selecting Source Serif 4 as the text font in the FSE.

    Thread Starter sg23838586

    (@sg23838586)

    Thanks! I wouldn’t have made it without you.

    It seems to work 👍

    Thread Starter sg23838586

    (@sg23838586)

    Thanks for a super fast response 😀

    I am trying to add Source Sans Pro. I have managed to add a child theme, and I have added all the TTF files to beaumont-child\assets\fonts:

    SourceSerifPro-Black.ttf
    SourceSerifPro-BlackItalic.ttf
    SourceSerifPro-Bold.ttf
    SourceSerifPro-BoldItalic.ttf
    SourceSerifPro-ExtraLight.ttf
    SourceSerifPro-ExtraLightItalic.ttf
    SourceSerifPro-Italic.ttf
    SourceSerifPro-Light.ttf
    SourceSerifPro-LightItalic.ttf
    SourceSerifPro-Regular.ttf
    SourceSerifPro-SemiBold.ttf
    SourceSerifPro-SemiBoldItalic.ttf

    I have made a new empty theme.json file, but I am not sure how to add all these fonts to the theme.json file.

    The theme.json file in Beaumont is huge. Do you really write all that by yourself? 😵

    Is there an easy way to add Google Fonts to this theme? I love it, but the fonts are quite limited.

    Thread Starter sg23838586

    (@sg23838586)

    I am thinking I might have to switch to Jetpack markdown or Jekyll…

    I know WordPress is trying to “aid me” and make it easier, but it is not easier when WordPress just assumes what you want instead of asking what I want.

    Is there any way to style the embeds in a theme so I can remove “embedd style”?

    Thread Starter sg23838586

    (@sg23838586)

    Clicking “Convert to link” is not a solution at all. First of all, it is extremely inconvenient to click on “Convert to link” for each link if you have many links. Second, if the link is actually “embeddable” and is embedded, there is no option to turn the link back to an a href so you are stuck.

    Pasting the text without a line break is also not a good solution because each link will be added as plain text but without the href tag. This means you will have to add the link to each line manually. Also for some strange reason, WordPress adds a space to the beginning o each link so you will have to edit that too every time.

    I was honestly very excited for WP blocks, but with problems like this, I am considering switching to Jekyll or Ghost instead.

    I know you are only trying to help and thanks for giving advice. But I think problems as these should be acknowledged and fixed. I have been using WordPress since 2010 and I loved it. Now I can’t stand it…

    • This reply was modified 6 years, 8 months ago by sg23838586.
    • This reply was modified 6 years, 8 months ago by sg23838586.
    • This reply was modified 6 years, 8 months ago by sg23838586.
    Thread Starter sg23838586

    (@sg23838586)

    Well, that is just absolutely tragic. I am amazed. I have no words… Thanks, WP for taking away basic functionality.

    Thread Starter sg23838586

    (@sg23838586)

    Yes I want to paste in 20 links, plain text, no embedding. Although I do not mind if the links are transformed to links.

Viewing 14 replies - 1 through 14 (of 14 total)