Added UI fonts

This commit is contained in:
Jack Andersen 2015-11-21 13:45:02 -10:00
parent ddead8978b
commit 2f1b7cfc40
15 changed files with 420 additions and 4 deletions

View File

@ -10,12 +10,16 @@ if(NOT DEFINED BOO_INCLUDE_DIR)
BOO_INCLUDE_DIR set")
endif()
include_directories(include ${HECL_INCLUDE_DIR} ${BOO_INCLUDE_DIR})
add_subdirectory(resources/fonts)
include_directories(include ${HECL_INCLUDE_DIR} ${BOO_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/freetype2/include)
list(APPEND SPECTER_HEADERS
include/Specter/Specter.hpp
include/Specter/View.hpp
include/Specter/RootView.hpp
include/Specter/TextView.hpp
include/Specter/Space.hpp
include/Specter/Table.hpp
include/Specter/Outliner.hpp
@ -26,12 +30,14 @@ list(APPEND SPECTER_HEADERS
include/Specter/NumericField.hpp
include/Specter/Menu.hpp
include/Specter/Node.hpp
include/Specter/NodeSocket.hpp)
include/Specter/NodeSocket.hpp
include/Specter/FontCache.hpp)
list(APPEND SPECTER_SOURCES
lib/Specter.cpp
lib/View.cpp
lib/RootView.cpp
lib/TextView.cpp
lib/Space.cpp
lib/Table.cpp
lib/Outliner.cpp
@ -42,6 +48,7 @@ list(APPEND SPECTER_SOURCES
lib/NumericField.cpp
lib/Menu.cpp
lib/Node.cpp
lib/NodeSocket.cpp)
lib/NodeSocket.cpp
lib/FontCache.cpp)
add_library(Specter ${SPECTER_SOURCES} ${SPECTER_HEADERS})

View File

@ -0,0 +1,16 @@
#ifndef SPECTER_FONTCACHE_HPP
#define SPECTER_FONTCACHE_HPP
#include <ft2build.h>
#include FT_FREETYPE_H
namespace Specter
{
class FontCache
{
};
}
#endif // SPECTER_FONTCACHE_HPP

View File

@ -3,12 +3,19 @@
#include "View.hpp"
#include <boo/boo.hpp>
#include <ft2build.h>
#include FT_FREETYPE_H
namespace Specter
{
class RootView : public View, boo::IWindowCallback
class RootView : public View, public boo::IWindowCallback
{
boo::IWindow* m_window = nullptr;
FT_Library m_ftLib;
void setWindow(boo::IWindow* window);
void resized(const boo::SWindowRect& rect);
void mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
void mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods);
@ -27,6 +34,8 @@ class RootView : public View, boo::IWindowCallback
void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods);
void modKeyDown(boo::EModifierKey mod, bool isRepeat);
void modKeyUp(boo::EModifierKey mod);
void draw(boo::IGraphicsCommandQueue* gfxQ);
};
}

View File

@ -1,6 +1,8 @@
#ifndef SPECTER_HPP
#define SPECTER_HPP
#include "View.hpp"
#include "RootView.hpp"
#include "Space.hpp"
#include "Table.hpp"
#include "Outliner.hpp"

View File

@ -0,0 +1,17 @@
#ifndef SPECTER_TEXTVIEW_HPP
#define SPECTER_TEXTVIEW_HPP
#include "View.hpp"
namespace Specter
{
class TextView : public View
{
};
}
#endif // SPECTER_TEXTVIEW_HPP

View File

@ -1,11 +1,20 @@
#ifndef SPECTER_VIEW_HPP
#define SPECTER_VIEW_HPP
#include <boo/boo.hpp>
namespace Specter
{
class View
{
boo::SWindowRect m_rect;
public:
void bindViewport(boo::IGraphicsCommandQueue* gfxQ)
{
gfxQ->setViewport(m_rect);
}
virtual void draw(boo::IGraphicsCommandQueue* gfxQ)=0;
};
}

View File

View File

@ -1,3 +1,80 @@
#include "Specter/RootView.hpp"
namespace Specter
{
void RootView::setWindow(boo::IWindow* window)
{
m_window = window;
float pf = window->getVirtualPixelFactor();
}
void RootView::resized(const boo::SWindowRect& rect)
{
}
void RootView::mouseDown(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods)
{
}
void RootView::mouseUp(const boo::SWindowCoord& coord, boo::EMouseButton button, boo::EModifierKey mods)
{
}
void RootView::mouseMove(const boo::SWindowCoord& coord)
{
}
void RootView::mouseEnter(const boo::SWindowCoord& coord)
{
}
void RootView::mouseLeave(const boo::SWindowCoord& coord)
{
}
void RootView::scroll(const boo::SWindowCoord& coord, const boo::SScrollDelta& scroll)
{
}
void RootView::touchDown(const boo::STouchCoord& coord, uintptr_t tid)
{
}
void RootView::touchUp(const boo::STouchCoord& coord, uintptr_t tid)
{
}
void RootView::touchMove(const boo::STouchCoord& coord, uintptr_t tid)
{
}
void RootView::charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat)
{
}
void RootView::charKeyUp(unsigned long charCode, boo::EModifierKey mods)
{
}
void RootView::specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat)
{
}
void RootView::specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods)
{
}
void RootView::modKeyDown(boo::EModifierKey mod, bool isRepeat)
{
}
void RootView::modKeyUp(boo::EModifierKey mod)
{
}
void RootView::draw(boo::IGraphicsCommandQueue* gfxQ)
{
}
}

6
specter/lib/TextView.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "Specter/TextView.hpp"
namespace Specter
{
}

View File

@ -0,0 +1,6 @@
#include "Specter/View.hpp"
namespace Specter
{
}

View File

@ -0,0 +1,3 @@
bintoc(droidsans-permissive.cpp droidsans-permissive.ttf.gz DROIDSANS_PERMISSIVE)
bintoc(bmonofont-i18n.cpp bmonofont-i18n.ttf.gz BMONOFONT)
add_library(SpecterFonts droidsans-permissive.cpp bmonofont-i18n.cpp)

View File

@ -0,0 +1,100 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below)
'DeJaVu-Lite' changes (removing characters for lighter file size) are in public domain. Source file is accompanied in this directory, BZip2 compressed, DeJaVuSans-Lite.sfd.bz2 .
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT 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 BITSTREAM OR THE GNOME
FOUNDATION 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 FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT 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
TAVMJONG BAH 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 FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.

View File

@ -0,0 +1,92 @@
Specter Mono font based on Blender Mono font.
Specter Mono I18n font includes glyphs imported from the following fonts:
1. DejaVu Sans Mono
2. M+ 1M Regular
3. Wen Quan Yi Micro Hei Mono
4. Droid Sans Hebrew Regular (with some edits)
These were merged using FontForge in the above order. For each glyph,
a license of the font from which it was imported is applied.
----------------------------------------------------------------------
Summary of Copyrights and Licenses
(1) DejaVu Sans Mono
Copyright: 2003 Bitstream, Inc. (Bitstream font glyphs)
2006 Tavmjong Bah (Arev font glyphs)
DejaVu changes are in public domain
License:
DejaVu font glyphs are same as bmonofont.ttf. See LICENSE-bfont.ttf.txt.
(2) M+ 1M Regular
Copyright: 2002-2012 M+ FONTS PROJECT
License:
These fonts are free software.
Unlimited permission is granted to use, copy, and distribute it, with or
without modification, either commercially and noncommercially.
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
(3) Wen Quan Yi Micro Hei Mono
Copyright: 2007 Google Corporation (Digitized data)
2008-2009 WenQuanYi Project Board of Trustees
2008-2009 mozbug and Qianqian Fang (Droid Sans Fallback extension interface)
License: Apache-2.0 or GPL-3 with font embedding exception
See Appendices A and B.
(4) Droid Sans Hebrew Regular
Copyright: 2011 Google Corporation
License: Apache-2.0
See Appendix A.
----------------------------------------------------------------------
Appendix A. Apache License Version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
----------------------------------------------------------------------
Appendix B. GNU GPL Version 3 with font embedding exception
GPL-3:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Font embedding exception:
As a special exception, if you create a document which uses this
font, and embed this font or unaltered portions of this font into
the document, this font does not by itself cause the resulting
document to be covered by the GNU General Public License. This
exception does not however invalidate any other reasons why the
document might be covered by the GNU General Public License. If you
modify this font, you may extend this exception to your version of
the font, but you are not obligated to do so. If you do not wish to
do so, delete this exception statement from your version.

View File

@ -0,0 +1,72 @@
Specter Main font based on Blender main font with GPLv3 licensed glyphs removed.
Specter Main I18n font ("droidsans-permissive.ttf") includes glyphs imported from the following fonts:
1. DejaVu Sans
2. Droid Sans Regular
4. Droid Sans Hebrew Regular
5. Droid Sans Ethiopic Regular
6. KhmerOSsys
These were merged using FontForge in (approximately) the above order. For each glyph,
a license of the font from which it was imported is applied.
----------------------------------------------------------------------
Summary of Copyrights and Licenses
(1) DejaVu Sans
Copyright: 2003 Bitstream, Inc. (Bitstream font glyphs)
2006 Tavmjong Bah (Arev font glyphs)
DejaVu changes are in public domain
License:
DejaVu font glyphs are same as bfont.ttf. See LICENSE-bfont.ttf.txt.
(2), (4), (5) Droid Sans Fonts family
Copyright:
Copyright © 2006, 2007, 2008, 2009, 2010 Google Corp.
Droid is a trademark of Google Corp.
License: Apache-2.0
See Appendix A.
(6) KhmerOSsys
Copyright: 2005, 2006 Danh Hong
2005, 2006 Open Forum of Cambodia
License: GPL-2.1+
See Appendices B.
----------------------------------------------------------------------
Appendix A. Apache License Version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You may
obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.
----------------------------------------------------------------------
Appendix B. GNU GPL Version 2.1
This font is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
On Debian systems, the complete text of the GNU Lesser General Public
License can be found in the file /usr/share/common-licenses/LGPL-2.

Binary file not shown.