The present invention relates to a character drawing device for and a character drawing method of drawing characters with various weights or performing character formatting with various weights.
A conventional character drawing device prepares two or more types of fonts having different weights, and, when displaying characters having a different weight, such as thick characters or thin characters, switches between fonts according to the weight of characters to be drawn to draw the characters. A problem with this character drawing device is, however, that because the character drawing device needs to have two or more types of fonts, a large-volume memory for storing the fonts is needed.
Therefore, a technology of, in a case in which only a font having one type of weight is mounted and thick characters are displayed, converting the font data into font data having a heavy weight corresponding to the thick characters to draw the characters is known (for example, refer to patent reference 1). According to this technology, in a case in which a font having a maximum weight and a font having a minimum weight are mounted and a font having a weight intermediate between them is used, interpolation is performed on the two fonts to generate a font having a middle weight.
Further, a method of, instead of generating a font having a heavy weight corresponding to thick characters, drawing a general character, and, after that, enclosing the outline part of the character by using a thick line in order to draw a character having a heavy weight at the time of the drawing is also known (for example, refer to patent reference 2).
Patent reference 1: Japanese Unexamined Patent Application Publication No. 8-263042
Patent reference 2: Japanese Unexamined Patent Application Publication No. 9-34435
As mentioned above, a device that, in order to solve the problem that the memory for storing fonts increases because there is a necessity to provide plural types of fonts, is equipped with only a font having one weight, instead of fonts having all weights, and generates a font having another weight from this font is known as a character drawing device.
For example, a character drawing device that has only a font having one weight, moves the outline part of the font outwardly in a vertical direction with respect to the outline when drawing thick characters, and moves the outline part of the font inwardly in a vertical direction with respect to the outline when drawing thin characters is also known. A problem with this device is that the device needs to perform strict calculation on a straight line or a Bezier curve which describes the outline of the font so as not to lose the balance of the outlines of characters, and the process of performing the calculation in real time at the time of drawing characters takes too much time.
Further, a device that, when drawing a character having a heavy weight or a thick character, draws a character having a normal size first and encloses its outline part by using a thick line to implement the drawing is known as another character drawing device. Because the drawing is performed by superposing a thick line on the outline part of a character according to this technology, this technology can be applied to a case of drawing a character having a heavy weight while the technology cannot be applied to a case of drawing a character having a light weight. A further problem is that when making characters be transparent, the degree of transparency differs between superposed portions and non-superposed portions, and characters having a uniform degree of transparency cannot be drawn.
The present invention is made in order to solve the above-mentioned problems, and it is therefore an object of the present invention to provide a character drawing device and a character drawing method capable of performing drawing of characters having different weights or drawing of thick characters with a small memory size and at a high speed.
In accordance with the present invention, there is provided a character drawing device including: a storage that stores outline fonts each defining outlines of characters; and an arithmetic processor that generates rectangles on the outline part of a character shown by an outline font read from the storage, adjusts a width of each of the generated rectangles according to the weight of the character, and sets a degree of transparency to an inside region of the character which is enclosed by each of the rectangles after the adjustment and a degree of transparency to each of the rectangles to draw the character.
The character drawing device in accordance with the present invention can perform drawing of characters having different weights or drawing of thick characters with a small memory size and at a high speed.
[
[
[
[
[
[
[
[
[
[
Hereafter, the preferred embodiments of the present invention will be explained in detail with reference to the drawings.
The arithmetic processor 11 is comprised of, for example, a CPU (Central Processing Unit), and includes an application 21 and an image memory 22. The application 21 consists of a program for implementing functions which this character drawing device has. The image memory 22 stores character image data.
The system memory 12 corresponds to a “storage” in accordance with the present invention, and holds instruction codes which construct the program in the arithmetic processor 11, and data used for various processes. The data held by this system memory 12 include outline fonts each defining the outlines of characters. The storage that stores the outline fonts is not limited to the system memory 12, and the outline fonts can be alternatively stored in a storage included in the arithmetic processor 11.
Next, the operation of the character drawing device in accordance with Embodiment 1 constructed as above will be explained. An operating system (OS) or the like is installed in the above-mentioned arithmetic processor 11, and the arithmetic processor is constructed in such a way that a plurality of applications 21 or a plurality of tasks can run on this OS and a process for implementing the functions as the character drawing device is performed as one of the plurality of applications or tasks.
In the drawing process, reading of font data is performed first (step ST21). More specifically, the arithmetic processor 11 reads font data which is outline information about characters from the outline fonts stored in the system memory 12.
Extraction of path data is then performed (step ST22). More specifically, the arithmetic processor 11 extracts path data defining the outlines of the characters from the font data read in step ST21. The path data about each character, the path data being included in the font data, is defined by straight lines and/or parametric curves as shown in, for example,
The path data is then linearized (step ST23). More specifically, the arithmetic processor 11 performs a linearization process of subdividing all of the path data consisting of straight lines or curved lines into straight lines. In this step ST23, particularly, each parametric curve is divided into straight lines. For example, the outline part of the character “D” is defined by straight lines and parametric curves as shown in
Then, generation of rectangles corresponding to the straight line data is performed (step ST24). More specifically, the arithmetic processor 11 generates rectangles each having a width from the path data linearized in step ST23. Concretely, each of line segments into which the outline is subdivided is defined as a rectangle, as shown by dashed lines in
A setup of the width of each rectangle is then performed (step ST25). More specifically, the arithmetic processor 11 determines the width of each rectangle generated in step ST24.
The degree of transparency of each rectangle is then set to the image memory (step ST26). More specifically, the arithmetic processor 11 writes the degree of transparency of the character in each rectangle in the image memory 22 as rectangle image data. The degree of transparency written at that time can be a value taking into consideration an antialiasing effect on the outline part of the character.
The antialiasing process is a technology of removing aliasing occurring at the time of drawing a straight line, and
In order to implement the antialiasing, each rectangle formed in the outline part is defined as a region on which the antialiasing process is to be performed, and a degree of transparency ranging from 0x00 to 0xFF is set in order to mix a light color into the inside of the rectangle. By writing 0xFF for a portion in which the color of the character is made to come out clearly and writing 0x00 for a portion in which the color of the character is made not to come out, the degree of transparency of each rectangle on which the antialiasing process is to be performed can be set. As a calculation method of calculating the degree of transparency corresponding to the antialiasing, an existing super sampling method or a method according to the distance between the outline and each pixel can be used.
Whether or not all the paths are completed is then checked to see (step ST27). More specifically, determination of whether or not the process on all the paths of the font data read in step ST21 is completed is performed. When it is determined in this step ST27 that all the paths are not completed, the sequence returns to step ST22, and the above-mentioned process is repeated in order to perform the process on the remaining paths.
In contrast, when it is determined in above-mentioned step ST27 that all the paths are completed, a setup of a range of degrees of transparency to the inside of each character is then performed (step ST28). More specifically, the arithmetic processor 11 writes degrees of transparency to the inside of each character of the image data in which a degree of transparency is written to each rectangle formed in the outline part in step ST26, as shown in
The color of the entire character is then set up (step ST29). More specifically, the arithmetic processor 11 applies a color to the image data in which the degrees of transparency are written to generate a colored character. Concretely, the arithmetic processor 11 sets up the color of the character on the basis of the information about the degrees of transparency of the character completed through the process including up to step ST28 to generate a final character. After that, the character drawing device ends the drawing process.
When generating a character having a different weight, the character drawing device in accordance with this Embodiment 1 can generate a thick character by adjusting the width of each rectangle in above-mentioned step ST25. As shown in
Further, when generating a character having a light weight, in the setup of the width of each rectangle in step ST25, the character drawing device enables the widths of an inside portion and an outside portion to be set up independently. Although
A rectangle having different widths can be generated by determining a vector connecting between a vertex A and a vertex B as shown in
Further, in the drawing method for use in the character drawing device in accordance with Embodiment 1, although a gap occurs at a joint between thick lines, as shown in a portion enclosed by a dashed circle in
Further, when the region of each rectangle is set as a region on which the antialiasing process is to be performed, the antialiasing process is performed between the widths of the outside and inside portions of the character to display a smooth outline, as shown in
Further, by increasing the width of the outside portion of each rectangle, a character whose outline gets blurred can be generated. By temporarily drawing such a character whose outline gets blurred or a character whose outside portion is widened, and drawing a general character (a character in which each rectangle is reduced) overlappedly, an effect such as an outline letter can be produced.
As previously explained, because the character drawing device in accordance with Embodiment 1 of the present invention implements character drawing corresponding to a plurality of weight from a single font, the memory capacity for holding fonts can be reduced. Further, because the character drawing device in accordance with Embodiment 1 of the present invention implements drawing of a character having a different weight or drawing of a thick character by using a general character drawing method without using a method of determining the shape of a font from calculations, the processing time can be shortened.
While the invention has been described in its preferred embodiment, it is to be understood that various changes can be made in an arbitrary component according to the embodiment, and an arbitrary component according to the embodiment can be omitted within the scope of the invention.
The character drawing device in accordance with the present invention is suitable for a display device or a printer which outputs characters in various computers and so on.
11 arithmetic processor, 12 system memory, 21 application, 22 image memory.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP12/02918 | 4/27/2012 | WO | 00 | 7/22/2014 |