Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Dec 28, 2024
1 parent a5ab9a4 commit a40307a
Show file tree
Hide file tree
Showing 19 changed files with 180 additions and 34 deletions.
8 changes: 4 additions & 4 deletions config/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@

| نام ویژگی | توضیح | تولید |
|-----------|------------|-------|
| `نام` | | `name` |
| `نام` | | `font-family` |
| `منبع` | | `src` |
| `محدود یونیکد` | | `unicode_range` |
| `سبک` | | `style` |
| `وزن` | | `weight` |
| `محدود یونیکد` | | `unicode-range` |
| `سبک` | | `font-style` |
| `وزن` | | `font-weight` |

<h2 id="media">دستور <code>واکنش گرا</code></h2>

Expand Down
40 changes: 34 additions & 6 deletions config/json/layout/attribute/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
}
},
{
"generate_name": "weight",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT",
"generate_name": "font-weight",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
Expand All @@ -33,8 +33,8 @@
}
},
{
"generate_name": "unicode_range",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE",
"generate_name": "unicode-range",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
Expand All @@ -47,8 +47,8 @@
}
},
{
"generate_name": "style",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_STYLE",
"generate_name": "font-style",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
Expand Down Expand Up @@ -111,6 +111,20 @@
]
}
},
{
"generate_name": "src",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
"en": [
"src"
],
"fa": [
"منبع"
]
}
},
{
"generate_name": "src",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_SRC",
Expand Down Expand Up @@ -279,6 +293,20 @@
]
}
},
{
"generate_name": "font-family",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
"en": [
"name"
],
"fa": [
"نام"
]
}
},
{
"generate_name": "name",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_NAME",
Expand Down
10 changes: 5 additions & 5 deletions config/json/layout/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,11 @@
"examples": "",
"generate_name": "font",
"attributes": [
"AST_LAYOUT_ATTRIBUTE_TYPE_NAME",
"AST_LAYOUT_ATTRIBUTE_TYPE_SRC",
"AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE",
"AST_LAYOUT_ATTRIBUTE_TYPE_STYLE",
"AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT"
"AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME",
"AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC",
"AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE",
"AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE",
"AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT"
],
"id": "AST_LAYOUT_TYPE_FONT",
"is_mother": true,
Expand Down
30 changes: 24 additions & 6 deletions config/layout/attribute/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ items:
- group
fa:
- گروه
- generate_name: weight
id: AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT
- generate_name: font-weight
id: AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- weight
fa:
- وزن
- generate_name: unicode_range
id: AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE
- generate_name: unicode-range
id: AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- unicode range
fa:
- محدود یونیکد
- generate_name: style
id: AST_LAYOUT_ATTRIBUTE_TYPE_STYLE
- generate_name: font-style
id: AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
Expand Down Expand Up @@ -70,6 +70,15 @@ items:
- content
fa:
- محتوا
- generate_name: src
id: AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- src
fa:
- منبع
- generate_name: src
id: AST_LAYOUT_ATTRIBUTE_TYPE_SRC
reserved_values: ''
Expand Down Expand Up @@ -178,6 +187,15 @@ items:
- icon
fa:
- نمایه
- generate_name: font-family
id: AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- name
fa:
- نام
- generate_name: name
id: AST_LAYOUT_ATTRIBUTE_TYPE_NAME
reserved_values: ''
Expand Down
10 changes: 5 additions & 5 deletions config/layout/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,11 @@ items:
examples: ''
generate_name: font
attributes:
- AST_LAYOUT_ATTRIBUTE_TYPE_NAME
- AST_LAYOUT_ATTRIBUTE_TYPE_SRC
- AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE
- AST_LAYOUT_ATTRIBUTE_TYPE_STYLE
- AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT
- AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME
- AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC
- AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE
- AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE
- AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT
id: AST_LAYOUT_TYPE_FONT
is_mother: true
text:
Expand Down
18 changes: 18 additions & 0 deletions example/custom-font.salam
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
صفحه:
عنوان = "test me"

قلم:
نام = "Vazirmatn"
// سبک = "معمولی"
// سبک = "normal"
// وزن = 400
//محدود یونیکد = "U+0460-052F", "U+1C80-1C88", "U+20B4", "U+2DE0-2DFF", "U+A640-A69F", "U+FE2E-FE2F"
// منبع = "https://cdn.jsdelivr.net/gh/rastikerdar/[email protected]/fonts/webfonts/Vazirmatn-Thin.woff2"
تمام

جعبه:
نام قلم = "Vazirmatn"
محتوا = "Hi there, it's a custom font???"

هاور:
اندازه قلم = ۵۰
تمام
تمام

تمام
6 changes: 6 additions & 0 deletions src/generated-config/ast_block_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ ADD_BLOCK_TYPE(AST_BLOCK_TYPE_ERROR, "ERROR", "error")









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_style_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ ADD_LAYOUT_ATTRIBUTE_STYLE_GLOBAL_VALUE(unset, "حذف شده")









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_style_state_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ ADD_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE(AST_LAYOUT_ATTRIBUTE_STYLE_STATE_TYPE_EMPT









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_style_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,9 @@ ADD_LAYOUT_ATTRIBUTE_STYLE_TYPE_HIDE(AST_LAYOUT_ATTRIBUTE_STYLE_TYPE_ERROR, "ERR









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_style_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -1476,3 +1476,9 @@ const ast_layout_attribute_pair_t ast_layout_allowed_style_list_zoom[] = {









Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,9 @@ extern const ast_layout_attribute_pair_t ast_layout_allowed_style_list_zoom[];









16 changes: 13 additions & 3 deletions src/generated-config/ast_layout_attribute_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_ERROR, "ERROR", "error", "",

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_GROUP, "GROUP", "group", "گروه", "group", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT, "WEIGHT", "weight", "وزن", "weight", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)
ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT, "FONT_WEIGHT", "font_weight", "وزن", "font-weight", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE, "UNICODE_RANGE", "unicode_range", "محدود یونیکد", "unicode_range", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)
ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE, "FONT_UNICODE_RANGE", "font_unicode_range", "محدود یونیکد", "unicode-range", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_STYLE, "STYLE", "style", "سبک", "style", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)
ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE, "FONT_STYLE", "font_style", "سبک", "font-style", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_CLASS, "CLASS", "class", "کلاس", "class", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_ID, "ID", "id", "شناسه", "id", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_CONTENT, "CONTENT", "content", "محتوا", "content", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC, "FONT_SRC", "font_src", "منبع", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_SRC, "SRC", "src", "منبع", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_LABEL, "LABEL", "label", "برچسب", "label", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)
Expand All @@ -39,6 +41,8 @@ ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_KEYWORDS, "KEYWORDS", "keywo

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_ICON, "ICON", "icon", "نمایه", "icon", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME, "FONT_NAME", "font_name", "نام", "font-family", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_NAME, "NAME", "name", "نام", "name", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_CHARSET, "CHARSET", "charset", "فرمت متنی", "charset", AST_LAYOUT_ATTRIBUTE_FILTER_STRING, ast_layout_allowed_charset, NULL)
Expand Down Expand Up @@ -67,3 +71,9 @@ ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_RESPONSIVE_MIN_HEIGHT, "RESP









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ const ast_layout_attribute_pair_t ast_layout_allowed_lang[] = {









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_attribute_value_extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ extern const ast_layout_attribute_pair_t ast_layout_allowed_lang[];









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,9 @@ ADD_LAYOUT_TYPE_REPEAT(AST_LAYOUT_TYPE_MEDIA, "MEDIA", "media", "@media", "وا









6 changes: 6 additions & 0 deletions src/generated-config/ast_layout_type_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,9 @@ else if (attribute->parent_node_type == AST_LAYOUT_TYPE_MEDIA) {









16 changes: 11 additions & 5 deletions src/generated-config/ast_layout_type_attributes_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ const size_t valid_attributes_input_length = sizeof(valid_attributes_input) / si


ast_layout_attribute_type_t valid_attributes_font[] = {
AST_LAYOUT_ATTRIBUTE_TYPE_NAME,
AST_LAYOUT_ATTRIBUTE_TYPE_SRC,
AST_LAYOUT_ATTRIBUTE_TYPE_UNICODE_RANGE,
AST_LAYOUT_ATTRIBUTE_TYPE_STYLE,
AST_LAYOUT_ATTRIBUTE_TYPE_WEIGHT,
AST_LAYOUT_ATTRIBUTE_TYPE_FONT_NAME,
AST_LAYOUT_ATTRIBUTE_TYPE_FONT_SRC,
AST_LAYOUT_ATTRIBUTE_TYPE_FONT_UNICODE_RANGE,
AST_LAYOUT_ATTRIBUTE_TYPE_FONT_STYLE,
AST_LAYOUT_ATTRIBUTE_TYPE_FONT_WEIGHT,
};
const size_t valid_attributes_font_length = sizeof(valid_attributes_font) / sizeof(valid_attributes_font[0]);

Expand All @@ -109,3 +109,9 @@ const size_t valid_attributes_font_length = sizeof(valid_attributes_font) / size









6 changes: 6 additions & 0 deletions src/generated-config/ast_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ ADD_TYPE(AST_TYPE_ERROR, "ERROR", "error")









0 comments on commit a40307a

Please sign in to comment.