Adding contract font and setting richtext to it
This commit is contained in:
BIN
front/app/src/assets/SCHLBKB.TTF
Normal file
BIN
front/app/src/assets/SCHLBKB.TTF
Normal file
Binary file not shown.
@@ -21,25 +21,30 @@ import { FormlyFieldInput } from "@ngx-formly/bootstrap/input";
|
||||
(onGetContent)="onGetContent($event)"
|
||||
(onBeforeAddUndo)="onBeforeAddUndo($event)"
|
||||
></editor>
|
||||
<div *ngIf="this.field.props.disabled" [innerHTML]="formControl.value" class="form-control">
|
||||
<div *ngIf="this.field.props.disabled" [innerHTML]="formControl.value" class="form-control contract-body">
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<!-- <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError">-->
|
||||
<ng-container *ngIf="props.labelPosition !== 'floating'">
|
||||
<ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
|
||||
</ng-container>
|
||||
<ng-container [ngTemplateOutlet]="inputTemplate"></ng-container>
|
||||
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
||||
<formly-validation-message [field]="field"></formly-validation-message>
|
||||
</div>
|
||||
<small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
|
||||
<!-- </div>-->
|
||||
<ng-container *ngIf="props.labelPosition !== 'floating'">
|
||||
<ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
|
||||
</ng-container>
|
||||
<ng-container [ngTemplateOutlet]="inputTemplate"></ng-container>
|
||||
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
||||
<formly-validation-message [field]="field"></formly-validation-message>
|
||||
</div>
|
||||
<small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
|
||||
`,
|
||||
})
|
||||
export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
||||
multiline = true;
|
||||
|
||||
init_common = {
|
||||
statusbar: false,
|
||||
autoresize_bottom_margin: 0,
|
||||
body_class: "contract-body",
|
||||
content_style: ".contract-body { font-family: 'New Century Schoolbook', 'sans-serif' }"
|
||||
}
|
||||
|
||||
init_multiline = {
|
||||
plugins: 'lists image imagetools table code searchreplace autoresize',
|
||||
menubar: 'edit insert format tools table',
|
||||
@@ -51,16 +56,12 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
||||
table: { title: 'Table', items: 'inserttable | cell row column | tableprops deletetable' }
|
||||
},
|
||||
toolbar: 'undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | outdent indent bullist numlist | table image',
|
||||
statusbar: false,
|
||||
autoresize_bottom_margin: 0
|
||||
}
|
||||
|
||||
init_singleline = {
|
||||
plugins: 'autoresize',
|
||||
menubar: '',
|
||||
toolbar: 'undo redo | bold italic underline',
|
||||
statusbar: false,
|
||||
autoresize_bottom_margin: 0
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -71,19 +72,7 @@ export class RichtextTypeComponent extends FormlyFieldInput implements OnInit {
|
||||
}
|
||||
|
||||
getInitConfig() {
|
||||
let result: { menubar: string, toolbar: string };
|
||||
if (this.multiline) {
|
||||
result = this.init_multiline;
|
||||
} else {
|
||||
result = this.init_singleline;
|
||||
}
|
||||
|
||||
if (this.field.props.readonly) {
|
||||
result.menubar = '';
|
||||
result.toolbar = ''
|
||||
}
|
||||
|
||||
return result;
|
||||
return {...this.init_common, ...( this.multiline ? this.init_multiline : this.init_singleline)};
|
||||
}
|
||||
|
||||
onGetContent(param: any) {
|
||||
|
||||
@@ -1 +1,9 @@
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
@font-face {
|
||||
font-family: 'Century Schoolbook';
|
||||
src: url('assets/SCHLBKB.TTF');
|
||||
}
|
||||
|
||||
.contract-body {
|
||||
font-family: 'New Century Schoolbook', 'sans-serif';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user