Added support for fonts. Still some bugs

This commit is contained in:
Filippo Scognamiglio 2013-12-27 19:11:11 +01:00
parent 1bb866f312
commit 54d854c32a
26 changed files with 474 additions and 8 deletions

View File

@ -46,4 +46,5 @@ OTHER_FILES += \
qml/cool-old-term/frames/images/screen-frame-normals.png \
qml/cool-old-term/frames/images/black-frame.png \
qml/cool-old-term/frames/images/black-frame-normals.png \
qml/cool-old-term/frames/NoFrame.qml
qml/cool-old-term/frames/NoFrame.qml \
qml/cool-old-term/MainContainer.qml

View File

@ -23,6 +23,17 @@ ApplicationWindow {
ColumnLayout{
anchors.fill: parent
RowLayout{
Label{
text: "Font"
}
ComboBox{
width: 300
model: shadersettings.fonts_list
currentIndex: shadersettings.font_index
onCurrentIndexChanged: shadersettings.font_index = currentIndex
}
}
RowLayout{
Label{
text: "Frame texture"

View File

@ -13,16 +13,49 @@ Item{
property bool scanlines: true
property string frame_source: frames_list.get(frames_index).source
property int frames_index: 1
property var frames_list: framelist
property var font: currentfont
property alias fontSize: currentfont.pixelSize
property int font_index: 2
property var fonts_list: fontlist
FontLoader{
property int pixelSize: fontlist.get(font_index).pixelSize
id: currentfont
source: fontlist.get(font_index).source
}
ListModel{
id: framelist
ListElement{text: "No frame"; source: "./frames/NoFrame.qml"}
ListElement{text: "Simple white frame"; source: "./frames/WhiteSimpleFrame.qml"}
ListElement{text: "Rough black frame"; source: "./frames/BlackRoughFrame.qml"}
}
ListModel{
id: fontlist
ListElement{
text: "Commodore PET (1977)"
source: "fonts/CommodorePET/COMMODORE_PET.ttf"
pixelSize: 20
}
ListElement{
text: "Atari 8bit (1979)"
source: "./fonts/Atari8bit/ATARI400800_original.TTF"
pixelSize: 18
}
ListElement{
text: "Commodore 64 (1982)"
source: "./fonts/Commodore64/C64_User_Mono_v1.0-STYLE.ttf"
pixelSize: 20
}
ListElement{
text: "IBM DOS (1985)"
source: "./fonts/Dos/Perfect DOS VGA 437.ttf"
pixelSize: 25
}
}
}

View File

@ -21,7 +21,7 @@
*
*******************************************************************************/
import QtQuick 2.0
import QtQuick 2.1
import org.yat 1.0
@ -36,8 +36,8 @@ TerminalScreen {
property var textComponent : Qt.createComponent("TerminalText.qml")
property var cursorComponent : Qt.createComponent("TerminalCursor.qml")
font.family: "Pet Me"
font.pixelSize: 20
font.family: shadersettings.font.name
font.pixelSize: shadersettings.fontSize
focus: true
onActiveFocusChanged: {
@ -130,13 +130,11 @@ TerminalScreen {
onRequestHeightChange: {
terminalWindow.height = newHeight * screenItem.fontHeight;
terminalWindow.contentItem.height = newHeight * screenItem.fontHeight;
console.log("banana");
}
onRequestWidthChange: {
terminalWindow.width = newWidth * screenItem.fontWidth;
terminalWindow.contentItem.width = newWidth * screenItem.fontWidth;
console.log("a");
}
}

View File

@ -0,0 +1,317 @@
{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern\fprq1 Atari Classic Chunky;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 Arial;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
\deflang1033\pard\plain\f2\fs24\cf1 Atari Classic TrueType Fonts \plain\f2\fs24\cf0
\par \plain\f4\fs16\cf0 (Windows Version 1.1)
\par Created by Mark Simonson (v.1.0-1998, v.1.1-2001)
\par marksim@bitstream.net
\par Website: Mac/Atari Fusion--Atari Home Computer Resources for Mac Users
\par http://www2.bitstream.net/~marksim/atarimac/
\par Macintosh version also available.
\par
\par With these fonts installed, you can view and print Atari text files in any text editor that allows you to change fonts (WordPad, for example). Tip: In order to get the correct line breaks, you will need to change the ATASCII return character (155) to the DOS LF character. (In the Character Map accessory, the ATASCII return is the blank character that comes just before the inverse up-arrow.)
\par
\par There are three different fonts. \plain\f4\fs16\cf0\b Atari Classic Chunky \plain\f4\fs16\cf0 is a pixel-for-pixel copy of the original ATASCII character set. \plain\f4\fs16\cf0\b Atari Classic Smooth \plain\f4\fs16\cf0 interprets the pixel aliasing (stair steps) as diagonal lines. \plain\f4\fs16\cf0\b Atari Classic Extrasmooth \plain\f4\fs16\cf0 refines this idea further with the addition of curves. \plain\f4\fs16\cf0\b Smooth\plain\f4\fs16\cf0 and \plain\f4\fs16\cf0\b Extrasmooth\plain\f4\fs16\cf0 were designed for better appearance and legibility at larger sizes and on print-outs. Use the one that looks best to you.
\par
\par These fonts will tend to look uneven at font sizes that do not correspond to the 8-by-8 pixel grid that the characters are based on. Because Windows assumes 96ppi screen resolution, they will look best in a font size that is a multiple of 6 (i.e., 6pt, 12pt, 18pt, etc.). (In Windows, 6 points = 8 pixels.)
\par
\par The Atari Classic TrueType fonts duplicate the ATASCII character set on a low-level basis. Unlike a normal Windows font, ATASCII utilizes all character codes from $00 to $FF (0 to 255). The lower half are normal characters; the upper half are inverse versions of the lower half. The basic ASCII characters ($00 to $7F) correspond fairly closely except for the first 32, which don't normally contain characters in a Windows font.
\par
\par Due to differences between the way Windows and the Atari use character codes, not all characters will display properly in Windows. In fact, some characters will not display at all (though they do exist in the font). Unfortunately, this is due to certain character codes being reserved in Windows and there doesn't appear to be any way to work around it. The character codes affected are: $00-$1F (0-31), $7F-$81 (127-129), $8D-$90 (141-144), $9D (157), and $9F (158).
\par
\par Not all characters can be typed from the keyboard. You can however copy characters as needed from this document (see tables below). The Character Map desk accessory can help also.
\par
\par \plain\f4\fs16\cf0\b ATASCII CHARACTER SET TABLES
\par \plain\f4\fs16\cf0
\par In order to see the ATASCII character set with these tables, the Atari Classic TrueType fonts must be installed. Characters that are not displayed properly are due to character code usage differences between ATASCII and Windows (see above).
\par
\par
\par \plain\f4\fs16\cf0\b TABLE 1: ATASCII Character Dump Block
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) 16 characters per
\par line.
\par
\par
\par \plain\f2\fs12\cf0 \'01\'02\'03\'04\'05\'06\'07\'08\tab
\par \'0b\'0c
\par \'0e\'0f
\par \'10\'11\'12\'13\'14\'15\'16\'17\'18\'19\'1a\'1b\'1c\'1d\'1e\'1f
\par !"#$%&'()*+,-./
\par 0123456789:;<=>?
\par @ABCDEFGHIJKLMNO
\par PQRSTUVWXYZ[\\]^_
\par `abcdefghijklmno
\par pqrstuvwxyz\{|\}~
\par \'80\'81\'82\'83\'84\'85\'86\'87\'88\'89\'8a\'8b\'8c\'8d\'8e\'8f
\par \'90''""\bullet \endash \emdash \'98\'99\'9a \'9c\'9d\'9e\'9f
\par \~\'a1\'a2\'a3\'a4\'a5\'a6\'a7\'a8\'a9\'aa\'ab\'ac\'ad\'ae\'af
\par \'b0\'b1\'b2\'b3\'b4\'b5\'b6\'b7\'b8\'b9\'ba\'bb\'bc\'bd\'be\'bf
\par \'c0\'c1\'c2\'c3\'c4\'c5\'c6\'c7\'c8\'c9\'ca\'cb\'cc\'cd\'ce\'cf
\par \'d0\'d1\'d2\'d3\'d4\'d5\'d6\'d7\'d8\'d9\'da\'db\'dc\'dd\'de\'df
\par \'e0\'e1\'e2\'e3\'e4\'e5\'e6\'e7\'e8\'e9\'ea\'eb\'ec\'ed\'ee\'ef
\par \'f0\'f1\'f2\'f3\'f4\'f5\'f6\'f7\'f8\'f9\'fa\'fb\'fc\'fd\'fe\'ff
\par \plain\f4\fs16\cf0
\par
\par \plain\f4\fs16\cf0\b TABLE 2: ATASCII Character Dump List
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) one character per
\par line with hexadecimal value indicated on the left.
\par
\par \plain\f2\fs12\cf0 00=
\par 01=\'01
\par 02=\'02
\par 03=\'03
\par 04=\'04
\par 05=\'05
\par 06=\'06
\par 07=\'07
\par 08=\'08
\par 09=\tab
\par 0A=
\par
\par 0B=\'0b
\par 0C=\'0c
\par 0D=
\par 0E=\'0e
\par 0F=\'0f
\par 10=\'10
\par 11=\'11
\par 12=\'12
\par 13=\'13
\par 14=\'14
\par 15=\'15
\par 16=\'16
\par 17=\'17
\par 18=\'18
\par 19=\'19
\par 1A=\'1a
\par 1B=\'1b
\par 1C=\'1c
\par 1D=\'1d
\par 1E=\'1e
\par 1F=\'1f
\par 20=
\par 21=!
\par 22="
\par 23=#
\par 24=$
\par 25=%
\par 26=&
\par 27='
\par 28=(
\par 29=)
\par 2A=*
\par 2B=+
\par 2C=,
\par 2D=-
\par 2E=.
\par 2F=/
\par 30=0
\par 31=1
\par 32=2
\par 33=3
\par 34=4
\par 35=5
\par 36=6
\par 37=7
\par 38=8
\par 39=9
\par 3A=:
\par 3B=;
\par 3C=<
\par 3D==
\par 3E=>
\par 3F=?
\par 40=@
\par 41=A
\par 42=B
\par 43=C
\par 44=D
\par 45=E
\par 46=F
\par 47=G
\par 48=H
\par 49=I
\par 4A=J
\par 4B=K
\par 4C=L
\par 4D=M
\par 4E=N
\par 4F=O
\par 50=P
\par 51=Q
\par 52=R
\par 53=S
\par 54=T
\par 55=U
\par 56=V
\par 57=W
\par 58=X
\par 59=Y
\par 5A=Z
\par 5B=[
\par 5C=\\
\par 5D=]
\par 5E=^
\par 5F=_
\par 60=`
\par 61=a
\par 62=b
\par 63=c
\par 64=d
\par 65=e
\par 66=f
\par 67=g
\par 68=h
\par 69=i
\par 6A=j
\par 6B=k
\par 6C=l
\par 6D=m
\par 6E=n
\par 6F=o
\par 70=p
\par 71=q
\par 72=r
\par 73=s
\par 74=t
\par 75=u
\par 76=v
\par 77=w
\par 78=x
\par 79=y
\par 7A=z
\par 7B=\{
\par 7C=|
\par 7D=\}
\par 7E=~
\par 7F=
\par 80=\'80
\par 81=\'81
\par 82=\'82
\par 83=\'83
\par 84=\'84
\par 85=\'85
\par 86=\'86
\par 87=\'87
\par 88=\'88
\par 89=\'89
\par 8A=\'8a
\par 8B=\'8b
\par 8C=\'8c
\par 8D=\'8d
\par 8E=\'8e
\par 8F=\'8f
\par 90=\'90
\par 91='
\par 92='
\par 93="
\par 94="
\par 95=\bullet
\par 96=\endash
\par 97=\emdash
\par 98=\'98
\par 99=\'99
\par 9A=\'9a
\par 9B=
\par 9C=\'9c
\par 9D=\'9d
\par 9E=\'9e
\par 9F=\'9f
\par A0=\~
\par A1=\'a1
\par A2=\'a2
\par A3=\'a3
\par A4=\'a4
\par A5=\'a5
\par A6=\'a6
\par A7=\'a7
\par A8=\'a8
\par A9=\'a9
\par AA=\'aa
\par AB=\'ab
\par AC=\'ac
\par AD=\'ad
\par AE=\'ae
\par AF=\'af
\par B0=\'b0
\par B1=\'b1
\par B2=\'b2
\par B3=\'b3
\par B4=\'b4
\par B5=\'b5
\par B6=\'b6
\par B7=\'b7
\par B8=\'b8
\par B9=\'b9
\par BA=\'ba
\par BB=\'bb
\par BC=\'bc
\par BD=\'bd
\par BE=\'be
\par BF=\'bf
\par C0=\'c0
\par C1=\'c1
\par C2=\'c2
\par C3=\'c3
\par C4=\'c4
\par C5=\'c5
\par C6=\'c6
\par C7=\'c7
\par C8=\'c8
\par C9=\'c9
\par CA=\'ca
\par CB=\'cb
\par CC=\'cc
\par CD=\'cd
\par CE=\'ce
\par CF=\'cf
\par D0=\'d0
\par D1=\'d1
\par D2=\'d2
\par D3=\'d3
\par D4=\'d4
\par D5=\'d5
\par D6=\'d6
\par D7=\'d7
\par D8=\'d8
\par D9=\'d9
\par DA=\'da
\par DB=\'db
\par DC=\'dc
\par DD=\'dd
\par DE=\'de
\par DF=\'df
\par E0=\'e0
\par E1=\'e1
\par E2=\'e2
\par E3=\'e3
\par E4=\'e4
\par E5=\'e5
\par E6=\'e6
\par E7=\'e7
\par E8=\'e8
\par E9=\'e9
\par EA=\'ea
\par EB=\'eb
\par EC=\'ec
\par ED=\'ed
\par EE=\'ee
\par EF=\'ef
\par F0=\'f0
\par F1=\'f1
\par F2=\'f2
\par F3=\'f3
\par F4=\'f4
\par F5=\'f5
\par F6=\'f6
\par F7=\'f7
\par F8=\'f8
\par F9=\'f9
\par FA=\'fa
\par FB=\'fb
\par FC=\'fc
\par FD=\'fd
\par FE=\'fe
\par FF=\'ff
\par }

View File

@ -0,0 +1,6 @@
Fonts in this package are (c) 2010 Style.
You MAY NOT: sell this font; include/redistribute this font in any font collection regardless of pricing; provide the font for direct download from any web site. You MAY: link to "http://style64.org/c64-truetype" in order for others to download and install the font; embed this font or its .eot and .woff variants without any modification and using the same filename it was provided with for display on any web site using @font-face rules; use this font in static images and vector art; include this font without any modification and using the same filename it was provided with as part of a software package but ONLY if said software package is freely provided to end users. You may also contact us to negotiate a (possibly commercial) license for your use outside of these guidelines at "http://style64.org/contact-style".
At all times the most recent version of this license can be found at "http://style64.org/c64-truetype/license".

Binary file not shown.

View File

@ -0,0 +1,20 @@
KREATIVE SOFTWARE RELAY FONTS FREE USE LICENSE
version 1.2f
Permission is hereby granted, free of charge, to any person or entity (the "User") obtaining a copy of the included font files (the "Software") produced by Kreative Software, to utilize, display, embed, or redistribute the Software, subject to the following conditions:
1. The User may not sell copies of the Software for a fee.
1a. The User may give away copies of the Software free of charge provided this license and any documentation is included verbatim and credit is given to Kreative Korporation or Kreative Software.
2. The User may not modify, reverse-engineer, or create any derivative works of the Software.
3. Any Software carrying the following font names or variations thereof is not covered by this license and may not be used under the terms of this license: Jewel Hill, Miss Diode n Friends, This is Beckie's font!
3a. Any Software carrying a font name ending with the string "Pro CE" is not covered by this license and may not be used under the terms of this license.
4. This license becomes null and void if any of the above conditions are not met.
5. Kreative Software reserves the right to change this license at any time without notice.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE SOFTWARE OR FROM OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

View File

@ -0,0 +1,72 @@
/
/(_____________ ____
\ /______)\ | |
:\ | / \:| |:::::::::: : .. . : .. . . :. .
\_____| / | \| |______
___ / ________ \... . . .
\______________ \ | | /.. . . . . .
\ |__| /
--x--x-----x----\______ |-/_____/-x--x-xx--x-- - -x -- - - -- - - -
. . . . . . . . . . . .\____|. . . . . .
-------------------------------------------------------------------------------
>> perfect dos vga 437 - general information >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-------------------------------------------------------------------------------
"Perfect DOS VGA 437" and "Perfect DOS VGA 437 Win" are truetype fonts
designed to emulate the MS-DOS/Text mode standard font, used on VGA monitors,
with the 437 Codepage (standard US/International). This is a "bitmap" font,
meaning it emulates a bitmap font and can only be used at a given size (8 or
multiples of it like 16, 24, 32, etc). It's optimized for Flash too, so it
won't produce antialias if used at round positions.
There are two fonts available. "Perfect DOS VGA 437" uses the original DOS
codepage 437. It should be used, for example, if you're opening DOS ASCII
files on notepad or another windows-based editor. Since it's faithful to the
original DOS codes, it won't accent correctly in windows ("é" would produce
something different, not an "e" with an acute).
There's also "Perfect DOS VGA 437 Win" which is the exactly same font adapted
to a windows codepage. This should use accented characters correctly but won't
work if you're opening a DOS-based text file.
UPDATE: this is a new version, updated in august/2008. It has fixed leading
metrics for Mac systems.
-------------------------------------------------------------------------------
>> perfect dos vga 437 - creation process >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-------------------------------------------------------------------------------
This font was created to be used on a Flash-based ANSi viewer I'm working. To
create it, I created a small Quick Basic program to write all characters on
screen,
CLS
FOR l = 0 TO 255
charWrite 1 + (l MOD 20), 1 + (l \ 20) * 6 + (l MOD 2), LTRIM$(RTRIM$(STR$(l))) + CHR$(l)
NEXT
SUB charWrite (lin, col, char$)
DEF SEG = &HB800
FOR i = 1 TO LEN(char$)
POKE ((lin - 1) * 160) + ((col - 2 + i) * 2), ASC(MID$(char$, i, 1))
IF (i = LEN(char$)) THEN POKE ((lin - 1) * 160) + ((col - 2 + i) * 2) + 1, 113
NEXT
END SUB
Then captured the text screen using SCREEN THIEF (a very, very old screen
capture TSR program which converts text screens to images accurately). I then
recreated the font polygon by polygon on Fontlab, while looking at the image
on Photoshop. No conversion took place.
-------------------------------------------------------------------------------
>> author >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-------------------------------------------------------------------------------
zeh fernando remembers the old days. SMASH DAH FUCKING ENTAH.
http://www.fatorcaos.com.br
rorshack ^ maiden brazil
-------------------------------------------------------------------------------
^zehPULLSdahTRICK^kudosOUTtoWHOkeepsITreal^smashDAHfuckingENTAH!!!^lowres4ever^
-------------------------------------------------------------------------------

View File

@ -237,6 +237,14 @@ ApplicationWindow{
}
}
Loader{
id: terminalloader
anchors.fill: parent
asynchronous: true
sourceComponent: terminal
}
RadialGradient{
id: ambientreflection
z: 2.0