JP2008065587A - Document editing apparatus and program - Google Patents

Document editing apparatus and program Download PDF

Info

Publication number
JP2008065587A
JP2008065587A JP2006242603A JP2006242603A JP2008065587A JP 2008065587 A JP2008065587 A JP 2008065587A JP 2006242603 A JP2006242603 A JP 2006242603A JP 2006242603 A JP2006242603 A JP 2006242603A JP 2008065587 A JP2008065587 A JP 2008065587A
Authority
JP
Japan
Prior art keywords
text
golden
golden rectangle
arrangement direction
rectangle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2006242603A
Other languages
Japanese (ja)
Other versions
JP4992350B2 (en
Inventor
Atsuji Nagahara
敦示 永原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2006242603A priority Critical patent/JP4992350B2/en
Publication of JP2008065587A publication Critical patent/JP2008065587A/en
Application granted granted Critical
Publication of JP4992350B2 publication Critical patent/JP4992350B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Document Processing Apparatus (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To create a document having an object with a good appearance, and well-balanced layout even if the amount of input object varies. <P>SOLUTION: A document editing apparatus is provided with: an object obtaining means for obtaining an object as data showing text; an orientation obtaining means for obtaining an orientation, i.e., the direction to layout the text contained in the object obtained by the object obtaining means; a temporary layout means for laying out the text within the area of a first golden rectangle whose two adjacent sides are in a golden ratio; a position determining means for determining the position of a side perpendicular to the orientation according to the amount of the text laid out within the area of the first golden rectangle; a golden rectangle generating means for generating a second golden rectangle with one side located in the position determined by the position determining means; and a layout changing means for changing the layout of the text so that the text fits within the second golden rectangle. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、文書を編集する際にレイアウトを自動的に行う技術に関する。   The present invention relates to a technique for automatically performing layout when editing a document.

データ化されたテキスト(文字列)または画像などのオブジェクト(デジタルコンテンツ)を含む文書を編集する技術が知られている。例えば特許文献1には、規定のテキスト領域にテキストを配置する技術が開示されている。また、特許文献2〜5には、人間に美しいと感じられる、審美性に優れた、またはバランスの取れた配置で文書を作成あるいはその支援をする技術が開示されている。   A technique for editing a document including data (character string) converted into data or an object (digital content) such as an image is known. For example, Patent Document 1 discloses a technique for arranging text in a prescribed text area. Patent Documents 2 to 5 disclose techniques for creating or supporting a document with an arrangement that is beautiful to human beings, excellent in aesthetics, or balanced.

特開2002−297571号公報JP 2002-297571 A 特開平8−180037号公報JP-A-8-180037 特開平10−289262号公報JP-A-10-289262 特開平10−301980号公報Japanese Patent Laid-Open No. 10-301980 特開2000−200354号公報JP 2000-200434 A

ここで、規定の領域にオブジェクトを配置するだけでは、生成される文書の審美性あるいは配置のバランスは配置されるオブジェクトの量によって変わってしまうという問題があった。
本発明は、入力されるオブジェクトの量が変わっても、審美性に優れた、バランスの取れた配置を有するオブジェクトを含む文書を作成する技術を提供する。
Here, there is a problem that the aesthetics or the balance of the arrangement of the generated document changes depending on the amount of the arranged objects only by arranging the objects in the prescribed area.
The present invention provides a technique for creating a document including an object having a balanced arrangement that is excellent in aesthetics even if the amount of input objects changes.

上述の課題を解決するため、本発明は、テキストを示すデータであるオブジェクトを取得するオブジェクト取得手段と、前記オブジェクト取得手段により取得されたオブジェクトに含まれるテキストが配置される方向である配置方向を取得する配置方向取得手段と、隣り合う2辺の長さの比が黄金比である第1の黄金矩形の領域内に、前記テキストを配置する仮レイアウト手段と、前記第1の黄金矩形の領域内に配置されたテキストの量に基づいて、前記配置方向と垂直な辺の位置を決定する位置決定手段と、1辺が前記位置決定手段により決定された位置にある第2の黄金矩形を生成する黄金矩形生成手段と、前記配置方向と垂直な方向において、前記テキストが前記第2の黄金矩形内に収まるように前記テキストの配置を変更する配置変更手段とを有する文書編集装置を提供する。この文書編集装置によれば、入力されるオブジェクトの量に応じて、審美性に優れた、バランスの取れた配置を有するオブジェクトを含む文書を作成することができる。   In order to solve the above-described problem, the present invention provides an object acquisition unit that acquires an object that is data indicating text, and an arrangement direction that is a direction in which the text included in the object acquired by the object acquisition unit is arranged. An arrangement direction acquisition unit to acquire, a temporary layout unit to arrange the text in a first golden rectangular area in which the ratio of the lengths of two adjacent sides is a golden ratio, and the first golden rectangular area Based on the amount of text placed in, position determination means for determining the position of a side perpendicular to the placement direction and a second golden rectangle having one side at the position determined by the position determination means A golden rectangle generating means for changing the arrangement of the text so that the text fits within the second golden rectangle in a direction perpendicular to the arrangement direction. To provide a document editing device having a means. According to this document editing apparatus, it is possible to create a document including an object having a balanced arrangement with excellent aesthetics according to the amount of input objects.

好ましい態様において、この文書編集装置は、前記テキストが、前記第1の領域内において複数行または複数列にわたって配置され、前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置に基づいて、前記配置方向と垂直な辺の位置を決定してもよい。   In a preferred aspect, in the document editing apparatus, the text is arranged over a plurality of lines or columns in the first region, and the position determining means is configured to start or end the text for all the lines or columns of the text. The position of the side perpendicular to the arrangement direction may be determined based on the position of at least one character.

別の好ましい態様において、この文書編集装置は、前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の最頻値に基づいて、前記配置方向と垂直な辺の位置を決定してもよい。   In another preferred embodiment, in the document editing apparatus, the position determining means is configured to determine the arrangement direction based on the mode value of the position of at least one of the first and last characters for all the rows or columns of the text. The position of the vertical side may be determined.

さらに別の好ましい態様において、この文書編集装置は、前記位置決定手段が、前記テキストの各行の文字数に基づいて、前記配置方向と垂直な辺の位置を決定してもよい。   In still another preferred aspect, in the document editing apparatus, the position determining means may determine the position of a side perpendicular to the arrangement direction based on the number of characters in each line of the text.

さらに別の好ましい態様において、この文書編集装置は、前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置との一致度が最大になるように、前記配置方向と垂直な辺の位置を決定してもよい。   In still another preferred aspect, the document editing apparatus is configured such that the position determination means has a maximum coincidence with the position of at least one of the first or last character for all the rows or columns of the text. The position of the side perpendicular to the arrangement direction may be determined.

さらに別の好ましい態様において、この文書編集装置は、少なくとも1つの特定の文字を示す識別子を記憶する記憶手段をさらに有し、前記位置決定手段が、前記テキストの行または列の先頭または末尾の少なくとも一方の文字が前記記憶手段に記憶された識別子により示される文字と一致するときは、その文字を除外して前記配置方向と垂直な辺の位置を決定してもよい。   In still another preferred aspect, the document editing apparatus further includes storage means for storing an identifier indicating at least one specific character, and the positioning means is at least at the beginning or end of the line or column of the text. When one character matches the character indicated by the identifier stored in the storage means, the position of the side perpendicular to the arrangement direction may be determined by excluding the character.

さらに別の好ましい態様において、この文書編集装置は、前記テキストが、前記第1の領域内において複数行または複数列にわたって配置され、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の分布が、あらかじめ決められた条件を満たすか判断する判断手段をさらに有し、前記判断手段により前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の分布が前記条件を満たすと判断された場合、前記位置決定手段が、前記第1の黄金矩形の1辺の位置を前記配置方向と垂直な辺の位置として決定し、かつ、前記黄金矩形生成手段が、前記第1の黄金矩形と同一の矩形を前記第2の黄金矩形として生成してもよい。   In still another preferred aspect, the document editing apparatus is configured such that the text is arranged in a plurality of lines or columns in the first region, and at least one of the first or last of all the lines or columns of the text. The distribution of the position of the character further includes a determination unit that determines whether a predetermined condition is satisfied, and the distribution of the position of at least one of the first or last character for all the rows or columns of the text by the determination unit Is determined to satisfy the condition, the position determining means determines the position of one side of the first golden rectangle as the position of the side perpendicular to the arrangement direction, and the golden rectangle generating means A rectangle identical to the first golden rectangle may be generated as the second golden rectangle.

さらに別の好ましい態様において、この文書編集装置は、前記オブジェクトを含むデータである文書において前記オブジェクトが配置される領域であるレイアウト領域を示す情報であるレイアウト領域情報を取得するレイアウト領域取得手段と、前記レイアウト領域取得手段により取得されたレイアウト領域情報により示されるレイアウト領域に、前記第2の黄金矩形に基づいて前記オブジェクトを配置する配置手段とをさらに有してもよい。   In still another preferred aspect, the document editing apparatus includes: a layout area acquisition unit that acquires layout area information that is information indicating a layout area that is an area in which the object is arranged in a document that is data including the object; You may further have the arrangement | positioning means which arrange | positions the said object based on the said 2nd golden rectangle in the layout area shown by the layout area information acquired by the said layout area acquisition means.

また、本発明は、コンピュータ装置を、テキストを示すデータであるオブジェクトを取得するオブジェクト取得手段と、前記オブジェクト取得手段により取得されたオブジェクトに含まれるテキストが配置される方向である配置方向を取得する配置方向取得手段と、隣り合う2辺の長さの比が黄金比である第1の黄金矩形の領域内に、前記テキストを配置する仮レイアウト手段と、前記第1の黄金矩形の領域内に配置されたテキストの量に基づいて、前記配置方向と垂直な辺の位置を決定する位置決定手段と、1辺が前記位置決定手段により決定された位置にある第2の黄金矩形を生成する黄金矩形生成手段と、前記配置方向と垂直な方向において、前記テキストが前記第2の黄金矩形内に収まるように前記テキストの配置を変更する配置変更手段として機能させるプログラムを提供する。   According to the present invention, the computer apparatus acquires an object acquisition unit that acquires an object that is data indicating text, and an arrangement direction that is a direction in which the text included in the object acquired by the object acquisition unit is arranged. An arrangement direction acquisition means, a temporary layout means for arranging the text in a first golden rectangle area in which the ratio of the lengths of two adjacent sides is a golden ratio, and a first golden rectangle area Based on the amount of text placed, position determining means for determining the position of a side perpendicular to the placement direction, and a golden for generating a second golden rectangle having one side at the position determined by the position determining means Rectangle generation means for changing the arrangement of the text so that the text fits within the second golden rectangle in a direction perpendicular to the arrangement direction. Providing a program to function as a unit.

1.第1実施形態
図1は、本発明の第1実施形態に係る文書編集装置100の機能構成を示すブロック図である。オブジェクト取得部101は、処理対象となるオブジェクトを取得する。「オブジェクト」とは、少なくともテキスト(文字列)を示すデータを含むデータをいう。「文書」とは、少なくとも1のオブジェクトと、オブジェクトが配置される領域を示す情報とを含むデータまたはそのデータに基づいて生成された結果物をいう。オブジェクトは、文書編集装置100内の記憶部(後述)から取得されてもよいし、文書編集装置100以外の他の装置から取得されてもよい。配置方向取得部102は、配置方向を示す情報を取得する。「配置方向」とは、テキストが配置される方向である。例えば、日本語であれば、配置方向は左から右または上から下である。英語であれば、配置方向は左から右である。配置方向は、文書編集装置100内の記憶部(後述)から取得されてもよいし、文書編集装置100以外の他の装置から取得されてもよい。仮レイアウト部103は、取得されたオブジェクトに含まれるテキストを、黄金矩形内に仮レイアウトする。仮レイアウト部103により生成される黄金矩形を、必要に応じて「第1の黄金矩形」という。なお、「黄金矩形」とは、隣り合う2辺の長さの比が次式(1)で示される比(いわゆる黄金比)である四角形をいう。なお、式(1)の右項と左項とは入れ替えられてもよい。

Figure 2008065587
1. First Embodiment FIG. 1 is a block diagram showing a functional configuration of a document editing apparatus 100 according to a first embodiment of the present invention. The object acquisition unit 101 acquires an object to be processed. “Object” refers to data including at least data indicating text (character string). “Document” refers to data including at least one object and information indicating an area where the object is arranged, or a result generated based on the data. The object may be acquired from a storage unit (described later) in the document editing apparatus 100, or may be acquired from a device other than the document editing apparatus 100. The arrangement direction acquisition unit 102 acquires information indicating the arrangement direction. “Arrangement direction” is a direction in which text is arranged. For example, in Japanese, the arrangement direction is left to right or top to bottom. For English, the orientation is from left to right. The arrangement direction may be acquired from a storage unit (described later) in the document editing apparatus 100, or may be acquired from a device other than the document editing apparatus 100. The temporary layout unit 103 temporarily lays out the text included in the acquired object in a golden rectangle. The golden rectangle generated by the temporary layout unit 103 is referred to as “first golden rectangle” as necessary. The “golden rectangle” refers to a quadrangle in which the ratio of the lengths of two adjacent sides is a ratio represented by the following formula (1) (so-called golden ratio). Note that the right term and the left term in the formula (1) may be interchanged.
Figure 2008065587

黄金矩形生成部104は、テキストの量および第1の黄金矩形に基づいて、新たな黄金矩形を生成する。黄金矩形生成部104により生成される黄金矩形を、必要に応じて「第2の黄金矩形」という。レイアウト部105は、第2の黄金矩形内に処理対象のテキストを配置する。   The golden rectangle generation unit 104 generates a new golden rectangle based on the text amount and the first golden rectangle. The golden rectangle generated by the golden rectangle generation unit 104 is referred to as a “second golden rectangle” as necessary. The layout unit 105 arranges the text to be processed in the second golden rectangle.

図2は、文書編集装置100のハードウェア構成を示すブロック図である。CPU(Central Processing Unit)110は、文書編集装置100の各構成要素を制御する制御装置である。ROM(Read Only Memory)120は、文書編集装置100の起動に必要なデータおよびプログラムを記憶する記憶装置である。RAM(Random Access Memory)130は、CPU110がプログラムを実行する際の作業領域として機能する記憶装置である。I/F(Interface)140は、種々の入出力装置や記憶装置との間でデータおよび制御信号の入出力をするインターフェースである。HDD(Hard Disk Drive)150は、各種プログラムおよびデータを記憶する記憶装置である。本実施形態に関して、HDD150は、文書の編集を行う文書編集プログラムを記憶している。キーボード・マウス160は、ユーザが文書編集装置100に対して指示入力を行うための入力装置である。ディスプレイ170は、データの内容あるいは処理の状況などを表示する出力装置である。ネットワークIF180は、ネットワーク(図示略)を介して接続された他の装置との間でデータの送受信を行うためのインターフェースである。文書編集装置100は、例えば、ネットワークおよびネットワークIF180を介して文書(正確には、文書を示す電子データ)を受信することができる。CPU110、ROM120、RAM130、およびI/F140は、バス190を介して接続されている。CPU110が文書編集プログラムを実行することにより、文書編集装置100は、図1に示される機能構成を備える。   FIG. 2 is a block diagram illustrating a hardware configuration of the document editing apparatus 100. A CPU (Central Processing Unit) 110 is a control device that controls each component of the document editing apparatus 100. A ROM (Read Only Memory) 120 is a storage device that stores data and programs necessary for starting up the document editing apparatus 100. A RAM (Random Access Memory) 130 is a storage device that functions as a work area when the CPU 110 executes a program. An I / F (Interface) 140 is an interface for inputting / outputting data and control signals to / from various input / output devices and storage devices. An HDD (Hard Disk Drive) 150 is a storage device that stores various programs and data. Regarding the present embodiment, the HDD 150 stores a document editing program for editing a document. The keyboard / mouse 160 is an input device for the user to input instructions to the document editing apparatus 100. The display 170 is an output device that displays data contents or processing status. The network IF 180 is an interface for transmitting and receiving data to and from other devices connected via a network (not shown). For example, the document editing apparatus 100 can receive a document (more precisely, electronic data indicating the document) via the network and the network IF 180. CPU 110, ROM 120, RAM 130, and I / F 140 are connected via a bus 190. When the CPU 110 executes the document editing program, the document editing apparatus 100 has the functional configuration shown in FIG.

図3は、文書編集装置100の動作を示すフローチャートである。ステップS100において、CPU110は、処理対象となるオブジェクトを取得する。オブジェクトは、HDD150から取得されてもよいし、ネットワークおよびネットワークIF180を介して文書編集装置100以外の他の装置から取得されてもよい。あるいは、オブジェクトは、ユーザがキーボード・マウス160を操作することにより文書編集装置100に入力されてもよい。本実施形態において、処理対象のオブジェクトは、以下のテキストを含む。「5月30日正午に発売する次世代プリンタXXXXX。このYYプリンタは、高速印刷性能ZZZZZppmを可能とし、2way給紙や両面印刷機能にも標準対応しながら、省スペース設計(SSSSSS)省エネルギーを実現しました。AAAAAAAAAAAAAAAAAAAAAA」。CPU110は、取得されたオブジェクトをHDD150に記憶する。   FIG. 3 is a flowchart showing the operation of the document editing apparatus 100. In step S100, the CPU 110 acquires an object to be processed. The object may be acquired from the HDD 150, or may be acquired from a device other than the document editing device 100 via the network and the network IF 180. Alternatively, the object may be input to the document editing apparatus 100 by the user operating the keyboard / mouse 160. In the present embodiment, the object to be processed includes the following text. “Next generation printer XXXXXX released at noon on May 30th. This YY printer is capable of high-speed printing performance ZZZZZZppm and realizes space-saving design (SSSSSS) energy saving while also supporting 2-way paper feeding and double-sided printing functions as standard. AAAAAAAAAAAAAAAAAAAAAAAAA "." CPU 110 stores the acquired object in HDD 150.

ステップS110において、CPU110は、テキストの配置方向を取得する。配置方向は、例えば、あらかじめ決められている。あるいは、配置方向は、処理対象のオブジェクトに基づいて決められてもよい。この場合、処理対象のオブジェクトは、配置方向を示す情報を含んでいる。あるいは別の例において、処理対象のオブジェクトは、そのテキストが記述されている言語(例えば、日本語)を示す情報を含んでいる。HDD150は、言語の識別子と、その言語に対応する配置方向を示す情報を記憶している。CPU110は、HDD150に記憶された情報に基づいて、配置方向を決定する。さらにあるいは、配置方向は、処理対象の文書に基づいて決められてもよい。この場合、処理対象の文書は、配置方向を示す情報を含んでいる。以下において、配置方向が「左から右」である例について説明する。   In step S110, CPU 110 obtains the text layout direction. The arrangement direction is determined in advance, for example. Alternatively, the arrangement direction may be determined based on the object to be processed. In this case, the object to be processed includes information indicating the arrangement direction. Alternatively, in another example, the processing target object includes information indicating a language (for example, Japanese) in which the text is described. The HDD 150 stores a language identifier and information indicating an arrangement direction corresponding to the language. CPU 110 determines the arrangement direction based on information stored in HDD 150. Further alternatively, the arrangement direction may be determined based on the document to be processed. In this case, the document to be processed includes information indicating the arrangement direction. Hereinafter, an example in which the arrangement direction is “left to right” will be described.

ステップS120において、CPU110は、処理対象のオブジェクトに含まれるテキストを仮レイアウトする。ここでは、テキストを配置したときに、その外接図形が黄金矩形となるように、オブジェクトの配置情報が生成される。すなわち、オブジェクトは編集される。   In step S120, the CPU 110 provisionally lays out text included in the processing target object. Here, when the text is arranged, the object arrangement information is generated so that the circumscribed figure becomes a golden rectangle. That is, the object is edited.

図4は、仮レイアウト処理の詳細を示すフローチャートである。ステップS121において、CPU110は、処理対象のオブジェクトを一時レイアウトする。処理対象のオブジェクトが配置される領域、すなわちレイアウト領域は、あらかじめ決められている。あるいは、レイアウト領域は、ユーザの指示入力に応じて決定されてもよい。あるいは、レイアウト領域は、あらかじめ決められたアルゴリズムに従ってCPU110により決定されてもよい。   FIG. 4 is a flowchart showing details of the temporary layout processing. In step S121, the CPU 110 temporarily lays out an object to be processed. The area where the object to be processed is arranged, that is, the layout area, is determined in advance. Alternatively, the layout area may be determined according to a user instruction input. Alternatively, the layout area may be determined by the CPU 110 according to a predetermined algorithm.

図5は、一時レイアウトされたオブジェクトを例示する図である。レイアウト領域Dは、例えば、A4サイズの大きさを有する。オブジェクト領域Lは、レイアウト領域Dのうち、処理対象のオブジェクトが配置される領域を示す。すなわち、オブジェクト領域は、文書編集装置100により編集される文書の出力単位(例えばページ)に相当する領域であるレイアウト領域のうち、オブジェクトが配置される領域を限定するものである。オブジェクト領域Lは、処理対象のオブジェクトの量(例えば、テキストの文字数)およびオブジェクト属性情報に基づいて決定される。例えば、オブジェクト領域Lは、レイアウト領域Dのうちある点(例えば、中心点)を基準として、テキストをオブジェクト属性情報に従って配置することにより決定される。すなわち、オブジェクトの文字列は、オブジェクト属性情報で指定される行間、フォントサイズ、フォント種別およびスタイルで配置される。このとき、一時レイアウトに行間の影響を反映させるため、レイアウト領域Dは、文字列が複数行(配置方向は上下方向の場合は複数列)に表示されるように決定される。例えば、一時レイアウトにおいて文字列は4行に配置されるというルールがあらかじめ決められている。CPU110は、このルールに従って文字列を配置し、レイアウト領域Dを決定する。一時レイアウトは、RAM130上で仮想的に行われてもよい。あるいは、一時レイアウトの結果は、ディスプレイ170に表示されてもよい。   FIG. 5 is a diagram illustrating the temporarily laid out object. The layout area D has an A4 size, for example. The object area L indicates an area in the layout area D where an object to be processed is arranged. In other words, the object area limits the area in which the object is arranged in the layout area that is an area corresponding to an output unit (for example, a page) of a document edited by the document editing apparatus 100. The object area L is determined based on the amount of objects to be processed (for example, the number of text characters) and object attribute information. For example, the object area L is determined by arranging text according to the object attribute information with a certain point (for example, the center point) in the layout area D as a reference. That is, the character string of the object is arranged with the line spacing, font size, font type, and style specified by the object attribute information. At this time, in order to reflect the influence between the lines in the temporary layout, the layout area D is determined so that the character strings are displayed in a plurality of lines (a plurality of columns when the arrangement direction is the vertical direction). For example, a rule that character strings are arranged in four lines in the temporary layout is predetermined. The CPU 110 arranges character strings according to this rule and determines the layout area D. The temporary layout may be virtually performed on the RAM 130. Alternatively, the result of the temporary layout may be displayed on the display 170.

オブジェクト属性情報とは、個々のオブジェクトの属性を示す情報である。オブジェクト属性情報は、例えば、属性の種類を示す属性識別子と、その属性の値を含むデータセットを含んでいる。オブジェクト属性情報は、例えば、属性識別子として、「行間」、「フォントサイズ」、「フォント種別」および「スタイル」を、これらの属性の値として、「1.5行」、「24ポイント」、「ゴシック」および「Bold」という情報を含んでいる。属性「行間」は、テキストの行間を示す。属性「フォントサイズ」はフォントの大きさを示す。属性「フォント種別」はフォントの種類を示す。属性「スタイル」は表示される際のスタイル、すなわち、標準、斜体、太字のいずれかを示す。オブジェクト属性情報の取得方法は任意である。   The object attribute information is information indicating the attribute of each object. The object attribute information includes, for example, a data set including an attribute identifier indicating the type of the attribute and the value of the attribute. The object attribute information includes, for example, “line spacing”, “font size”, “font type”, and “style” as attribute identifiers, and “1.5 lines”, “24 points”, “ The information includes “Gothic” and “Bold”. The attribute “line spacing” indicates the text line spacing. The attribute “font size” indicates the size of the font. The attribute “font type” indicates the type of font. The attribute “style” indicates a style to be displayed, that is, standard, italic, or bold. The method for acquiring the object attribute information is arbitrary.

再び図4を参照して説明する。ステップS122において、CPU110は、オブジェクト領域Lの2辺の長さ、すなわち幅wおよび高さhを測定する。例えば、CPU110は、オブジェクト(テキスト)の外接矩形を求める。CPU110は、得られた外接矩形の幅および高さを測定する。このとき、CPU110は、オブジェクトの周囲にあらかじめ決められた余白を設けてもよい。CPU110は、余白も含めて外接矩形を求めてもよい。あるいは、CPU110は、仮レイアウトされたテキストが収まるようなテキストボックスを設定し、その幅および高さを求めてもよい。   A description will be given with reference to FIG. 4 again. In step S122, the CPU 110 measures the lengths of the two sides of the object region L, that is, the width w and the height h. For example, the CPU 110 obtains a circumscribed rectangle of the object (text). The CPU 110 measures the width and height of the circumscribed rectangle obtained. At this time, the CPU 110 may provide a predetermined margin around the object. The CPU 110 may obtain a circumscribed rectangle including a margin. Alternatively, the CPU 110 may set a text box that can accommodate the temporarily laid out text, and obtain the width and height thereof.

ステップS123において、CPU110は、次式(2)に従って黄金矩形の一辺の長さAを算出する。

Figure 2008065587
In step S123, the CPU 110 calculates the length A of one side of the golden rectangle according to the following equation (2).
Figure 2008065587

なお、式(2)は、次式(3)に基づいて得られたものである。式(3)は、黄金矩形とオブジェクト領域Lの面積が等しいという条件から導かれる。

Figure 2008065587
In addition, Formula (2) is obtained based on following Formula (3). Equation (3) is derived from the condition that the area of the golden rectangle and the object region L are equal.
Figure 2008065587

ステップS124において、CPU110は、黄金矩形の他辺の長さA’を次式(4)に従って算出する。このようにして、第1の黄金矩形の辺の長さが決定される。

Figure 2008065587
In step S124, the CPU 110 calculates the length A ′ of the other side of the golden rectangle according to the following equation (4). In this way, the length of the side of the first golden rectangle is determined.
Figure 2008065587

ステップS125において、CPU110は、黄金矩形に配置されるようにオブジェクトを編集する。すなわち、CPU110は、テキストの仮レイアウトを決定する。これは例えば以下のように行われる。CPU110は、処理対象のオブジェクトに含まれる文字を先頭から順番に配置する。配置された文字の幅がA’に達すると、CPU110は、改行を挿入する。同様に文字列を2行目にも配置し、2行目に配置された文字の幅がA’に達すると、CPU110は、再び改行を挿入する。このようにして、黄金矩形に配置されたオブジェクトが得られる。   In step S125, the CPU 110 edits the object so as to be arranged in the golden rectangle. That is, the CPU 110 determines a temporary layout of text. This is done, for example, as follows. The CPU 110 arranges characters included in the processing target object in order from the top. When the width of the arranged character reaches A ′, the CPU 110 inserts a line feed. Similarly, the character string is also arranged on the second line, and when the width of the character arranged on the second line reaches A ′, the CPU 110 inserts a new line again. In this way, an object arranged in a golden rectangle is obtained.

あるいは、CPU110は、高さA、幅A’の大きさを有する領域をテキスト領域として決定してもよい。CPU110は、テキスト領域に、オブジェクトに含まれる文字列を流し込む、すなわち、テキスト領域内に収まるように文字を配置することにより黄金矩形に配置されたオブジェクトを得てもよい。   Alternatively, the CPU 110 may determine an area having a height A and a width A ′ as a text area. The CPU 110 may obtain the object arranged in the golden rectangle by pouring the character string included in the object into the text area, that is, arranging the characters so as to fit in the text area.

図6は、形成された黄金矩形(第1の黄金矩形)を例示する図である。このように、オブジェクトは黄金矩形に収まるように配置される。   FIG. 6 is a diagram illustrating the formed golden rectangle (first golden rectangle). In this way, the objects are arranged so as to fit in the golden rectangle.

再び図3を参照して説明する。ステップS130において、CPU110は、第2の黄金矩形を生成する。   A description will be given with reference to FIG. 3 again. In step S130, the CPU 110 generates a second golden rectangle.

図7は、第1実施形態に係る黄金矩形生成処理の詳細を示すフローチャートである。ステップS131において、CPU110は、テキスト配置情報を取得する。テキスト配置情報は、黄金矩形内におけるテキストの配置を指定する情報である。テキスト配置情報として、例えば、「右揃え」、「左揃え」、「上揃え」および「下揃え」などが用いられる。テキスト配置情報の取得方法は任意である。例えば、テキスト配置情報はあらかじめ決められていてもよい。あるいは、テキスト配置情報は、処理対象のオブジェクトに基づいて決められてもよい。この場合、処理対象のオブジェクトは、テキスト配置情報を示す情報を含んでいる。あるいは別の例において、処理対象のオブジェクトは、そのテキストが記述されている言語(例えば、日本語)を示す情報を含んでいる。HDD150は、言語の識別子と、その言語に対応するテキスト配置情報を示す情報を記憶している。CPU110は、HDD150に記憶された情報に基づいて、テキスト配置情報を決定する。さらにあるいは、テキスト配置情報は、処理対象の文書に基づいて決められてもよい。この場合、処理対象の文書は、テキスト配置情報を示す情報を含んでいる。以下において、テキスト配置情報が「左揃え」である例について説明する。   FIG. 7 is a flowchart showing details of the golden rectangle generation processing according to the first embodiment. In step S131, the CPU 110 acquires text arrangement information. The text arrangement information is information that specifies the arrangement of the text in the golden rectangle. As the text arrangement information, for example, “right alignment”, “left alignment”, “top alignment”, “bottom alignment”, and the like are used. The method for acquiring the text arrangement information is arbitrary. For example, the text arrangement information may be determined in advance. Alternatively, the text arrangement information may be determined based on the object to be processed. In this case, the object to be processed includes information indicating text arrangement information. Alternatively, in another example, the processing target object includes information indicating a language (for example, Japanese) in which the text is described. The HDD 150 stores information indicating a language identifier and text arrangement information corresponding to the language. CPU 110 determines text arrangement information based on information stored in HDD 150. Further alternatively, the text arrangement information may be determined based on the document to be processed. In this case, the document to be processed includes information indicating text arrangement information. Hereinafter, an example in which the text arrangement information is “left alignment” will be described.

ステップS132において、CPU110は、第1の黄金矩形を構成する4つの辺のうち、処理対象となる辺である対象辺を決定する。対象辺の候補となるのは、テキストの配置方向と垂直な辺である。いま配置方向は「左から右」なので、対象辺の候補となるのは第1の黄金矩形の左辺および右辺である。CPU110は、さらに、対象辺の候補から、テキスト配置情報に基づいて対象辺を決定する。ここでは、テキスト配置情報で指定される基準位置と逆の位置に対応する辺が、対象辺として決定される。基準位置とは、例えば、テキスト配置情報が「左揃え」の場合は左、「右揃え」の場合は右、「上揃え」の場合は上、「下揃え」の場合は下である。基準位置と逆の位置とは、例えば、テキスト配置情報が「左揃え」の場合は右、「右揃え」の場合は左、「上揃え」の場合は下、「下揃え」の場合は上である。いまテキスト配置情報は「左揃え」なので、基準位置と逆の位置に対応する辺は、右辺である。このように、CPU110は、右辺を対象辺として決定する。   In step S132, the CPU 110 determines a target side that is a side to be processed among the four sides constituting the first golden rectangle. The candidate for the target side is a side perpendicular to the text arrangement direction. Since the arrangement direction is “from left to right”, candidates for the target side are the left side and the right side of the first golden rectangle. The CPU 110 further determines the target side based on the text arrangement information from the target side candidates. Here, the side corresponding to the position opposite to the reference position specified by the text arrangement information is determined as the target side. The reference position is, for example, left when the text arrangement information is “left aligned”, right when “right aligned”, up when “upper aligned”, and lower when “bottom aligned”. The position opposite to the reference position is, for example, right if the text alignment information is “Left Alignment”, left if “Right Alignment”, bottom if “Top Align”, and top if “Align Bottom”. It is. Since the text arrangement information is now “left aligned”, the side corresponding to the position opposite to the reference position is the right side. Thus, the CPU 110 determines the right side as the target side.

ステップS133において、CPU110は、複数行に一時レイアウトされたテキストの各行について、行末の座標を取得する。図6の例では、テキストは6行に分けてレイアウトされる。例えば、1〜6行目の行末座標は、それぞれ、15、15、17、15、15、12であると算出される。本実施形態では、行末座標の単位はcm(センチメートル)である。また、座標は0.5を最小単位として計測され、0.5に満たない値は切り上げられる。なお、座標の単位および計測の最小単位はこれらに限定されるものではない。また、ここで行末座標が用いられるのは、テキストが横書きの言語で記述されており、かつ、対象辺が右辺だからである。どの辺が対象辺であるかに応じて、先頭または末尾のいずれが用いられるかが決定される。テキストが横書きの場合には行頭または行末の少なくとも一方の文字が、テキストが縦書きの場合には列頭または列末の文字が用いられる。一般的には、すべての行または列についての先頭または末尾の少なくとも一方の文字が用いられる。   In step S133, the CPU 110 acquires the coordinates of the end of the line for each line of text temporarily laid out on a plurality of lines. In the example of FIG. 6, the text is laid out in six lines. For example, the end coordinates of the first to sixth lines are calculated to be 15, 15, 17, 15, 15, and 12, respectively. In this embodiment, the unit of line end coordinates is cm (centimeter). The coordinates are measured with 0.5 as a minimum unit, and values less than 0.5 are rounded up. Note that the coordinate unit and the minimum unit of measurement are not limited to these. The line end coordinates are used here because the text is written in a horizontally written language and the target side is the right side. Depending on which side is the target side, it is determined which of the beginning or end is used. When the text is written horizontally, at least one character at the beginning or end of the line is used, and when the text is written vertically, the character at the beginning or end of the column is used. In general, at least one character at the beginning or end of every row or column is used.

ステップS134において、CPU110は、代表座標を決定する。代表座標は、第2の黄金矩形の辺の長さを決めるのに用いられる。CPU110は、行末座標に基づいて、あらかじめ決められたアルゴリズムに従って代表座標を決定する。本実施形態において、代表座標は、複数の行末座標のうち最も頻度が高い値として算出される。すなわち、本実施形態において、代表座標は15である。あるいは、代表座標は、複数の行末座標の平均値として算出されてもよい。平均値を算出する際には、最終行などその値が特異であると考えられる行は除外されてもよい。   In step S134, the CPU 110 determines representative coordinates. The representative coordinates are used to determine the length of the side of the second golden rectangle. CPU 110 determines representative coordinates according to a predetermined algorithm based on the end-of-line coordinates. In the present embodiment, the representative coordinates are calculated as a value having the highest frequency among a plurality of line end coordinates. That is, in this embodiment, the representative coordinate is 15. Alternatively, the representative coordinates may be calculated as an average value of a plurality of line end coordinates. When calculating the average value, a line in which the value is considered to be unique, such as the last line, may be excluded.

ステップS135において、CPU110は、第2の黄金矩形を決定する。まず、CPU110は、第2の黄金矩形の対象辺(ここでは右辺)の位置を、代表座標に基づいて決定する。すなわち、CPU110は、第2の黄金矩形の右辺の位置を、左辺の位置から15cmの位置に決定する。なお、第1の黄金矩形と第2の黄金矩形において、対象辺と向かい合う辺(ここでは左辺)の位置は同一である。このようにして、CPU110は、第2の黄金矩形において、テキストの配置方向と垂直な辺(ここでは右辺および左辺)の位置を決定する。すなわち、CPU110は、第2の黄金矩形において、テキストの配置方向と平行な辺(ここでは上辺および下辺)の長さを決定する。   In step S135, the CPU 110 determines a second golden rectangle. First, the CPU 110 determines the position of the target side (here, the right side) of the second golden rectangle based on the representative coordinates. That is, the CPU 110 determines the position of the right side of the second golden rectangle as a position 15 cm from the position of the left side. Note that, in the first golden rectangle and the second golden rectangle, the position of the side facing the target side (here, the left side) is the same. In this way, the CPU 110 determines the positions of the sides (here, the right side and the left side) perpendicular to the text arrangement direction in the second golden rectangle. In other words, CPU 110 determines the length of sides (here, the upper side and the lower side) parallel to the text arrangement direction in the second golden rectangle.

CPU110は、さらに、第2の黄金矩形において、テキストの配置方向と垂直な辺(ここでは右辺および左辺)の長さを決定する。右辺および左辺の長さは、上辺および下辺の長さとの比が黄金比になるように決定される。また、右辺および左辺の位置は、例えば、ある基準点(例えば、左辺の上端、中点または下端など)が第1の黄金矩形と第2の黄金矩形とで同一となるように決定される。以上のようにして、第2の黄金矩形の位置および大きさが決定される。   CPU 110 further determines the length of sides (here, the right side and the left side) perpendicular to the text arrangement direction in the second golden rectangle. The lengths of the right side and the left side are determined so that the ratio of the lengths of the upper side and the lower side becomes the golden ratio. Further, the positions of the right side and the left side are determined so that, for example, a certain reference point (for example, the upper end, middle point, or lower end of the left side) is the same for the first golden rectangle and the second golden rectangle. As described above, the position and size of the second golden rectangle are determined.

第2の黄金矩形は、第1の黄金矩形よりも面積が小さくなる場合がある。そこでCPU110は、第2の黄金矩形の、テキストの配置方向と垂直な辺の長さに基づいて、テキストの配置を更新する。ここでは、CPU110は、右辺(または左辺)の長さに応じて、行の間隔を更新する。すなわち、上下方向においてテキストが第2の黄金矩形からはみ出ないように、行間が縮められる。   The second golden rectangle may have a smaller area than the first golden rectangle. Therefore, the CPU 110 updates the text layout based on the length of the side of the second golden rectangle perpendicular to the text layout direction. Here, the CPU 110 updates the row spacing according to the length of the right side (or the left side). That is, the line spacing is shortened so that the text does not protrude from the second golden rectangle in the vertical direction.

ステップS136において、CPU110は、テキストのレイアウトを決定する。すなわち、CPU110は、テキストのレイアウトを示す情報および第2の黄金矩形を特定する情報を、RAM130に記憶する。第2の黄金矩形を特定する情報は、例えば、4つの頂点の座標である。以下、第2の黄金矩形を特定する情報およびテキストのレイアウトを示す情報を含む情報を、「属性情報」という。オブジェクトと、そのオブジェクトに対応する属性情報とは、一方から他方を特定できるようにRAM130またはHDD150に記憶される。   In step S136, CPU 110 determines a text layout. That is, CPU 110 stores information indicating the layout of the text and information specifying the second golden rectangle in RAM 130. The information specifying the second golden rectangle is, for example, the coordinates of four vertices. Hereinafter, information including information specifying the second golden rectangle and information indicating a text layout is referred to as “attribute information”. The object and the attribute information corresponding to the object are stored in the RAM 130 or the HDD 150 so that one can be specified from the other.

図8は、第2の黄金矩形を例示する図である。対象辺であった右辺において、一部の文字が黄金矩形からはみ出しているが、それ以外の辺において、文字が黄金矩形からはみ出しているところはない。   FIG. 8 is a diagram illustrating a second golden rectangle. On the right side, which is the target side, some characters protrude from the golden rectangle, but on the other sides, no character protrudes from the golden rectangle.

再び図3を参照して説明する。ステップS140において、CPU110は、黄金矩形に配置されたオブジェクトを、レイアウト領域Dに配置する。オブジェクトを配置する位置は、あらかじめ決められていてもよい。あるいは、オブジェクトを配置する位置は、ユーザの指示入力に応じて決定されてもよい。処理対象のオブジェクトが配置されることにより、文書が生成される。ユーザは、以上のように生成された文書に対して、公知の文書編集技術によるソフトウェアを用いて、文書を編集することができる。その際、第2の黄金矩形は、いわゆるグリッド矩形として機能することができる。グリッド矩形として機能させる場合、CPU110は、第2の黄金矩形をディスプレイ170に表示する。   A description will be given with reference to FIG. 3 again. In step S140, the CPU 110 arranges the object arranged in the golden rectangle in the layout area D. The position where the object is arranged may be determined in advance. Or the position which arrange | positions an object may be determined according to a user's instruction | indication input. A document is generated by arranging objects to be processed. The user can edit the document generated as described above by using software based on a known document editing technique. At that time, the second golden rectangle can function as a so-called grid rectangle. When functioning as a grid rectangle, the CPU 110 displays the second golden rectangle on the display 170.

以上で説明したように本実施形態によれば、グリッド矩形は対応するオブジェクトに応じてダイナミックに形成される。図8に示される例では、右辺においてはみ出しいている文字が存在する。しかし、このような文字も、行末座標の分布という観点からは特異と考えることができるものである。したがって、むしろこのような特異点を無視するようにグリッド矩形(黄金矩形)を形成した方が、レイアウトの審美性という観点において優れた文書を作成することができる。   As described above, according to the present embodiment, the grid rectangle is dynamically formed according to the corresponding object. In the example shown in FIG. 8, there is a character that protrudes on the right side. However, such characters can also be considered unique from the viewpoint of the distribution of line end coordinates. Therefore, if a grid rectangle (golden rectangle) is formed so as to ignore such singular points, a document excellent in terms of layout aesthetics can be created.

2.第2実施形態
続いて、本発明の第2実施形態について説明する。以下において、第1実施形態と共通する事項についてはその説明を省略する。また、第1実施形態と共通する要素については共通の参照符号が用いられる。本実施形態においては、図3のステップS130の黄金矩形を生成する処理が、第1実施形態で説明したものと異なる。
2. Second Embodiment Subsequently, a second embodiment of the present invention will be described. In the following, description of matters common to the first embodiment is omitted. In addition, common reference numerals are used for elements common to the first embodiment. In the present embodiment, the processing for generating the golden rectangle in step S130 of FIG. 3 is different from that described in the first embodiment.

図9は、第2実施形態に係る黄金矩形生成処理の詳細を示すフローチャートである。ステップS131〜S134の処理は第1実施形態において説明したものと同様であるので説明を省略する。ステップS201において、CPU110は、その行末座標が代表座標よりも大きい、すなわち行末座標が代表座標を超えた行の数を取得する。いま1〜6行目の行末座標は、それぞれ、15、15、17、15、15、12であり、代表座標は15である。従って、代表座標を超えた行の数は1である。   FIG. 9 is a flowchart showing details of the golden rectangle generation processing according to the second embodiment. Since the processing of steps S131 to S134 is the same as that described in the first embodiment, a description thereof will be omitted. In step S201, the CPU 110 obtains the number of lines whose line end coordinates are larger than the representative coordinates, that is, the line end coordinates exceeding the representative coordinates. The end coordinates of the first to sixth lines are 15, 15, 17, 15, 15, and 12, respectively, and the representative coordinates are 15. Therefore, the number of rows exceeding the representative coordinate is 1.

ステップS202において、CPU110は、行末座標が代表座標を超えた行の割合rを算出する。いまテキストは6行に配置され、行末座標が代表座標を超えたのは1行である。したがって、割合r=1/6=17%であると算出される。   In step S <b> 202, the CPU 110 calculates the ratio r of lines where the line end coordinates exceed the representative coordinates. Now, the text is arranged in 6 lines, and the line end coordinate exceeds the representative coordinate is 1 line. Therefore, the ratio r = 1/6 = 17% is calculated.

ステップS203において、CPU110は、割合rがしきい値rth(例えば、rth=25%)を超えているか判断する。割合rが、r<rthを満たす場合(S203:YES)、CPU110は、処理をステップS135に移行する。すなわち、CPU110は、第1実施形態と同様に、第2の黄金矩形を生成する。割合rが、r<rthを満たさない場合(S203:NO)、CPU110は、処理をステップS204に移行する。 In step S203, the CPU 110 determines whether the ratio r exceeds a threshold value r th (for example, r th = 25%). When the ratio r satisfies r <r th (S203: YES), the CPU 110 shifts the processing to step S135. That is, the CPU 110 generates a second golden rectangle as in the first embodiment. When the ratio r does not satisfy r <r th (S203: NO), the CPU 110 shifts the processing to step S204.

ステップS204において、CPU110は、第1の黄金矩形をそのまま、第2の黄金矩形として用いることを決定する。以後の処理は第1実施形態と同様である。   In step S204, the CPU 110 determines to use the first golden rectangle as it is as the second golden rectangle. The subsequent processing is the same as in the first embodiment.

以上で説明したように、本実施形態によれば、行末座標が代表座標を超えている行の割合に応じて、第2の黄金矩形を新たに生成するか、第1の黄金矩形をそのまま用いるかが決定される。行末座標が代表座標を超えている行の割合があるしきい値を超えた場合には、これらの行を無視してしまうとレイアウトの審美性がかえって悪化してしまう場合もある。しかし、本実施形態によれば、この問題も解決される。   As described above, according to the present embodiment, the second golden rectangle is newly generated or the first golden rectangle is used as it is, depending on the proportion of the rows whose end coordinates exceed the representative coordinates. Is determined. If the percentage of lines whose end-of-line coordinates exceed the representative coordinates exceeds a certain threshold, ignoring the layout may deteriorate if these lines are ignored. However, according to the present embodiment, this problem is also solved.

3.他の実施形態
本発明は上述の実施形態に限定されるものではなく、種々の変形実施が可能である。
上述の実施形態において、テキスト配置情報が「左揃え」である場合について説明した。例えば、テキスト配置情報が「中央揃え」である場合、CPU110は、左辺および右辺の2つの辺を対象辺として決定してもよい。この場合、対象辺の位置は、例えば第1の黄金矩形において、上辺と下辺の中点を結ぶ線を基準として定められてもよい。
3. Other Embodiments The present invention is not limited to the above-described embodiments, and various modifications can be made.
In the above-described embodiment, the case where the text arrangement information is “left alignment” has been described. For example, when the text arrangement information is “center alignment”, the CPU 110 may determine two sides of the left side and the right side as target sides. In this case, the position of the target side may be determined with reference to a line connecting the midpoints of the upper side and the lower side in the first golden rectangle, for example.

上述の実施形態において、行末座標を取得する際に、テキストの内容については考慮されなかった。しかし、行末座標を取得する際に、テキストの内容が考慮されてもよい。例えば、行末座標を取得する際に、特定の文字(例えば、「、」や「。」など)が除外されてもよい。すなわち、HDD150は、除外対象となる文字の識別子を記憶している。CPU110は、HDD150に除外対象の文字として記憶されている文字については、行末の文字から除外して行末座標を取得する。例えば、除外対象の文字として、「、」、「。」などの句読点、「い」、「て」など線の密度が低い平仮名などが指定されてもよい。   In the above-described embodiment, the content of the text is not considered when acquiring the end-of-line coordinates. However, the content of the text may be taken into account when acquiring the end-of-line coordinates. For example, when acquiring the end-of-line coordinates, specific characters (for example, “,”, “.”, Etc.) may be excluded. That is, the HDD 150 stores identifiers of characters to be excluded. CPU 110 excludes characters stored as exclusion target characters in HDD 150 from the characters at the end of the line, and acquires the end-of-line coordinates. For example, punctuation marks such as “,” and “.”, Hiragana characters having a low line density such as “i” and “te” may be designated as the characters to be excluded.

図10は、他の実施形態に係るテキストを例示する図である。第1行目の行末に「。」があるが、行末座標を取得する際には、この文字は無視される。このように、行末座標の取得に際して特定の文字を除外することによって、より審美性に優れた黄金矩形を生成することができる。   FIG. 10 is a diagram illustrating text according to another embodiment. “.” Is present at the end of the first line, but this character is ignored when the end-of-line coordinates are acquired. Thus, by excluding specific characters when acquiring the end-of-line coordinates, a golden rectangle with better aesthetics can be generated.

また、第2の黄金矩形の生成に際し、行頭について、特定の文字が除外されてもよい。
図11および図12は、他の実施形態に係るテキストを例示する図である。各行の行頭に、箇条書きを示す記号「・」が存在する。CPU110は、第2の黄金矩形の生成に際し、これらの文字(記号)を対象から除外してもよい(図12)。この処理は、例えば以下のように行われる。対象辺の位置が決定された後、CPU110は、行頭についても、行末の場合と同様に、行頭座標を算出する。さらに、CPU110は、行頭座標について、その代表座標を算出する。CPU110は、代表座標に基づいて、対象辺と対向する辺(左辺)の位置を決定する。CPU110は、対象辺(右辺)および対象辺と対向する辺(左辺)の位置に基づいて、対象辺(右辺)および対象辺と対向する辺(左辺)の長さを決定する。
In addition, when the second golden rectangle is generated, a specific character may be excluded from the beginning of the line.
11 and 12 are diagrams illustrating text according to another embodiment. At the beginning of each line, there is a symbol “•” indicating a bulleted list. The CPU 110 may exclude these characters (symbols) from the object when generating the second golden rectangle (FIG. 12). This process is performed as follows, for example. After the position of the target side is determined, the CPU 110 calculates the line head coordinates for the head of the line as in the case of the end of the line. Furthermore, CPU110 calculates the representative coordinate about a line head coordinate. The CPU 110 determines the position of the side (left side) facing the target side based on the representative coordinates. The CPU 110 determines the length of the target side (right side) and the side (left side) facing the target side based on the position of the target side (right side) and the side (left side) facing the target side.

行末の場合と同様に、HDD150は、除外対象となる文字の識別子を記憶している。CPU110は、HDD150に除外対象の文字として記憶されている文字については、行頭の文字から除外して行末座標を取得する。例えば、除外対象の文字として、「・」、「●」、「■」などの記号、「(1)」、「(2)」、「(a)」、「(b)」などの番号が指定されてもよい。すなわち、いずれかの行において、行頭あるいは行末のように所定の位置にこれらの除外対象文字が存在した場合、その行のその文字については行末座標あるいは行頭座標の算出対象から除外される。   As in the case of the end of the line, the HDD 150 stores the identifier of the character to be excluded. CPU 110 obtains the end-of-line coordinates by excluding the characters stored in HDD 150 as characters to be excluded from the characters at the beginning of the line. For example, the characters to be excluded include symbols such as “•”, “●”, “■”, and numbers such as “(1)”, “(2)”, “(a)”, “(b)”. May be specified. That is, if any of these characters to be excluded exists at a predetermined position such as the beginning or end of a line in any line, that character on that line is excluded from the calculation target of the end-of-line coordinates or the beginning of the line.

また、上述の実施形態においては、第1の黄金矩形内に配置されたテキストの各行の行末の座標に基づいて第2の黄金矩形の一辺の長さが決められた。しかし、第2の黄金矩形の一辺の長さを決めるのに用いられるパラメータは、これに限定されない。例えば、CPU110は、各行に含まれる文字の数に基づいて、第2の黄金矩形の一辺の長さを決めてもよい。要は、各行の文字の量を示すパラメータであれば、どのようなものが用いられてもよい。   In the above-described embodiment, the length of one side of the second golden rectangle is determined based on the coordinates of the end of each line of the text arranged in the first golden rectangle. However, the parameter used to determine the length of one side of the second golden rectangle is not limited to this. For example, the CPU 110 may determine the length of one side of the second golden rectangle based on the number of characters included in each line. In short, any parameter indicating the amount of characters in each line may be used.

また、上述の実施形態においては、第1の黄金矩形内に配置されたテキストの行末座標の最頻値に基づいて、第2の黄金矩形の一辺の位置が決められた。しかし、第2の黄金矩形の一辺の位置を決める方法は、これに限定されるものではない。複数の行末座標と、第2の黄金矩形の一辺の位置との一致度が最大となるものであれば、どのような方法が用いられてもよい。   In the above-described embodiment, the position of one side of the second golden rectangle is determined based on the mode value of the end-of-line coordinates of the text arranged in the first golden rectangle. However, the method for determining the position of one side of the second golden rectangle is not limited to this. Any method may be used as long as the degree of coincidence between the plurality of line end coordinates and the position of one side of the second golden rectangle is maximized.

上述の実施形態において、第2の黄金矩形は第1の黄金矩形と区別して説明された。しかし、第2の黄金矩形を生成する処理は、第1の黄金矩形の辺の位置や長さを変更して、第1の黄金矩形の大きさや形状を更新する処理ととらえることもできる。   In the above-described embodiment, the second golden rectangle has been described as distinguished from the first golden rectangle. However, the process of generating the second golden rectangle can be regarded as a process of updating the size and shape of the first golden rectangle by changing the position and length of the side of the first golden rectangle.

上述の実施形態において、図1に示される機能構成要素は、CPU110がプログラムを実行することによりソフトウェアとして実現された。しかし、文書編集装置100は、図1に示される各機能構成要素に相当する電子回路を有してもよい。すなわち、図1に示される機能構成要素(の一部)は、ハードウェアとして実現されてもよい。   In the above-described embodiment, the functional components shown in FIG. 1 are realized as software by the CPU 110 executing a program. However, the document editing apparatus 100 may include an electronic circuit corresponding to each functional component shown in FIG. That is, (part of) the functional components shown in FIG. 1 may be realized as hardware.

上述の各実施形態においては、文書編集プログラムはHDD150に記憶されていた。しかし、文書編集プログラムは、CD−ROM(Compact Disk Read Only Memory)などの記憶媒体により提供されてもよい。   In each of the embodiments described above, the document editing program is stored in the HDD 150. However, the document editing program may be provided by a storage medium such as a CD-ROM (Compact Disk Read Only Memory).

第1実施形態に係る文書編集装置100の機能構成を示すブロック図である。It is a block diagram which shows the function structure of the document editing apparatus 100 which concerns on 1st Embodiment. 文書編集装置100のハードウェア構成を示すブロック図である。2 is a block diagram illustrating a hardware configuration of a document editing apparatus 100. FIG. 文書編集装置100の動作を示すフローチャートである。3 is a flowchart showing the operation of the document editing apparatus 100. 仮レイアウト処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of a temporary layout process. 一時レイアウトされたオブジェクトを例示する図である。It is a figure which illustrates the object laid out temporarily. 形成された黄金矩形を例示する図である。It is a figure which illustrates the formed golden rectangle. 第1実施形態に係る黄金矩形生成処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the golden rectangle production | generation process which concerns on 1st Embodiment. 第2の黄金矩形を例示する図である。It is a figure which illustrates the 2nd golden rectangle. 第2実施形態に係る黄金矩形生成処理の詳細を示すフローチャートである。It is a flowchart which shows the detail of the golden rectangle production | generation process which concerns on 2nd Embodiment. 他の実施形態に係るテキストを例示する図である。It is a figure which illustrates the text which concerns on other embodiment. 他の実施形態に係るテキストを例示する図である。It is a figure which illustrates the text which concerns on other embodiment. 他の実施形態に係るテキストを例示する図である。It is a figure which illustrates the text which concerns on other embodiment.

符号の説明Explanation of symbols

100…文書編集装置、101…オブジェクト取得部、102…配置方向取得部、103…仮レイアウト部、104…黄金矩形生成部、105…レイアウト部、110…CPU、120…ROM、130…RAM、140…I/F、150…HDD、160…キーボード・マウス、170…ディスプレイ、180…ネットワークIF、190…バス DESCRIPTION OF SYMBOLS 100 ... Document editing apparatus, 101 ... Object acquisition part, 102 ... Arrangement direction acquisition part, 103 ... Temporary layout part, 104 ... Golden rectangle production | generation part, 105 ... Layout part, 110 ... CPU, 120 ... ROM, 130 ... RAM, 140 ... I / F, 150 ... HDD, 160 ... Keyboard / mouse, 170 ... Display, 180 ... Network IF, 190 ... Bus

Claims (9)

テキストを示すデータであるオブジェクトを取得するオブジェクト取得手段と、
前記オブジェクト取得手段により取得されたオブジェクトに含まれるテキストが配置される方向である配置方向を取得する配置方向取得手段と、
隣り合う2辺の長さの比が黄金比である第1の黄金矩形の領域内に、前記テキストを配置する仮レイアウト手段と、
前記第1の黄金矩形の領域内に配置されたテキストの量に基づいて、前記配置方向と垂直な辺の位置を決定する位置決定手段と、
一辺が前記位置決定手段により決定された位置にある第2の黄金矩形を生成する黄金矩形生成手段と、
前記配置方向と垂直な方向において、前記テキストが前記第2の黄金矩形内に収まるように前記テキストの配置を変更する配置変更手段と
を有する文書編集装置。
An object acquisition means for acquiring an object which is data indicating text;
An arrangement direction acquisition unit that acquires an arrangement direction that is a direction in which text included in the object acquired by the object acquisition unit is arranged;
Provisional layout means for arranging the text in a region of a first golden rectangle in which the ratio of the lengths of two adjacent sides is the golden ratio;
Position determining means for determining a position of a side perpendicular to the arrangement direction based on an amount of text arranged in the first golden rectangular area;
A golden rectangle generating means for generating a second golden rectangle having a side determined by the position determining means;
A document editing apparatus comprising: an arrangement changing unit configured to change an arrangement of the text so that the text fits in the second golden rectangle in a direction perpendicular to the arrangement direction.
前記テキストが、前記第1の領域内において複数行または複数列にわたって配置され、
前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置に基づいて、前記配置方向と垂直な辺の位置を決定する
ことを特徴とする請求項1に記載の文書編集装置。
The text is arranged over a plurality of lines or columns in the first region;
The position determining means determines the position of a side perpendicular to the arrangement direction based on the position of at least one of the first and last characters for all rows or columns of the text. Document editing device described in 1.
前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の最頻値に基づいて、前記配置方向と垂直な辺の位置を決定する
ことを特徴とする請求項2に記載の文書編集装置。
The position determining means determines the position of a side perpendicular to the arrangement direction based on the mode value of the position of at least one of the first or last character for all the rows or columns of the text. The document editing apparatus according to claim 2.
前記位置決定手段が、前記テキストのすべての行または列の文字数に基づいて、前記配置方向と垂直な辺の位置を決定する
ことを特徴とする請求項2に記載の文書編集装置。
The document editing apparatus according to claim 2, wherein the position determining unit determines a position of a side perpendicular to the arrangement direction based on the number of characters in all rows or columns of the text.
前記位置決定手段が、前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置との一致度が最大になるように、前記配置方向と垂直な辺の位置を決定する
ことを特徴とする請求項2に記載の文書編集装置。
The position determining means determines the position of the side perpendicular to the arrangement direction so that the degree of coincidence with the position of at least one of the first or last character for all the rows or columns of the text is maximized The document editing apparatus according to claim 2.
少なくとも1つの特定の文字を示す識別子を記憶する記憶手段をさらに有し、
前記位置決定手段が、前記テキストの行または列の先頭または末尾の少なくとも一方の文字が前記記憶手段に記憶された識別子により示される文字と一致するときは、その文字を除外して前記配置方向と垂直な辺の位置を決定する
ことを特徴とする請求項2に記載の文書編集装置。
Storage means for storing an identifier indicating at least one particular character;
When the position determination means matches at least one character at the beginning or end of the line or column of the text with the character indicated by the identifier stored in the storage means, the character is excluded from the arrangement direction. The document editing apparatus according to claim 2, wherein a position of a vertical side is determined.
前記テキストが、前記第1の領域内において複数行または複数列にわたって配置され、
前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の分布が、あらかじめ決められた条件を満たすか判断する判断手段をさらに有し、
前記判断手段により前記テキストのすべての行または列についての先頭または末尾の少なくとも一方の文字の位置の分布が前記条件を満たすと判断された場合、前記位置決定手段が、前記第1の黄金矩形の1辺の位置を前記配置方向と垂直な辺の位置として決定し、かつ、前記黄金矩形生成手段が、前記第1の黄金矩形と同一の矩形を前記第2の黄金矩形として生成する
ことを特徴とする請求項1に記載の文書編集装置。
The text is arranged over a plurality of lines or columns in the first region;
A judgment means for judging whether a distribution of positions of at least one of the first and last characters for all the rows or columns of the text satisfies a predetermined condition;
If it is determined by the determining means that the distribution of the position of at least one of the first or last character for all the rows or columns of the text satisfies the condition, the position determining means The position of one side is determined as the position of a side perpendicular to the arrangement direction, and the golden rectangle generating means generates the same rectangle as the first golden rectangle as the second golden rectangle. The document editing apparatus according to claim 1.
前記オブジェクトを含むデータである文書において前記オブジェクトが配置される領域であるレイアウト領域を示す情報であるレイアウト領域情報を取得するレイアウト領域取得手段と、
前記レイアウト領域取得手段により取得されたレイアウト領域情報により示されるレイアウト領域に、前記第2の黄金矩形に基づいて前記オブジェクトを配置する配置手段と
をさらに有する請求項1〜7のいずれかの項に記載の文書編集装置。
Layout area acquisition means for acquiring layout area information which is information indicating a layout area in which the object is arranged in a document which is data including the object;
The arrangement according to any one of claims 1 to 7, further comprising: arrangement means for arranging the object based on the second golden rectangle in a layout area indicated by the layout area information acquired by the layout area acquisition means. The document editing device described.
コンピュータ装置を、
テキストを示すデータであるオブジェクトを取得するオブジェクト取得手段と、
前記オブジェクト取得手段により取得されたオブジェクトに含まれるテキストが配置される方向である配置方向を取得する配置方向取得手段と、
隣り合う2辺の長さの比が黄金比である第1の黄金矩形の領域内に、前記テキストを配置する仮レイアウト手段と、
前記第1の黄金矩形の領域内に配置されたテキストの量に基づいて、前記配置方向と垂直な辺の位置を決定する位置決定手段と、
1辺が前記位置決定手段により決定された位置にある第2の黄金矩形を生成する黄金矩形生成手段と、
前記配置方向と垂直な方向において、前記テキストが前記第2の黄金矩形内に収まるように前記テキストの配置を変更する配置変更手段と
して機能させるプログラム。
Computer equipment,
An object acquisition means for acquiring an object which is data indicating text;
An arrangement direction acquisition unit that acquires an arrangement direction that is a direction in which text included in the object acquired by the object acquisition unit is arranged;
Provisional layout means for arranging the text in a region of a first golden rectangle in which the ratio of the lengths of two adjacent sides is the golden ratio;
Position determining means for determining a position of a side perpendicular to the arrangement direction based on an amount of text arranged in the first golden rectangular area;
A golden rectangle generating means for generating a second golden rectangle having one side at the position determined by the position determining means;
A program that functions as an arrangement changing unit that changes an arrangement of the text so that the text fits in the second golden rectangle in a direction perpendicular to the arrangement direction.
JP2006242603A 2006-09-07 2006-09-07 Document editing apparatus and program Expired - Fee Related JP4992350B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006242603A JP4992350B2 (en) 2006-09-07 2006-09-07 Document editing apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006242603A JP4992350B2 (en) 2006-09-07 2006-09-07 Document editing apparatus and program

Publications (2)

Publication Number Publication Date
JP2008065587A true JP2008065587A (en) 2008-03-21
JP4992350B2 JP4992350B2 (en) 2012-08-08

Family

ID=39288251

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006242603A Expired - Fee Related JP4992350B2 (en) 2006-09-07 2006-09-07 Document editing apparatus and program

Country Status (1)

Country Link
JP (1) JP4992350B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8015488B2 (en) 2007-02-14 2011-09-06 Seiko Epson Corporation Document edit device, program and computer-readable storage medium
US8122351B2 (en) 2007-02-20 2012-02-21 Seiko Epson Corporation Document edit device and storage medium
US8122347B2 (en) 2006-07-04 2012-02-21 Seiko Epson Corporation Document editing support device, program, and storage medium
US8136032B2 (en) 2007-02-14 2012-03-13 Seiko Epson Corporation Document edit support device and storage medium
JP2018022094A (en) * 2016-08-05 2018-02-08 本田技研工業株式会社 On-vehicle display device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08180037A (en) * 1994-12-26 1996-07-12 Hitachi Ltd Presentation document preparation supporting system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08180037A (en) * 1994-12-26 1996-07-12 Hitachi Ltd Presentation document preparation supporting system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8122347B2 (en) 2006-07-04 2012-02-21 Seiko Epson Corporation Document editing support device, program, and storage medium
US8015488B2 (en) 2007-02-14 2011-09-06 Seiko Epson Corporation Document edit device, program and computer-readable storage medium
US8136032B2 (en) 2007-02-14 2012-03-13 Seiko Epson Corporation Document edit support device and storage medium
US8122351B2 (en) 2007-02-20 2012-02-21 Seiko Epson Corporation Document edit device and storage medium
JP2018022094A (en) * 2016-08-05 2018-02-08 本田技研工業株式会社 On-vehicle display device

Also Published As

Publication number Publication date
JP4992350B2 (en) 2012-08-08

Similar Documents

Publication Publication Date Title
JP4743154B2 (en) Document editing apparatus, program, and storage medium
CN101876967B (en) Method for generating PDF text paragraphs
US7703011B2 (en) Digital content creation system, digital content creation method, and program product
JP2004303197A (en) Template generating system, layout system, template generating program, layout program, layout template data structure, and template generating method and layout method
JP2005316946A (en) Layout-rule generation system, layout system, layout-rule generation program, layout program, storage medium, method of generating layout rule and method of layout
JP4992350B2 (en) Document editing apparatus and program
JP2008035475A (en) Document editing support device, program, and storage medium
JP2009053932A (en) Document image processor and document image processing program
JP4356752B2 (en) Document editing apparatus, program, and storage medium
JP4321602B2 (en) Document editing support apparatus, program, and storage medium
JP2005044279A (en) Method, program and apparatus for business form processing
US8780404B2 (en) Information processing apparatus, method for controlling same, and storage medium on which computer program has been recorded
JP4442616B2 (en) Document editing apparatus, program, and storage medium
JP5950700B2 (en) Image processing apparatus, image processing method, and program
JP2008204179A (en) Document evaluation device, program and storage medium
JP5028980B2 (en) Document editing apparatus and program
JP4992399B2 (en) Document editing apparatus and program
JP2008186332A (en) Layout evaluation device, program and storage medium
JP2008197835A (en) Document editing apparatus, program and storage medium
JP5672732B2 (en) Spreadsheet generation program, spreadsheet generation device, and spreadsheet generation method
JP5407647B2 (en) Information processing apparatus, information processing method, and program
JP2008108187A (en) Cad data converter, cad data conversion method, and cad data conversion program
JP2003196265A (en) Line leading from arbitrary point
JP4666071B2 (en) Document editing apparatus, program, and storage medium
JP4911240B2 (en) Document editing apparatus, program, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090831

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120110

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120312

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120410

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120423

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150518

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees