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 にフォント サイズが適用されていないように見えることです。

私が取得しようとしている目標は、Georgia Bold の大きな見出し (ドキュメント内h1のコンポーネントと同じスタイル)であり、同じものを徐々に小さくしたバージョンであり、小さく凝縮された見出しを示す特別なケースです。スタイル。これはかなり単純だと思っていましたが、私の出力は次のとおりです。titleh3h6h2

出力例

ご覧のとおり、ここでいくつかの奇妙なことが起こっています。

  1. 圧縮されたフォントがそこで使用されてfontNameいることがわかります。default-heading2
  2. 私が追加したtextColorプロパティは、何でも実行できるようにするためdefault-heading3default-heading6取得され、適用されます。
  3. プロパティfontSizeは少なくともh2.

default-heading componentTextStyleまた、これはある種の奇妙な継承である可能性があると考えて、全体を削除しようとしましたが、変更は見られませんでした。

編集: また、componentTextStyleルート要素の 's の順序を完全に逆にしてみました (default-heading6最初に定義されdefault-heading5、次に etc が続き、次にが定義されdefault-heading1、最後にが定義されます)、ルート要素のプロパティを 1.1 にdefault-heading増やしました。version.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 に答える