This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2009-294365, filed Dec. 23, 2009, the entire contents of which is incorporated herein by reference.
1. Field of the Invention
The present invention relates to a character string display device that displays a character string on a display screen, a character string display method and a storage medium.
2. Description of the Related Art
For example, when a map is outputted and displayed, a character string is also outputted and displayed to display a location name, etc. The display of the character string is performed such that each character is drawn in sequence from a designated drawing start point using font data corresponding to the designated character string.
When a character string is to be displayed near each of a plurality of indication points set on an image to indicate their respective names and the like, the layout of the character strings is designed such that the indication points and the corresponding character strings are positioned close to each other with an appropriate distance therebetween, and the character strings do not overlap with each other, and then a display database including its image data and character string data is created.
U.S. Pat. No. 5,297,051 discloses a conventional technology related to the present invention, in which even when a display direction is changed to any of the north, east, west, and south directions during the display of map information, the character strings are displayed with their direction corrected to an appropriate direction.
In the output and the display of an image and a character string in accordance with a display database including image data and character string data, font data of the character string, and the size ratio of the image and the font may differ from those used when designing the layout of the character string.
This may cause the following problems. In the case of a character string whose display frame is set to the left side of an indication point, if a font having a wide character width in relation to the image size is used as a result of the above, the character string runs off the right side of the display frame causing the character string and the indication point to overlap. Conversely, if a font having a narrow character width in relation to the image size is used, the character string is placed on the left side of the display frame which is distant from the indication point.
Such problems occur when, for example, character strings are designed to be placed to the left of the respective indication points so that a plurality of character strings do not overlap in an area where indication points are concentrated.
Therefore, conventionally, when a character string whose font data and size ratio of image and font have been modified is to be displayed on an image, the character string is required to be drawn after complicated processing is performed to correct the display position of the character string accordingly based on the font data, so that the character string and the indication point do not overlap and the character string is not placed distant from the indication point.
An object of the present invention is to enable a character string, which is shown on the side of a discretionary point on era image, to be displayed without disrupting a layout relationship with the corresponding point, without complicated processing.
In accordance with one aspect of the present invention, there is provided a character string display device that displays a character string on a display screen, comprising: an ordinary character string drawing means for drawing a character string in a rightward direction from a drawing start point based on ordinary character string data in which the drawing start point is set on a left side of the character string; and an inverted character string drawing means for drawing a character string in a leftward direction from a drawing start point based on inverted character sting data in which the drawing start point is set on a right side of the character string.
In accordance with another aspect of the present invention, there is provided a character string display method for displaying a character string on a display screen, comprising an ordinary character string drawing step of drawing each character of a character string in sequence from a starting character to an ending character in a rightward direction from a drawing start point, based on ordinary character string data in which the drawing start point is set on a left side of the character string; an inverted character string drawing step of drawing each character of a character string in sequence from an ending character to a starting character in a leftward direction from a drawing start point, based on inverted character string data in which the drawing start direction is set on a right side of the character string; and a display outputting step of outputting to the display screen an image based on drawing performed in the ordinary character string drawing step and in the inverted ordinary character string drawing step.
In accordance with another aspect of the present invention, there is provided a non-transitory computer-readable recording medium having a program stored thereon which is executable by a computer that generates display data of an output image, the program comprising program code for actualizing an ordinary character string drawing function that draws each character of a character string in sequence from a starting character to an ending character in a rightward direction from a drawing start point, based on ordinary character string data in which the drawing start point is set on a left side of the character string; and program code for actualizing an inverted character string drawing function that draws each character of a character string in sequence from an ending character to a starting character in a leftward direction from a drawing start point, based on inverted character string data in which the drawing start point is set on a right side of the character string.
The above and further objects and novel features of the present invention will more fully appear from the following detailed description when the same is read in conjunction with the accompanying drawings. It is to be expressly understood, however, that the drawings are for the purpose of illustration only and are not intended as a definition of the limits of the invention.
The present invention will hereinafter be described in detail with reference to the preferred embodiment shown in the accompanying drawings.
A map display device 1 according to the embodiment is a device that outputs and displays a map image on which character strings are superimposed. As shown in
The display memory 11A is a memory in which data of each pixel in an image displayed in the display device 13 is developed. The display device 13 reads pixel data written in this display memory HA and performs display output of an image based on the pixel data.
The ROM 12 stores therein programs for a plurality of functional modules actualizing various functions by being run by the CPU 10. As shown in
In addition to being stored in the ROM 12, the programs actualizing each functional module can be stored, for example, in a portable storage medium such as an optical disk or a non-volatile memory such as a flash memory that can be read by the CPU 10 via a data reading device. Also, a technique is applicable in which programs such as these are downloaded onto the map display device 1 via a communication line, with a carrier wave serving as a medium.
The CPU 10, the ROM 12, and the RAM 11 as a whole actualize functions of an ordinary character string drawing means, an inverted character string drawing means, a top-bottom switching means, a first drawing means, and a second drawing means.
The map database 20 is constituted by map object layers 21 to 24 in which a plurality of map objects indicating each component of a map image are respectively registered as map image data, a tourist spot indicator layer 25 in which data of a location symbol “” that is displayed on a map is registered as location data, an uninverted character string layer 26 in which uninverted character string data (ordinary character string data) is registered, and an inverted character string layer 27 in which inverted character string data is registered, and the like.
Map objects that are registered in the map object layers 21 to 24 include each object such as land, roads and railroads serving as a component of a map image, and various formats such as raster data and vector data may be used as the data format of these map objects. The layout of each image of each map object is indicated using absolute coordinates set on a map.
Map symbol data that is registered in the tourist spot indicator layer 25 includes a map symbol type and layout data using the above-described absolute coordinates.
Uninverted character string data that is registered in the uninverted character string layer 26 is character string data in which the left end position of a character string display frame is set as a drawing start point. This uninverted character string data includes at least a code string indicating each character of a character string from its starting character to its ending character, and position data in which the left end position of a character string display frame is indicated by absolute coordinates set on a map. In the embodiment, coordinate data of the upper left corner and coordinate data of the lower right corner of a character string display frame at the time of layout design are included, and of these coordinate data, the coordinate data of the upper left corner is defined as a drawing start point.
Inverted character string data that is registered in the inverted character string layer 27 is character string data in which the right end position of a character string display frame is set as a drawing start point. This inverted character string data includes at least a code string indicating each character of a character string from its starting character to its ending character, and position data in which the right end position of a character string display frame is indicated by absolute coordinates set on a map. In the embodiment, coordinate data of the upper left corner and coordinate data of the lower right corner of a character string display frame at the time of layout design are included, and of these coordinate data, the coordinate data of the lower right corner is defined as a drawing start point.
As shown in
As shown in
As shown in
In this instance, the map data base 20 is configured such that the character strings T11 to T13 placed to the right of the location symbols f1 to f3 are registered in the uninverted character string layer 26 as uninverted character string data and the character strings P14 and T15 placed to the left of the location symbols f4 and f5 are registered in the inverted character string layer 27 as inverted character string data.
In an actual image display processing, the character strings T14 and T15 of the inverted character string layer 27 are drawn to be in the ordinary direction. Therefore, normal display content such as that shown in
Next, operations of the map display device 1 configured as described above will be described.
The map drawing processing is initiated when an instruction to perform map display or an instruction to update the display range of a map is entered by a user from the operating section 14. When the map drawing processing is initiated, the CPU 10 first sets a display area of the map using absolute coordinates set on the map (Step S1). Next, the CPU 10 reads out each data included in the display area from the map object layers 21 to 24 and the tourist spot indicator layer 25 in the map database 20 (Step S2).
The CPU 10 then reads in data indicating the display direction of the map set by another control processing, and determines the top-bottom direction of the map display (Step S3).
Then, functioning as the image drawing processing section 6, the CPU 10 generates corresponding image data based on the map objects read out at Step S2 and performs drawing processing for writing out the image data in a designated position in the display memory 11A (Step S4). In addition, the CPU 10 generates image data of a corresponding indication mark based on the data of the location symbol read out at Step S2 and performs drawing processing for writing out the image data in a designated position in the display memory 11A (Step S5).
As a result of the drawing processing performed at Step S4 and Step S5, the image data of land, roads, railroads, and the like of the map, and the image data of the location symbol are developed in the display memory 11A.
Next, the CPU 10 performs branch processing based on the top-bottom direction determined at Step S3 (Step S6). When the map display is in an ordinary direction, the CPU 10 sequentially performs uninverted character string layer ordinary drawing processing (Step S7) and inverted character string layer inverted drawing processing (Step S8), and terminates the map drawing processing.
Conversely, when the direction of the map display is upside down, the CPU 10 sequentially performs uninverted character string layer inverted drawing processing (Step S9) and inverted character string layer ordinary drawing processing (Step S10), and terminates the map drawing process.
When the procedure proceeds to the inverted character string layer inverted drawing processing, the CPU 10 first searches character strings included in the display area from the inverted character string layer 27 of the map database 20, and extracts a single piece of inverted character string data (Step S11). Next, the CPU 10 extracts from the font database 16 font data corresponding to each character from the starting character to the ending character of the character string, using a character code written in the inverted character string data (Step S12).
Then, functioning as the character layout retrieving section 7, the CPU 10 identifies, from the coordinate data of the display frame included in the inverted character string data, the lower right corner position as a drawing start reference point P1 (
Next, when the drawing start reference point P1 is determined, functioning as the character string drawing processing section 8, the CPU 10 draws the character string in the display memory 11A (Step S14 inverted character string display means). That is, as shown in
When the drawing of the single piece of inverted character string data is completed, the CPU 10 judges whether or not this inverted character string data is the last piece of inverted character string data indicating character strings included in the display area (Step S15). When judged that the character string data is not the last piece, the CPU 10 returns to Step S11 to draw the next character string. As a result of the processing at Step S11 to Step S15 being repeated in this way, the drawing processing is performed on all pieces of inverted character string data included in the display area, and the character strings are drawn in the display memory 11A.
When judged in the determination processing at Step S15 that the character string is the last, the CPU 10 terminates the inverted character string layer inverted drawing processing.
In the inverted character string layer inverted drawing processing, even when the character width of a font is changed, or the size ratio between a map image and a font is changed by the enlargement or reduction of the map image, the right end of the character string is fixed on the map image and the left end of the character string changes its position on the map image. Accordingly, an appropriate layout relationship is constantly maintained between the character string and the location point f when the location symbol f is set to the right of the character string.
The uninverted character string layer ordinary drawing processing is processing that is similar to the inverted character string layer inverted drawing processing in
In the uninverted character string layer ordinary drawing processing, the left end of a character string is fixed on a map image, and when the character width of its font or the size ratio between the map image and the font is changed, the right end of the character string changes its position on the map image. Accordingly, an appropriate layout relationship is constantly maintained between the character string and the location point f when the location symbol f is set to the left of the character string.
The inverted character string layer ordinary drawing processing (
When the procedure proceeds to the inverted character string layer ordinary drawing processing, the CPU 10 first performs at Step S31 to Step S33 the same processing as those at Step S11 to Step S13 in
When the procedure proceeds to the uninverted character string layer inverted drawing processing, the CPU 10 first performs at Step S41 to Step S43 the same processing as those at Step S21 to Step S23 in
As a result of the inverted character string layer ordinary drawing processing and the uninverted character string layer inverted drawing processing, the character string is outputted and displayed upside down while maintaining its appropriate range relationship with the location point f.
As described above, in the map display device 1 according to the embodiment, a character string of uninverted character string data whose drawing start point has been set on the left side thereof is drawn in the rightward direction from the drawing start point, as a result of the uninverted character string layer ordinary drawing processing (
Moreover, in the inverted character string inverted drawing processing (
Furthermore, when the top-bottom direction of a display screen of the map display device 1 is determined to be upside down, the uninverted character layer inverted drawing processing (
Still further, the map display device 1 according to the embodiment which includes the map database 20 having the map object layers 21 to 24, the tourist spot indicator layer 25, the uninverted character string layer 26, and the inverted character string layer 27, draws map images and character strings based on data in the map database 20. Therefore, map images and character strings can be displayed without disrupting their appropriate layout, through a simple drawing processing, by the map database 20 in which the layout of each character string has been appropriately designed being provided.
Yet still further, the map display device 1 according to the embodiment includes the font database 16, and character strings are drawn using font data therein. Therefore, although the width of a character string differs from that of when the map database 20 is designed depending on the font data, each character string can be outputted and displayed without disrupting the layout relationship between each location point and each character string on the map, by the above-described drawing processing.
Yet still further, in the map display device 1 according to the embodiment, uninverted character string data and inverted character string data include a code string indicating a character string and position data for a character string display frame indicated by absolute coordinates on a map. Accordingly, in the case of uninverted character string data, its drawing start point can be easily determined by the upper left corner of the display frame being determined as the drawing start point, and in the case of inverted character string data, its drawing start point can be easily determined by the lower right corner of the display frame being determined as the drawing start point.
The present invention is not limited to the above-described embodiment, and various modifications can be made. For example, in the embodiment, a configuration is shown in which each character string is displayed in association with a location symbol. However the present invention can be effectively applied in a similar manner when a character string is displayed in association with a designated point on an image, such as when a character string is displayed in association with a train station landmark on a map.
In addition, in the embodiment, uninverted character string data and inverted character string data are held within the map display device 1. However, these uninverted character string data and inverted character string data can be externally provided, and then outputted and displayed.
Moreover, in the embodiment, the CPU 10 identifies whether data is uninverted character string data or inverted character string data based on which layer in the map data base 20 it has been registered. However, an identifier enabling the identification of uninverted character string data and inverted character string data may be added to character string data itself, and the CPU 10 may perform, after identifying whether the character string data is uninverted character string data or inverted character string data based on the identifier, drawing processing corresponding thereto.
Furthermore, other details of the configurations and methods described according to the embodiment, such as the type of image or character string that are outputted to be displayed and each data configuration of the map database, can be modified accordingly without departing from the spirit of the invention.
While the present invention has been described with reference to the preferred embodiments, it is intended that the invention be not limited by any of the details of the description therein but includes all the embodiments which fall within the scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2009-294365 | Dec 2009 | JP | national |