Xml文件  |  79行  |  4.62 KB

<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2017 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<resources>
    <!-- Attributes that are read when parsing a <fontfamily> tag. -->
    <declare-styleable name="FontFamily">
        <!-- The authority of the Font Provider to be used for the request. -->
        <attr name="fontProviderAuthority" format="string" />
        <!-- The package for the Font Provider to be used for the request. This is used to verify
        the identity of the provider. -->
        <attr name="fontProviderPackage" format="string" />
        <!-- The query to be sent over to the provider. Refer to your font provider's documentation
        on the format of this string. -->
        <attr name="fontProviderQuery" format="string" />
        <!-- The sets of hashes for the certificates the provider should be signed with. This is
        used to verify the identity of the provider, and is only required if the provider is not
        part of the system image. This value may point to one list or a list of lists, where each
        individual list represents one collection of signature hashes. Refer to your font provider's
        documentation for these values. -->
        <attr name="fontProviderCerts" format="reference" />
        <!-- The strategy to be used when fetching font data from a font provider in XML layouts.
          -->
        <attr name="fontProviderFetchStrategy">
            <!-- The blocking font fetch works as follows.
              First, check the local cache, then if the requested font is not cached, request the
              font from the provider and wait until it is finished.  You can change the length of
              the timeout by modifying fontProviderFetchTimeout.  If the timeout happens, the
              default typeface will be used instead. -->
            <enum name="blocking" value="0" />
            <!-- The async font fetch works as follows.
              First, check the local cache, then if the requeted font is not cached, trigger a
              request the font and continue with layout inflation. Once the font fetch succeeds, the
              target text view will be refreshed with the downloaded font data. The
              fontProviderFetchTimeout will be ignored if async loading is specified. -->
            <enum name="async" value="1" />
        </attr>
        <!-- The length of the timeout during fetching. -->
        <attr name="fontProviderFetchTimeout" format="integer">
          <!-- A special value for the timeout. In this case, the blocking font fetching will not
            timeout and wait until a reply is received from the font provider. -->
            <enum name="forever" value="-1" />
        </attr>
    </declare-styleable>

    <!-- Attributes that are read when parsing a <font> tag, which is a child of
         <font-family>. This represents an actual font file and its attributes. -->
    <declare-styleable name="FontFamilyFont">
        <!-- The style of the given font file. This will be used when the font is being loaded into
         the font stack and will override any style information in the font's header tables. If
         unspecified, the value in the font's header tables will be used. -->
        <attr name="fontStyle">
            <enum name="normal" value="0" />
            <enum name="italic" value="1" />
        </attr>
        <!-- The reference to the font file to be used. This should be a file in the res/font folder
         and should therefore have an R reference value. E.g. @font/myfont -->
        <attr name="font" format="reference" />
        <!-- The weight of the given font file. This will be used when the font is being loaded into
         the font stack and will override any weight information in the font's header tables. Must
         be a positive number, a multiple of 100, and between 100 and 900, inclusive. The most
         common values are 400 for regular weight and 700 for bold weight. If unspecified, the value
         in the font's header tables will be used. -->
        <attr name="fontWeight" format="integer" />
    </declare-styleable>
</resources>