mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 23:30:22 +02:00
fpvectorial-odt: Advances the writer
git-svn-id: trunk@42375 -
This commit is contained in:
parent
fbd4d7e732
commit
b1f478d8ed
@ -28,12 +28,35 @@ begin
|
||||
|
||||
// First page sequence
|
||||
Page := Vec.AddTextPageSequence();
|
||||
// First paragraph
|
||||
// Title
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.AddText('');
|
||||
CurParagraph.Style := Vec.StyleHeading1;
|
||||
CurParagraph.AddText('Lazarus');
|
||||
// paragraph
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleTextBody;
|
||||
CurParagraph.AddText('Lazarus is a free and open source development tool '
|
||||
+ 'for the Free Pascal compiler, which is also free and open source.');
|
||||
// Title
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleHeading2;
|
||||
CurParagraph.AddText('Overview');
|
||||
// paragraph
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleTextBody;
|
||||
CurParagraph.AddText('Lazarus is a free cross-platform visual integrated '
|
||||
+ 'development environment (IDE) for rapid application development (RAD) '
|
||||
+ 'using the Free Pascal compiler supported dialects of Object Pascal. '
|
||||
+ 'Developers use Lazarus to create native code console and graphical user '
|
||||
+ 'interface (GUI) applications for the desktop along with mobile devices, '
|
||||
+ 'web applications, web services, and visual components and function '
|
||||
+ 'libraries (.so, .dll, etc) for use by other programs for any platform '
|
||||
+ 'the Free Pascal compiler supports( Mac, Unix, Linux, Windows, etc).');
|
||||
// Empty line
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.Style := Vec.StyleTextBody;
|
||||
// Lazarus provides a highly visual development environment for the creation of rich user interfaces, application logic, and other supporting code artifacts. Along with the customary project management features, the Lazarus IDE also provides features that includes but are not limited to:
|
||||
|
||||
CurParagraph := Page.AddParagraph();
|
||||
CurParagraph.AddText('Some text 2');
|
||||
|
||||
Vec.WriteToFile('text_output.odt', vfODT);
|
||||
finally
|
||||
|
@ -860,6 +860,8 @@ type
|
||||
ZoomLevel: Double; // 1 = 100%
|
||||
{ Selection fields }
|
||||
SelectedElement: TvEntity;
|
||||
// List of common styles, for conveniently finding them
|
||||
StyleTextBody, StyleHeading1, StyleHeading2, StyleHeading3: TvStyle;
|
||||
{ Base methods }
|
||||
constructor Create; virtual;
|
||||
destructor Destroy; override;
|
||||
@ -889,7 +891,7 @@ type
|
||||
function AddTextPageSequence(): TvTextPageSequence;
|
||||
{ Style methods }
|
||||
function AddStyle(): TvStyle;
|
||||
procedure AddStandardODTTextDocumentStyles;
|
||||
procedure AddStandardODTTextDocumentStyles();
|
||||
function GetStyleCount: Integer;
|
||||
function GetStyle(AIndex: Integer): TvStyle;
|
||||
function FindStyleIndex(AStyle: TvStyle): Integer;
|
||||
@ -5385,7 +5387,7 @@ begin
|
||||
FStyles.Add(Result);
|
||||
end;
|
||||
|
||||
procedure TvVectorialDocument.AddStandardODTTextDocumentStyles;
|
||||
procedure TvVectorialDocument.AddStandardODTTextDocumentStyles();
|
||||
var
|
||||
lTextBody, lBaseHeading, lCurStyle: TvStyle;
|
||||
begin
|
||||
@ -5400,6 +5402,7 @@ begin
|
||||
lTextBody.SetElements := [spbfFontSize, spbfFontName];
|
||||
lTextBody.MarginTop := 0;
|
||||
lTextBody.MarginBottom := 2.12;
|
||||
StyleTextBody := lTextBody;
|
||||
|
||||
// Headings
|
||||
|
||||
@ -5408,7 +5411,7 @@ begin
|
||||
// <style:text-properties style:font-name="Arial" fo:font-size="14pt" style:font-name-asian="Microsoft YaHei" style:font-size-asian="14pt" style:font-name-complex="Mangal" style:font-size-complex="14pt" />
|
||||
// </style:style>
|
||||
lBaseHeading := AddStyle();
|
||||
lBaseHeading.Name := 'Text Body';
|
||||
lBaseHeading.Name := 'Heading';
|
||||
lBaseHeading.Kind := vskHeading;
|
||||
lBaseHeading.Font.Size := 14;
|
||||
lBaseHeading.Font.Name := 'Arial';
|
||||
@ -5425,6 +5428,7 @@ begin
|
||||
lCurStyle.Font.Size := Round(1.15 * lBaseHeading.Font.Size);
|
||||
lCurStyle.Font.Bold := True;
|
||||
lCurStyle.SetElements := [spbfFontSize, spbfFontBold];
|
||||
StyleHeading1 := lCurStyle;
|
||||
|
||||
//<style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
|
||||
// <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold" />
|
||||
@ -5436,6 +5440,7 @@ begin
|
||||
lCurStyle.Font.Bold := True;
|
||||
lCurStyle.Font.Italic := True;
|
||||
lCurStyle.SetElements := [spbfFontSize, spbfFontBold, spbfFontItalic];
|
||||
StyleHeading2 := lCurStyle;
|
||||
|
||||
//<style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
|
||||
// <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold" />
|
||||
@ -5446,6 +5451,7 @@ begin
|
||||
lCurStyle.Font.Size := 14;
|
||||
lCurStyle.Font.Bold := True;
|
||||
lCurStyle.SetElements := [spbfFontSize, spbfFontName, spbfFontBold];
|
||||
StyleHeading3 := lCurStyle;
|
||||
|
||||
{
|
||||
<style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
|
||||
|
Loading…
Reference in New Issue
Block a user