0

我有以下生成的 ANF 文档:

{
  "version": "0.10.13",
  "identifier": "http://test.domain.com?p=123456",
  "title": "Test Apple News Post",
  "language": "en",
  "layout": {
    "columns": 7,
    "width": 1024
  },
  "components": [
    {
      "text": "Test Apple News Post",
      "role": "title",
      "layout": {
        "margin": {
          "bottom": 30
        }
      }
    },
    {
      "text": "# Heading 1\n\n## HEADING 2\n\n### Heading 3\n\n#### Heading 4\n\n##### Heading 5\n\n###### Heading 6",
      "format": "markdown",
      "role": "body",
      "layout": "bodyLayout"
    }
  ],
  "componentTextStyles": {
    "default": {
      "linkStyle": {
        "textColor": "#DF0033"
      },
      "fontName": "Georgia",
      "fontSize": 12
    },
    "default-title": {
      "fontName": "Georgia-Bold",
      "fontSize": 24
    },
    "default-heading": {
      "fontName": "Georgia-Bold",
      "fontSize": 24
    },
    "default-heading1": {
      "fontName": "Georgia-Bold",
      "fontSize": 24
    },
    "default-heading2": {
      "fontName": "DINCondensed-Bold",
      "fontSize": 18
    },
    "default-heading3": {
      "fontName": "Georgia-Bold",
      "fontSize": 22,
      "textColor": "#FF0000"
    },
    "default-heading4": {
      "fontName": "Georgia-Bold",
      "fontSize": 20,
      "textColor": "#00FF00"
    },
    "default-heading5": {
      "fontName": "Georgia-Bold",
      "fontSize": 18,
      "textColor": "#0000FF"
    },
    "default-heading6": {
      "fontName": "Georgia-Bold",
      "fontSize": 16,
      "textColor": "#FF00FF"
    }
  },
  "metadata": {
    "datePublished": "2016-06-06T04:25:34+00:00",
    "dateCreated": "2016-06-06T04:25:34+00:00",
    "dateModified": "2016-06-27T01:05:27+00:00",
    "canonicalURL": "http://test.domain.com?p=123456",
    "thumbnailURL": "http://dummyimage.com/1000x500/000/ffffff&text=Apple+News+Image+1",
    "keywords": [
      "tag1",
      "tag2",
      "tag3"
    ],
    "excerpt": "This is the excerpt text, woo!"
  },
  "componentLayouts": {
    "bodyLayout": {
      "columnStart": 0,
      "columnSpan": 7,
      "margin": {
        "bottom": 15
      }
    }
  }
}

我的问题是,据我所知,似乎字体大小从未应用于标题 3 到 6。

我正在寻求获得的目标是格鲁吉亚粗体的大标题(与文档中的组件h1具有相同的样式), -是逐渐缩小的相同版本,并且是显示更小,浓缩标题的特殊情况风格。我希望这相当简单,但这是我的输出:titleh3h6h2

示例输出

如您所见,这里发生了一些奇怪的事情:

  1. 很明显,该fontName属性是从中获取的default-heading2,因为我们看到那里使用了压缩字体
  2. 我添加的textColor属性以确保default-heading3-default-heading6执行任何操作都被拾取和应用。
  3. 我认为该fontSize属性至少在 上被拾取h2,但不能确定,也许这只是字体本身大小的差异。

我也尝试删除整个default-heading componentTextStyle, 认为这可能是某种奇怪的继承事情,但没有看到任何变化。

编辑:另外,我尝试完全颠倒componentTextStyle根元素上 's 的顺序(default-heading6首先定义,然后是default-heading5etc,然后是定义default-heading1,最后default-heading定义),并将version根元素的属性增加到 1.1 .0,基于预览应用程序生成的警告。这些都没有改变输出。

4

1 回答 1

0

好吧,经过一番调查,Apple News Format Documents 中的标题似乎有一个未记录的最小字体大小。我能够通过在最初的问题中对测试文档进行试错修改来推测这一点,最终导致以下结果:

{
  "version": "1.1.0",
  "identifier": "http://test.domain.com?p=123456",
  "title": "Test Apple News Post",
  "language": "en",
  "layout": {
    "columns": 7,
    "width": 1024
  },
  "components": [
    {
      "text": "Test Apple News Post",
      "role": "title",
      "layout": {
        "margin": {
          "bottom": 30
        }
      }
    },
    {
      "text": "# Heading 1\n\n## Heading 2\n\n### Heading 3\n\n#### Heading 4\n\n##### Heading 5\n\n###### Heading 6",
      "format": "markdown",
      "role": "body",
      "layout": "bodyLayout"
    }
  ],
  "componentTextStyles": {
    "default": {
      "linkStyle": {
        "textColor": "#DF0033"
      },
      "fontName": "Georgia",
      "fontSize": 12
    },
    "default-title": {
      "fontName": "Georgia-Bold",
      "fontSize": 24
    },
    "default-heading": {
      "fontName": "Georgia-Bold",
      "fontSize": 24
    },
    "default-heading1": {
      "fontName": "Georgia-Bold",
      "fontSize": 20
    },
    "default-heading2": {
      "fontName": "Georgia-Bold",
      "fontSize": 21
    },
    "default-heading3": {
      "fontName": "Georgia-Bold",
      "fontSize": 22,
      "textColor": "#FF0000"
    },
    "default-heading4": {
      "fontName": "Georgia-Bold",
      "fontSize": 23,
      "textColor": "#00FF00"
    },
    "default-heading5": {
      "fontName": "Georgia-Bold",
      "fontSize": 24,
      "textColor": "#0000FF"
    },
    "default-heading6": {
      "fontName": "Georgia-Bold",
      "fontSize": 25,
      "textColor": "#FF00FF"
    }
  },
  "metadata": {
    "datePublished": "2016-06-06T04:25:34+00:00",
    "dateCreated": "2016-06-06T04:25:34+00:00",
    "dateModified": "2016-06-27T01:05:27+00:00",
    "canonicalURL": "http://test.domain.com?p=123456",
    "thumbnailURL": "http://dummyimage.com/1000x500/000/ffffff&text=Apple+News+Image+1",
    "keywords": [
      "tag1",
      "tag2",
      "tag3"
    ],
    "excerpt": "This is the excerpt text, woo!"
  },
  "componentLayouts": {
    "bodyLayout": {
      "columnStart": 0,
      "columnSpan": 7,
      "margin": {
        "bottom": 15
      }
    }
  }
}

具有以下输出:

标题字体限制

由于字体仅从元素开始实际增加h6,我推测标题字体大小被限制为至少 24 磅。

于 2016-06-27T05:54:42.170 回答