Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions packages/preview/na-arabox/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# na-arabox

`na-arabox` is a Typst package for creating Arabic boxes that support Right-to-Left (RTL) text direction.

## Features
- **RTL Support**: Designed specifically for Arabic content.
- **Customizable**: Control title, colors, radii, and more.
- **Shadow Effect**: Optional shadow to give depth to your boxes.

## Usage

```typst
#import "@preview/na-arabox:0.1.0": na-arabox

#na-arabox(
title: "ملاحظة",
[هذا محتوى الصندوق باللغة العربية.]
)

// With shadow effect:
#na-arabox(
title: "تنبيه",
shadow: true,
[هذا صندوق مع تأثير ظل.]
)
59 changes: 59 additions & 0 deletions packages/preview/na-arabox/0.1.0/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// حزمة na-arabox لإنشاء صناديق عربية تدعم RTL.
#let na-arabox(
title: none,
title-align: center,
title-dx: 0pt,
title-fill: black,
title-stroke: black,
title-text: white,
title-radius: 4pt,
fill: luma(240),
stroke: black,
radius: 4pt,
body-inset: (left: 10pt, right: 10pt, top: 18pt, bottom: 10pt),
shadow: false, // <-- الخيار الجديد
body
) = {
set text(dir: rtl)

// تعريف الصندوق الأساسي كمتغير
let content = block(
breakable: true,
fill: fill,
stroke: 1pt + stroke,
radius: radius,
width: 100%,
inset: (top: 0pt, x: 0pt, bottom: 0pt),
[
#if title != none {
place(top + title-align, dy: -0.9em, dx: title-dx,
block(
fill: title-fill,
stroke: 0.5pt + title-stroke,
radius: title-radius,
inset: (x: 8pt, y: 8pt),
text(weight: "bold", fill: title-text, size: 0.9em, title)
)
)
}
#block(
width: 100%,
inset: body-inset,
body
)
]
)

// تطبيق منطق الظل إذا تم تفعيله
if shadow {
block(
fill: black.transparentize(80%),
radius: radius,
// الظل يبرز فقط من الأسفل واليمين
outset: (left: 0pt, top: 0pt, right: 4pt, bottom: 4pt),
content
)
} else {
content
}
}
10 changes: 10 additions & 0 deletions packages/preview/na-arabox/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "na-arabox"
version = "0.1.0"
authors = ["Naam Mohamed"]
license = "MIT"
description = "A package for creating Arabic RTL boxes with customizable styles and shadow effects."
repository = "https://github.com/naam11/na-arabox"
keywords = ["arabic", "rtl", "box", "layout"]
categories = ["layout"]
entrypoint = "lib.typ"
21 changes: 21 additions & 0 deletions packages/preview/ornacover/0.1.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Naam Mohamed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use the copy, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions packages/preview/ornacover/0.1.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Ornacover

A Typst package designed to create professional, ornamental covers for educational documents and booklets, especially tailored for mathematics teachers and academic use.

## Prerequisites (Important)
This package relies on the **"CornPop"** font for the ornamental graphics to function correctly.

- **Download Link:** [Click here to download the CornPop font](https://www.dafont.com/cornpop.font)
- **Installation:** After downloading, please install the font on your system, or place the font file in your project directory and use it via the `font-family` parameter.

## Examples & Usage

### 1. Portrait Layout
To set up your page with an ornamental background in Portrait orientation, use the following code:

```typst
#import "@preview/ornacover:0.1.0": ornacover-portrait, ornacover-landscape

#set page(
paper: "a4",
background: ornacover-portrait(
)
)
```
### 2. Landscape Layout
```typst
#import "@preview/ornacover:0.1.0": ornacover-portrait, ornacover-landscape

#set page(
paper: "a4",
flipped: true,
background: ornacover-landscape(
)
)

```
#### Features
#### 1. Dual Layout Support: Includes specific functions for both Portrait and Landscape documents.

#### 2. Highly Customizable: Easily adjust colors, decorative characters, and font families to match your specific style.

#### 3. High-Quality Graphics: Built on top of the powerful cetz library for precise, crisp vector artwork.
51 changes: 51 additions & 0 deletions packages/preview/ornacover/0.1.0/src/lib.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#import "@preview/cetz:0.5.2": canvas, draw

// 1. دالة الورقة العادية (لا تغيير فيها)
#let ornacover-portrait(base-color: black, ornament-char: "d", font-family: "CornPop") = {
rect(
width: 95%, height: 95%,
stroke: 1pt + base-color, radius: 7pt,
inset: 3pt,
fill: base-color,
rect(
width: 100%, height: 100%,
stroke: 1pt + base-color,
radius: 1pt,
fill: white.transparentize(17%)
)
)
place(top + left, dx: 1.2cm, dy: 1.7cm, canvas(length: 1cm, {
draw.content((2.4, 26.5), name: "a", scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char]))
draw.content((18.2, 26.5), name: "b", rotate(90deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.content((18.2, 3), name: "c", rotate(180deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.content((2.4, 3), name: "d", rotate(-90deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.line((to: (name: "a", anchor: "east"), rel: (2cm, 1.4)), (to: (name: "b", anchor: "west"), rel: (-2cm, 1.4)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "d", anchor: "east"), rel: (2cm, -1.4)), (to: (name: "c", anchor: "west"), rel: (-2cm, -1.4)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "a", anchor: "south"), rel: (-1.4cm, -1.9)), (to: (name: "d", anchor: "north"), rel: (-1.4cm, 1.9)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "b", anchor: "south"), rel: (1.4cm, -1.9)), (to: (name: "c", anchor: "north"), rel: (1.4cm, 1.9)), stroke: (paint: base-color, thickness: 7pt))
}))
}

// 2. دالة الورقة العرضية (لا تغيير فيها)
#let ornacover-landscape(base-color: red, ornament-char: "e", font-family: "CornPop") = {
rect(
width: 95%, height: 95%,
stroke: 1pt + base-color, radius: 7pt,
inset: 3pt,
fill:base-color,
rect(width: 100%, height:
100%,stroke: 1pt + base-color,
radius: 1pt,
fill: white.transparentize(17%))
)
place(top + left, dx: 1.6cm, dy: 1.7cm, canvas(length: 1cm, {
draw.content((3.4, 26.5), name: "a", scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char]))
draw.content((27, 26.5), name: "b", rotate(90deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.content((27, 11.5), name: "c", rotate(180deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.content((3.4, 11.5), name: "d", rotate(-90deg, scale(3.8cm, text(fill: base-color, font: font-family)[#ornament-char])))
draw.line((to: (name: "a", anchor: "east"), rel: (2cm, 1.6)), (to: (name: "b", anchor: "west"), rel: (-2cm, 1.6)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "d", anchor: "east"), rel: (2cm, -1.6)), (to: (name: "c", anchor: "west"), rel: (-2cm, -1.6)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "a", anchor: "south"), rel: (-1.6cm, -1.9)), (to: (name: "d", anchor: "north"), rel: (-1.6cm, 1.9)), stroke: (paint: base-color, thickness: 7pt))
draw.line((to: (name: "b", anchor: "south"), rel: (1.6cm, -1.9)), (to: (name: "c", anchor: "north"), rel: (1.6cm, 1.9)), stroke: (paint: base-color, thickness: 7pt))
}))
}
8 changes: 8 additions & 0 deletions packages/preview/ornacover/0.1.0/typst.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "ornacover"
version = "0.1.0"
entrypoint = "src/lib.typ"
authors = ["Naam Mohamed"]
license = "MIT"
description = "Ornamental covers package for educational documents"
repository = "https://github.com/naam11/ornacover"
Loading