| 1 | package kateb::FontInfo; | ||
| 2 | $kateb::FontInfo::VERSION = '1.2.1'; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings; | ||
| 6 | |||
| 7 | sub new { | ||
| 8 | my $class = shift; | ||
| 9 | my $self = _sources(); | ||
| 10 | bless $self, $class; | ||
| 11 | |||
| 12 | return $self; | ||
| 13 | } | ||
| 14 | |||
| 15 | sub _sources { | ||
| 16 | my $github_apis = { | ||
| 17 | vazir => { | ||
| 18 | name => 'vazirmatn', | ||
| 19 | api => 'https://api.github.com/repos/rastikerdar/vazirmatn/tags', | ||
| 20 | publisher => 'https://github.com/rastikerdar', | ||
| 21 | repo => 'https://github.com/rastikerdar/vazirmatn/', | ||
| 22 | publisher_name => 'Saber Rastikerdar' | ||
| 23 | }, | ||
| 24 | samim => { | ||
| 25 | name => 'samim-font', | ||
| 26 | api => 'https://api.github.com/repos/rastikerdar/samim-font/tags', | ||
| 27 | publisher => 'https://github.com/rastikerdar', | ||
| 28 | repo => 'https://github.com/rastikerdar/samin-font/', | ||
| 29 | publisher_name => 'Saber Rastikerdar' | ||
| 30 | }, | ||
| 31 | tanha => { | ||
| 32 | name => 'tanha-font', | ||
| 33 | api => 'https://api.github.com/repos/rastikerdar/tanha-font/tags', | ||
| 34 | publisher => 'https://github.com/rastikerdar', | ||
| 35 | repo => 'https://github.com/rastikerdar/tanha-font/', | ||
| 36 | publisher_name => 'Saber Rastikerdar' | ||
| 37 | }, | ||
| 38 | shabnam => { | ||
| 39 | name => 'shabnam-font', | ||
| 40 | api => 'https://api.github.com/repos/rastikerdar/shabnam-font/tags', | ||
| 41 | publisher => 'https://github.com/rastikerdar', | ||
| 42 | repo => 'https://github.com/rastikerdar/shabnam-font/', | ||
| 43 | publisher_name => 'Saber Rastikerdar' | ||
| 44 | }, | ||
| 45 | gandom => { | ||
| 46 | name => 'gandom-font', | ||
| 47 | api => 'https://api.github.com/repos/rastikerdar/gandom-font/tags', | ||
| 48 | publisher => 'https://github.com/rastikerdar', | ||
| 49 | repo => 'https://github.com/rastikerdar/gandom-font/', | ||
| 50 | publisher_name => 'Saber Rastikerdar' | ||
| 51 | }, | ||
| 52 | parastoo => { | ||
| 53 | name => 'parastoo-font', | ||
| 54 | api => 'https://api.github.com/repos/rastikerdar/parastoo-font/tags', | ||
| 55 | publisher => 'https://github.com/rastikerdar', | ||
| 56 | repo => 'https://github.com/rastikerdar/parastoo-font/', | ||
| 57 | publisher_name => 'Saber Rastikerdar' | ||
| 58 | }, | ||
| 59 | sahel => { | ||
| 60 | name => 'sahel-font', | ||
| 61 | api => 'https://api.github.com/repos/rastikerdar/sahel-font/tags', | ||
| 62 | publisher => 'https://github.com/rastikerdar', | ||
| 63 | repo => 'https://github.com/rastikerdar/sahel-font/', | ||
| 64 | publisher_name => 'Saber Rastikerdar' | ||
| 65 | }, | ||
| 66 | vazircode => { | ||
| 67 | name => 'vazir-code-font', | ||
| 68 | api => 'https://api.github.com/repos/rastikerdar/vazir-code-font/tags', | ||
| 69 | publisher => 'https://github.com/rastikerdar', | ||
| 70 | repo => 'https://github.com/rastikerdar/vazir-code-font/', | ||
| 71 | publisher_name => 'Saber Rastikerdar' | ||
| 72 | }, | ||
| 73 | ziracode => { | ||
| 74 | name => 'zira-code-font', | ||
| 75 | api => 'https://api.github.com/repos/kiamazi/zira-code-font/tags', | ||
| 76 | publisher => 'https://github.com/kiamazi', | ||
| 77 | repo => 'https://github.com/kiamazi/zira-code-font/', | ||
| 78 | publisher_name => 'Kiavash Mazi' | ||
| 79 | }, | ||
| 80 | nahid => { | ||
| 81 | name => 'nahid-font', | ||
| 82 | api => 'https://api.github.com/repos/rastikerdar/nahid-font/tags', | ||
| 83 | publisher => 'https://github.com/rastikerdar', | ||
| 84 | repo => 'https://github.com/rastikerdar/nahid-font/', | ||
| 85 | publisher_name => 'Saber Rastikerdar' | ||
| 86 | }, | ||
| 87 | mikhak => { | ||
| 88 | name => 'Mikhak', | ||
| 89 | api => 'https://api.github.com/repos/aminabedi68/Mikhak/tags', | ||
| 90 | publisher => 'https://github.com/aminabedi68', | ||
| 91 | repo => 'https://github.com/aminabedi68/Mikhak/', | ||
| 92 | publisher_name => 'Amin Abedi' | ||
| 93 | }, | ||
| 94 | estedad => { | ||
| 95 | name => 'Estedad', | ||
| 96 | api => 'https://api.github.com/repos/aminabedi68/Estedad/tags', | ||
| 97 | publisher => 'https://github.com/aminabedi68', | ||
| 98 | repo => 'https://github.com/aminabedi68/Estedad/', | ||
| 99 | publisher_name => 'Amin Abedi' | ||
| 100 | }, | ||
| 101 | ganjnameh => { | ||
| 102 | name => 'GanjnamehFont', | ||
| 103 | api => 'https://api.github.com/repos/font-store/GanjnamehFont/tags', | ||
| 104 | publisher => 'https://github.com/font-store', | ||
| 105 | repo => 'https://github.com/font-store/GanjnamehFont/', | ||
| 106 | publisher_name => 'Saleh Souzanchi' | ||
| 107 | }, | ||
| 108 | behdad => { | ||
| 109 | name => 'BehdadFont', | ||
| 110 | api => 'https://api.github.com/repos/font-store/BehdadFont/tags', | ||
| 111 | publisher => 'https://github.com/font-store', | ||
| 112 | repo => 'https://github.com/font-store/BehdadFont/', | ||
| 113 | publisher_name => 'Saleh Souzanchi' | ||
| 114 | }, | ||
| 115 | nika => { | ||
| 116 | name => 'NikaFont', | ||
| 117 | api => 'https://api.github.com/repos/font-store/NikaFont/tags', | ||
| 118 | publisher => 'https://github.com/font-store', | ||
| 119 | repo => 'https://github.com/font-store/NikaFont/', | ||
| 120 | publisher_name => 'Saleh Souzanchi' | ||
| 121 | }, | ||
| 122 | farbod => { | ||
| 123 | name => 'FarbodFont', | ||
| 124 | api => 'https://api.github.com/repos/font-store/FarbodFont/tags', | ||
| 125 | publisher => 'https://github.com/font-store', | ||
| 126 | repo => 'https://github.com/font-store/FarbodFont', | ||
| 127 | publisher_name => 'Saleh Souzanchi' | ||
| 128 | }, | ||
| 129 | shahab => { | ||
| 130 | name => 'ShahabFont', | ||
| 131 | api => 'https://api.github.com/repos/font-store/ShahabFont/tags', | ||
| 132 | publisher => 'https://github.com/font-store', | ||
| 133 | repo => 'https://github.com/font-store/ShahabFont', | ||
| 134 | publisher_name => 'Saleh Souzanchi' | ||
| 135 | }, | ||
| 136 | noon => { | ||
| 137 | name => 'NoonFont', | ||
| 138 | api => 'https://api.github.com/repos/font-store/NoonFont/tags', | ||
| 139 | publisher => 'https://github.com/font-store', | ||
| 140 | repo => 'https://github.com/font-store/NoonFont', | ||
| 141 | publisher_name => 'Saleh Souzanchi' | ||
| 142 | }, | ||
| 143 | pfont => { | ||
| 144 | name => 'pfont', | ||
| 145 | api => 'https://api.github.com/repos/pfont/pfont/tags', | ||
| 146 | publisher => 'https://github.com/pfont', | ||
| 147 | repo => 'https://github.com/pfont/pfont/', | ||
| 148 | publisher_name => 'Persian Free Font' | ||
| 149 | }, | ||
| 150 | lalezar => { | ||
| 151 | name => 'Lalezar', | ||
| 152 | api => 'https://api.github.com/repos/BornaIz/Lalezar/tags', | ||
| 153 | publisher => 'https://github.com/BornaIz', | ||
| 154 | repo => 'https://github.com/BornaIz/Lalezar/', | ||
| 155 | publisher_name => 'Borna Izadpanah' | ||
| 156 | }, | ||
| 157 | nastaliq => { | ||
| 158 | name => 'font-IranNastaliq', | ||
| 159 | api => 'https://api.github.com/repos/font-store/font-IranNastaliq/tags', | ||
| 160 | publisher => 'https://github.com/font-store', | ||
| 161 | repo => 'https://github.com/BornaIz/Lalezar/', | ||
| 162 | publisher_name => 'Saleh Souzanchi' | ||
| 163 | }, | ||
| 164 | arad => { | ||
| 165 | name => 'Arad', | ||
| 166 | api => 'https://api.github.com/repos/MDarvishi5124/Arad/releases', | ||
| 167 | publisher => 'https://github.com/MDarvishi5124', | ||
| 168 | repo => 'https://github.com/MDarvishi5124/Arad/', | ||
| 169 | publisher_name => 'Mohammad Darvishi' | ||
| 170 | }, | ||
| 171 | }; | ||
| 172 | return $github_apis; | ||
| 173 | } | ||
| 174 | |||
| 175 | sub lalezar { | ||
| 176 | my $link = | ||
| 177 | 'https://raw.githubusercontent.com/BornaIz/Lalezar/master/fonts/Lalezar-Regular.ttf'; | ||
| 178 | return $link; | ||
| 179 | } | ||
| 180 | |||
| 181 | sub nastaliq { | ||
| 182 | my $link = | ||
| 183 | 'https://github.com/font-store/font-IranNastaliq/raw/master/WebFonts/IranNastaliq-Web.ttf'; | ||
| 184 | return $link; | ||
| 185 | } | ||
| 186 | |||
| 187 | # sub arad { | ||
| 188 | # my $link = | ||
| 189 | # 'https://github.com/MDarvishi5124/Arad/releases/download/1.0.1v/Arad.zip'; | ||
| 190 | # return $link; | ||
| 191 | # } | ||
| 192 | sub arad { | ||
| 193 | my $self = shift; | ||
| 194 | my $version = shift; | ||
| 195 | my $link = | ||
| 196 | $self->{arad}->{publisher} . "/" . | ||
| 197 | $self->{arad}->{name} . | ||
| 198 | "/releases/download/" . | ||
| 199 | $version . "/" . | ||
| 200 | $self->{arad}->{name} . | ||
| 201 | ".zip" | ||
| 202 | ; | ||
| 203 | return $link; | ||
| 204 | } | ||
| 205 | |||
| 206 | sub vazir { | ||
| 207 | my $self = shift; | ||
| 208 | my $version = shift; | ||
| 209 | my $link = | ||
| 210 | $self->{vazir}->{publisher} . "/" . | ||
| 211 | $self->{vazir}->{name} . | ||
| 212 | "/releases/download/" . | ||
| 213 | $version . "/" . | ||
| 214 | $self->{vazir}->{name} . "-" . $version . | ||
| 215 | ".zip" | ||
| 216 | ; | ||
| 217 | return $link; | ||
| 218 | } | ||
| 219 | |||
| 220 | sub samim { | ||
| 221 | my $self = shift; | ||
| 222 | my $version = shift; | ||
| 223 | my $link = | ||
| 224 | $self->{samim}->{publisher} . "/" . | ||
| 225 | $self->{samim}->{name} . | ||
| 226 | "/releases/download/" . | ||
| 227 | $version . "/" . | ||
| 228 | $self->{samim}->{name} . "-" . $version . | ||
| 229 | ".zip" | ||
| 230 | ; | ||
| 231 | return $link; | ||
| 232 | } | ||
| 233 | |||
| 234 | sub tanha { | ||
| 235 | my $self = shift; | ||
| 236 | my $version = shift; | ||
| 237 | my $link = | ||
| 238 | $self->{tanha}->{publisher} . "/" . | ||
| 239 | $self->{tanha}->{name} . | ||
| 240 | "/releases/download/" . | ||
| 241 | $version . "/" . | ||
| 242 | $self->{tanha}->{name} . "-" . $version . | ||
| 243 | ".zip" | ||
| 244 | ; | ||
| 245 | return $link; | ||
| 246 | } | ||
| 247 | |||
| 248 | sub shabnam { | ||
| 249 | my $self = shift; | ||
| 250 | my $version = shift; | ||
| 251 | my $link = | ||
| 252 | $self->{shabnam}->{publisher} . "/" . | ||
| 253 | $self->{shabnam}->{name} . | ||
| 254 | "/releases/download/" . | ||
| 255 | $version . "/" . | ||
| 256 | $self->{shabnam}->{name} . "-" . $version . | ||
| 257 | ".zip" | ||
| 258 | ; | ||
| 259 | return $link; | ||
| 260 | } | ||
| 261 | |||
| 262 | sub gandom { | ||
| 263 | my $self = shift; | ||
| 264 | my $version = shift; | ||
| 265 | my $link = | ||
| 266 | $self->{gandom}->{publisher} . "/" . | ||
| 267 | $self->{gandom}->{name} . | ||
| 268 | "/releases/download/" . | ||
| 269 | $version . "/" . | ||
| 270 | $self->{gandom}->{name} . "-" . $version . | ||
| 271 | ".zip" | ||
| 272 | ; | ||
| 273 | return $link; | ||
| 274 | } | ||
| 275 | |||
| 276 | sub parastoo { | ||
| 277 | my $self = shift; | ||
| 278 | my $version = shift; | ||
| 279 | my $link = | ||
| 280 | $self->{parastoo}->{publisher} . "/" . | ||
| 281 | $self->{parastoo}->{name} . | ||
| 282 | "/releases/download/" . | ||
| 283 | $version . "/" . | ||
| 284 | $self->{parastoo}->{name} . "-" . $version . | ||
| 285 | ".zip" | ||
| 286 | ; | ||
| 287 | return $link; | ||
| 288 | } | ||
| 289 | |||
| 290 | sub sahel { | ||
| 291 | my $self = shift; | ||
| 292 | my $version = shift; | ||
| 293 | my $link = | ||
| 294 | $self->{sahel}->{publisher} . "/" . | ||
| 295 | $self->{sahel}->{name} . | ||
| 296 | "/releases/download/" . | ||
| 297 | $version . "/" . | ||
| 298 | $self->{sahel}->{name} . "-" . $version . | ||
| 299 | ".zip" | ||
| 300 | ; | ||
| 301 | return $link; | ||
| 302 | } | ||
| 303 | |||
| 304 | sub vazircode { | ||
| 305 | my $self = shift; | ||
| 306 | my $version = shift; | ||
| 307 | my $link = | ||
| 308 | $self->{vazircode}->{publisher} . "/" . | ||
| 309 | $self->{vazircode}->{name} . | ||
| 310 | "/releases/download/" . | ||
| 311 | $version . "/" . | ||
| 312 | $self->{vazircode}->{name} . "-" . $version . | ||
| 313 | ".zip" | ||
| 314 | ; | ||
| 315 | return $link; | ||
| 316 | } | ||
| 317 | |||
| 318 | sub ziracode { | ||
| 319 | my $self = shift; | ||
| 320 | my $version = shift; | ||
| 321 | my $link = | ||
| 322 | $self->{ziracode}->{publisher} . "/" . | ||
| 323 | $self->{ziracode}->{name} . | ||
| 324 | "/releases/download/" . | ||
| 325 | $version . "/" . | ||
| 326 | $self->{ziracode}->{name} . "-" . $version . | ||
| 327 | ".zip" | ||
| 328 | ; | ||
| 329 | return $link; | ||
| 330 | } | ||
| 331 | |||
| 332 | sub nahid { | ||
| 333 | my $self = shift; | ||
| 334 | my $version = shift; | ||
| 335 | my $link = | ||
| 336 | $self->{nahid}->{publisher} . "/" . | ||
| 337 | $self->{nahid}->{name} . | ||
| 338 | "/releases/download/" . | ||
| 339 | $version . "/" . | ||
| 340 | $self->{nahid}->{name} . "-" . $version . | ||
| 341 | ".zip" | ||
| 342 | ; | ||
| 343 | return $link; | ||
| 344 | } | ||
| 345 | |||
| 346 | sub mikhak { | ||
| 347 | my $self = shift; | ||
| 348 | my $version = shift; | ||
| 349 | my $file_version = $version; | ||
| 350 | $file_version =~ s/\( (\d+) \)//x; | ||
| 351 | my $link = | ||
| 352 | $self->{mikhak}->{publisher} . "/" . | ||
| 353 | $self->{mikhak}->{name} . | ||
| 354 | "/releases/download/" . | ||
| 355 | $version . "/" . | ||
| 356 | $self->{mikhak}->{name} . "-" . $file_version . | ||
| 357 | ".zip" | ||
| 358 | ; | ||
| 359 | |||
| 360 | return $link; | ||
| 361 | } | ||
| 362 | |||
| 363 | sub estedad { | ||
| 364 | my $self = shift; | ||
| 365 | my $version = shift; | ||
| 366 | my $file_version = $version; | ||
| 367 | $file_version =~ s/\(\d+\)//; | ||
| 368 | my $link = | ||
| 369 | $self->{estedad}->{publisher} . "/" . | ||
| 370 | $self->{estedad}->{name} . | ||
| 371 | "/releases/download/" . | ||
| 372 | $version . "/" . | ||
| 373 | $self->{estedad}->{name} . "-v" . $file_version . | ||
| 374 | ".zip" | ||
| 375 | ; | ||
| 376 | return $link; | ||
| 377 | } | ||
| 378 | |||
| 379 | sub ganjnameh { | ||
| 380 | my $self = shift; | ||
| 381 | my $version = shift; | ||
| 382 | my $ver = $version; | ||
| 383 | $ver =~ s/^v//; | ||
| 384 | my $link = | ||
| 385 | $self->{ganjnameh}->{publisher} . "/" . | ||
| 386 | $self->{ganjnameh}->{name} . | ||
| 387 | "/releases/download/" . | ||
| 388 | $version . "/" . | ||
| 389 | "pack." . $ver . | ||
| 390 | ".zip" | ||
| 391 | ; | ||
| 392 | return $link; | ||
| 393 | } | ||
| 394 | |||
| 395 | sub behdad { | ||
| 396 | my $self = shift; | ||
| 397 | my $version = shift; | ||
| 398 | my $ver = $version; | ||
| 399 | $ver =~ s/^v//; | ||
| 400 | my $link = | ||
| 401 | $self->{behdad}->{publisher} . "/" . | ||
| 402 | $self->{behdad}->{name} . | ||
| 403 | "/releases/download/" . | ||
| 404 | $version . "/" . | ||
| 405 | "Behdad-" . $ver . | ||
| 406 | ".zip" | ||
| 407 | ; | ||
| 408 | return $link; | ||
| 409 | } | ||
| 410 | |||
| 411 | sub nika { | ||
| 412 | my $self = shift; | ||
| 413 | my $version = shift; | ||
| 414 | my $link = | ||
| 415 | $self->{nika}->{publisher} . "/" . | ||
| 416 | $self->{nika}->{name} . | ||
| 417 | "/releases/download/" . | ||
| 418 | $version . "/" . | ||
| 419 | "nika." . $version . | ||
| 420 | ".zip" | ||
| 421 | ; | ||
| 422 | return $link; | ||
| 423 | } | ||
| 424 | |||
| 425 | sub farbod { | ||
| 426 | my $self = shift; | ||
| 427 | my $version = shift; | ||
| 428 | my $ver = $version; | ||
| 429 | $ver =~ s/^v//; | ||
| 430 | my $link = | ||
| 431 | $self->{farbod}->{publisher} . "/" . | ||
| 432 | $self->{farbod}->{name} . | ||
| 433 | "/releases/download/" . | ||
| 434 | $version . "/" . | ||
| 435 | "Farbod-" . $ver . | ||
| 436 | ".zip" | ||
| 437 | ; | ||
| 438 | return $link; | ||
| 439 | } | ||
| 440 | |||
| 441 | sub pfont { | ||
| 442 | my $self = shift; | ||
| 443 | my $version = shift; | ||
| 444 | my $link = | ||
| 445 | $self->{pfont}->{publisher} . "/" . | ||
| 446 | $self->{pfont}->{name} . | ||
| 447 | "/releases/download/" . | ||
| 448 | $version . "/" . | ||
| 449 | "pfont.zip" | ||
| 450 | ; | ||
| 451 | return $link; | ||
| 452 | } | ||
| 453 | |||
| 454 | sub shahab { | ||
| 455 | my $self = shift; | ||
| 456 | my $version = shift; | ||
| 457 | my $ver = $version; | ||
| 458 | $ver =~ s/^v//; | ||
| 459 | my $link = | ||
| 460 | $self->{shahab}->{publisher} . "/" . | ||
| 461 | $self->{shahab}->{name} . | ||
| 462 | "/releases/download/" . | ||
| 463 | $version . "/" . | ||
| 464 | "pack." . $ver . | ||
| 465 | ".zip" | ||
| 466 | ; | ||
| 467 | return $link; | ||
| 468 | } | ||
| 469 | |||
| 470 | sub noon { | ||
| 471 | my $self = shift; | ||
| 472 | my $version = shift; | ||
| 473 | my $ver = $version; | ||
| 474 | $ver =~ s/\./\-/g; | ||
| 475 | my $link = | ||
| 476 | $self->{noon}->{publisher} . "/" . | ||
| 477 | $self->{noon}->{name} . | ||
| 478 | "/releases/download/" . | ||
| 479 | $version . "/" . | ||
| 480 | "NOON_" . $ver . | ||
| 481 | ".zip" | ||
| 482 | ; | ||
| 483 | return $link; | ||
| 484 | } | ||
| 485 | |||
| 486 | 1; |