@@ -39,7 +39,7 @@ data class EditorTheme(
3939 blockEditorSettings.gradients,
4040 null ,
4141 blockEditorSettings.styles?.toString(),
42- blockEditorSettings.features ?.toString(),
42+ blockEditorSettings.featuresFiltered ?.toString(),
4343 blockEditorSettings.isBlockBasedTheme,
4444 blockEditorSettings.galleryWithImageBlocks,
4545 blockEditorSettings.quoteBlockV2,
@@ -83,7 +83,25 @@ data class BlockEditorSettings(
8383 @SerializedName(" __experimentalFeatures" ) val features : JsonElement ? ,
8484 @JsonAdapter(EditorThemeElementListSerializer ::class ) val colors : List <EditorThemeElement >? ,
8585 @JsonAdapter(EditorThemeElementListSerializer ::class ) val gradients : List <EditorThemeElement >?
86- )
86+ ) {
87+ val featuresFiltered: JsonElement ?
88+ get() = features?.removeFontFamilies()
89+
90+ private fun JsonElement.removeFontFamilies (): JsonElement {
91+ if (isJsonObject && asJsonObject.has(" typography" )) {
92+ val featuresObject = asJsonObject
93+ val typography = featuresObject.get(" typography" )
94+ if (typography.isJsonObject) {
95+ val typographyObject = typography.asJsonObject
96+ if (typographyObject.has(" fontFamilies" )) {
97+ typographyObject.remove(" fontFamilies" )
98+ return featuresObject
99+ }
100+ }
101+ }
102+ return this
103+ }
104+ }
87105
88106data class EditorThemeSupport (
89107 @JsonAdapter(EditorThemeElementListSerializer ::class )
0 commit comments