1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 ~ Copyright (C) 2017 The Android Open Source Project 4 ~ 5 ~ Licensed under the Apache License, Version 2.0 (the "License"); 6 ~ you may not use this file except in compliance with the License. 7 ~ You may obtain a copy of the License at 8 ~ 9 ~ http://www.apache.org/licenses/LICENSE-2.0 10 ~ 11 ~ Unless required by applicable law or agreed to in writing, software 12 ~ distributed under the License is distributed on an "AS IS" BASIS, 13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 ~ See the License for the specific language governing permissions and 15 ~ limitations under the License. 16 --> 17 <resources> 18 <!-- Attributes that are read when parsing a <fontfamily> tag. --> 19 <declare-styleable name="FontFamily"> 20 <!-- The authority of the Font Provider to be used for the request. --> 21 <attr name="fontProviderAuthority" format="string" /> 22 <!-- The package for the Font Provider to be used for the request. This is used to verify 23 the identity of the provider. --> 24 <attr name="fontProviderPackage" format="string" /> 25 <!-- The query to be sent over to the provider. Refer to your font provider's documentation 26 on the format of this string. --> 27 <attr name="fontProviderQuery" format="string" /> 28 <!-- The sets of hashes for the certificates the provider should be signed with. This is 29 used to verify the identity of the provider, and is only required if the provider is not 30 part of the system image. This value may point to one list or a list of lists, where each 31 individual list represents one collection of signature hashes. Refer to your font provider's 32 documentation for these values. --> 33 <attr name="fontProviderCerts" format="reference" /> 34 <!-- The strategy to be used when fetching font data from a font provider in XML layouts. 35 This attribute is ignored when the resource is loaded from code, as it is equivalent to the 36 choice of API between {@link 37 androidx.core.content.res.ResourcesCompat#getFont(Context, int)} (blocking) and 38 {@link 39 androidx.core.content.res.ResourcesCompat#getFont(Context, int, FontCallback, Handler)} 40 (async). --> 41 <attr name="fontProviderFetchStrategy"> 42 <!-- The blocking font fetch works as follows. 43 First, check the local cache, then if the requested font is not cached, request the 44 font from the provider and wait until it is finished. You can change the length of 45 the timeout by modifying fontProviderFetchTimeout. If the timeout happens, the 46 default typeface will be used instead. --> 47 <enum name="blocking" value="0" /> 48 <!-- The async font fetch works as follows. 49 First, check the local cache, then if the requeted font is not cached, trigger a 50 request the font and continue with layout inflation. Once the font fetch succeeds, the 51 target text view will be refreshed with the downloaded font data. The 52 fontProviderFetchTimeout will be ignored if async loading is specified. --> 53 <enum name="async" value="1" /> 54 </attr> 55 <!-- The length of the timeout during fetching. --> 56 <attr name="fontProviderFetchTimeout" format="integer"> 57 <!-- A special value for the timeout. In this case, the blocking font fetching will not 58 timeout and wait until a reply is received from the font provider. --> 59 <enum name="forever" value="-1" /> 60 </attr> 61 </declare-styleable> 62 63 <!-- Attributes that are read when parsing a <font> tag, which is a child of 64 <font-family>. This represents an actual font file and its attributes. --> 65 <declare-styleable name="FontFamilyFont"> 66 <!-- The style of the given font file. This will be used when the font is being loaded into 67 the font stack and will override any style information in the font's header tables. If 68 unspecified, the value in the font's header tables will be used. --> 69 <attr name="fontStyle"> 70 <enum name="normal" value="0" /> 71 <enum name="italic" value="1" /> 72 </attr> 73 <!-- The reference to the font file to be used. This should be a file in the res/font folder 74 and should therefore have an R reference value. E.g. @font/myfont --> 75 <attr name="font" format="reference" /> 76 <!-- The weight of the given font file. This will be used when the font is being loaded into 77 the font stack and will override any weight information in the font's header tables. Must 78 be a positive number, a multiple of 100, and between 100 and 900, inclusive. The most 79 common values are 400 for regular weight and 700 for bold weight. If unspecified, the value 80 in the font's header tables will be used. --> 81 <attr name="fontWeight" format="integer" /> 82 <!-- The variation settings to be applied to the font. The string should be in the following 83 format: "'tag1' value1, 'tag2' value2, ...". If the default variation settings should be 84 used, or the font used does not support variation settings, this attribute needs not be 85 specified. --> 86 <attr name="fontVariationSettings" format="string" /> 87 <!-- The index of the font in the tcc font file. If the font file referenced is not in the 88 tcc format, this attribute needs not be specified. --> 89 <attr name="ttcIndex" format="integer" /> 90 <!-- References to the framework attrs --> 91 <attr name="android:fontStyle" /> 92 <attr name="android:font" /> 93 <attr name="android:fontWeight" /> 94 <attr name="android:fontVariationSettings" /> 95 <attr name="android:ttcIndex" /> 96 </declare-styleable> 97 </resources> 98