Add fonts
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
"type": "project",
|
||||
"require": {
|
||||
"phpoffice/phpword": "dev-master",
|
||||
"symfony/console": "7.2.x-dev"
|
||||
"symfony/console": "7.2.x-dev",
|
||||
"symfony/process": "7.2.x-dev"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
66
composer.lock
generated
66
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "10a32976ced7d2c583fbadf2b55e4ca8",
|
||||
"content-hash": "78a7f322da01fab9bc676d318e0f7a03",
|
||||
"packages": [
|
||||
{
|
||||
"name": "phpoffice/math",
|
||||
@@ -705,6 +705,67 @@
|
||||
],
|
||||
"time": "2024-06-20T08:18:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "7.2.x-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "bb0a8b7772610211c2cd7d6e4e36acfcbadcb613"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/bb0a8b7772610211c2cd7d6e4e36acfcbadcb613",
|
||||
"reference": "bb0a8b7772610211c2cd7d6e4e36acfcbadcb613",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.2"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Process\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/7.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-29T06:33:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "dev-main",
|
||||
@@ -881,7 +942,8 @@
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {
|
||||
"phpoffice/phpword": 20
|
||||
"phpoffice/phpword": 20,
|
||||
"symfony/console": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
FROM php:8.2-cli
|
||||
|
||||
# Install dependencies needed for Composer and PHP zip extension
|
||||
RUN echo "deb http://deb.debian.org/debian bookworm contrib non-free" > /etc/apt/sources.list.d/contrib.list
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
unzip \
|
||||
libzip-dev \
|
||||
libreoffice \
|
||||
fontconfig \
|
||||
ttf-mscorefonts-installer \
|
||||
&& docker-php-ext-install zip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install fonts
|
||||
RUN mkdir -p /usr/share/fonts/truetype/custom
|
||||
COPY ./fonts/gilroy/* /usr/share/fonts/truetype/custom
|
||||
COPY ./fonts/lexend/* /usr/share/fonts/truetype/custom
|
||||
RUN fc-cache -f -v
|
||||
|
||||
# Download and install Composer
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
|
||||
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Black.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Black.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-BlackItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-BlackItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Bold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-BoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ExtraBold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ExtraBoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ExtraBoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Heavy.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Heavy.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-HeavyItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-HeavyItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Light.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Light.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-LightItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-LightItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Medium.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Medium.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-MediumItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-MediumItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Regular.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Regular.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-RegularItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-RegularItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-SemiBold.ttf
Normal file
BIN
fonts/gilroy/Gilroy-SemiBold.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-SemiBoldItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-SemiBoldItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-Thin.ttf
Normal file
BIN
fonts/gilroy/Gilroy-Thin.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-ThinItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-ThinItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-UltraLight.ttf
Normal file
BIN
fonts/gilroy/Gilroy-UltraLight.ttf
Normal file
Binary file not shown.
BIN
fonts/gilroy/Gilroy-UltraLightItalic.ttf
Normal file
BIN
fonts/gilroy/Gilroy-UltraLightItalic.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Black.ttf
Normal file
BIN
fonts/lexend/Lexend-Black.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Bold.ttf
Normal file
BIN
fonts/lexend/Lexend-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-ExtraBold.ttf
Normal file
BIN
fonts/lexend/Lexend-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-ExtraLight.ttf
Normal file
BIN
fonts/lexend/Lexend-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Light.ttf
Normal file
BIN
fonts/lexend/Lexend-Light.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Medium.ttf
Normal file
BIN
fonts/lexend/Lexend-Medium.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Regular.ttf
Normal file
BIN
fonts/lexend/Lexend-Regular.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-SemiBold.ttf
Normal file
BIN
fonts/lexend/Lexend-SemiBold.ttf
Normal file
Binary file not shown.
BIN
fonts/lexend/Lexend-Thin.ttf
Normal file
BIN
fonts/lexend/Lexend-Thin.ttf
Normal file
Binary file not shown.
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
@@ -7,6 +7,8 @@ use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
|
||||
class Generate extends Command
|
||||
{
|
||||
@@ -23,13 +25,28 @@ class Generate extends Command
|
||||
{
|
||||
$inPath = $input->getArgument("input");
|
||||
|
||||
$output->writeln(rootPath($inPath));
|
||||
|
||||
$doc = new Ebook($inPath);
|
||||
|
||||
$path = $doc->compile();
|
||||
|
||||
// $output->writeln($path);
|
||||
$cmd = new Process([
|
||||
"soffice",
|
||||
"--headless",
|
||||
"--convert-to",
|
||||
"pdf",
|
||||
"--outdir",
|
||||
"storage/",
|
||||
$path
|
||||
]);
|
||||
|
||||
$cmd->run();
|
||||
|
||||
if (!$cmd->isSuccessful()) {
|
||||
throw new ProcessFailedException($cmd);
|
||||
}
|
||||
|
||||
$output->writeln($cmd->getOutput());
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace MenulisAi\Pdfgen\Converter;
|
||||
|
||||
class Converter {}
|
||||
@@ -24,8 +24,8 @@ class Ebook implements Document
|
||||
$proc = new TemplateProcessor($this->templateSource());
|
||||
|
||||
$proc->setValues([
|
||||
'material' => $this->object->user_input->category,
|
||||
'chapter_name' => $this->object->user_input->material,
|
||||
'material' => strtoupper($this->object->user_input->category),
|
||||
'chapter_name' => strtoupper($this->object->user_input->material),
|
||||
'chapter' => '01',
|
||||
]);
|
||||
|
||||
@@ -111,9 +111,7 @@ class Ebook implements Document
|
||||
$proc->cloneBlock('block_reflection#' . $ci, 0, true, false, $reflects);
|
||||
}
|
||||
|
||||
$proc->saveAs("./examples/ebook_hasil.docx");
|
||||
|
||||
return "";
|
||||
return $proc->save();
|
||||
}
|
||||
|
||||
protected function openFile(string $path)
|
||||
|
||||
@@ -1 +1 @@
|
||||
,pande,pandewidya.local,15.08.2024 07:34,file:///Users/pande/Library/Application%20Support/LibreOffice/4;
|
||||
,pande,pandewidya.local,15.08.2024 10:30,file:///Users/pande/Library/Application%20Support/LibreOffice/4;
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user