summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml3
-rw-r--r--AUTHORS.md3
-rw-r--r--DONORS.md42
-rw-r--r--core/bind/core_bind.cpp34
-rw-r--r--core/bind/core_bind.h7
-rw-r--r--core/class_db.cpp2
-rw-r--r--core/engine.cpp11
-rw-r--r--core/engine.h4
-rw-r--r--core/image.cpp39
-rw-r--r--core/image.h2
-rw-r--r--core/input_map.cpp8
-rw-r--r--core/input_map.h1
-rw-r--r--core/io/marshalls.cpp4
-rw-r--r--core/io/multiplayer_api.cpp79
-rw-r--r--core/io/multiplayer_api.h13
-rw-r--r--core/io/packet_peer.cpp2
-rw-r--r--core/math/geometry.h15
-rw-r--r--core/math/math_2d.cpp10
-rw-r--r--core/math/math_2d.h2
-rw-r--r--core/math/vector3.h6
-rw-r--r--core/method_bind.h28
-rw-r--r--core/oa_hash_map.h617
-rw-r--r--core/object.cpp4
-rw-r--r--core/object.h5
-rw-r--r--core/os/os.cpp1
-rw-r--r--core/os/os.h14
-rw-r--r--core/script_debugger_local.cpp207
-rw-r--r--core/script_debugger_local.h6
-rw-r--r--core/script_debugger_remote.cpp13
-rw-r--r--core/script_debugger_remote.h2
-rw-r--r--core/script_language.h3
-rw-r--r--core/self_list.h41
-rw-r--r--core/ustring.cpp4
-rw-r--r--core/variant.h1
-rw-r--r--core/variant_call.cpp6
-rw-r--r--doc/classes/@GDScript.xml12
-rw-r--r--doc/classes/AnimatedSprite.xml2
-rw-r--r--doc/classes/ArrayMesh.xml8
-rw-r--r--doc/classes/AudioStreamPlayer.xml1
-rw-r--r--doc/classes/AudioStreamPlayer2D.xml1
-rw-r--r--doc/classes/AudioStreamPlayer3D.xml1
-rw-r--r--doc/classes/BaseButton.xml10
-rw-r--r--doc/classes/Bone2D.xml39
-rw-r--r--doc/classes/CanvasItem.xml3
-rw-r--r--doc/classes/Color.xml4
-rw-r--r--doc/classes/ColorPickerButton.xml4
-rw-r--r--doc/classes/Curve2D.xml16
-rw-r--r--doc/classes/Curve3D.xml16
-rw-r--r--doc/classes/DynamicFont.xml4
-rw-r--r--doc/classes/EditorPlugin.xml10
-rw-r--r--doc/classes/Engine.xml8
-rw-r--r--doc/classes/Font.xml10
-rw-r--r--doc/classes/Generic6DOFJoint.xml57
-rw-r--r--doc/classes/Geometry.xml15
-rw-r--r--doc/classes/GridContainer.xml10
-rw-r--r--doc/classes/Image.xml20
-rw-r--r--doc/classes/Input.xml18
-rw-r--r--doc/classes/InputEvent.xml15
-rw-r--r--doc/classes/InputMap.xml23
-rw-r--r--doc/classes/InstancePlaceholder.xml10
-rw-r--r--doc/classes/Label.xml2
-rw-r--r--doc/classes/LineEdit.xml2
-rw-r--r--doc/classes/MultiplayerAPI.xml69
-rw-r--r--doc/classes/NetworkedMultiplayerPeer.xml3
-rw-r--r--doc/classes/Node.xml23
-rw-r--r--doc/classes/OS.xml10
-rw-r--r--doc/classes/OptionButton.xml2
-rw-r--r--doc/classes/PacketPeerUDP.xml4
-rw-r--r--doc/classes/PanoramaSky.xml3
-rw-r--r--doc/classes/Path.xml6
-rw-r--r--doc/classes/PhysicalBone.xml55
-rw-r--r--doc/classes/Physics2DServer.xml2
-rw-r--r--doc/classes/PhysicsServer.xml27
-rw-r--r--doc/classes/Polygon2D.xml70
-rw-r--r--doc/classes/Popup.xml2
-rw-r--r--doc/classes/PrimitiveMesh.xml4
-rw-r--r--doc/classes/RichTextLabel.xml15
-rw-r--r--doc/classes/SceneTree.xml3
-rw-r--r--doc/classes/ScrollContainer.xml2
-rw-r--r--doc/classes/Skeleton.xml24
-rw-r--r--doc/classes/Skeleton2D.xml35
-rw-r--r--doc/classes/SpatialMaterial.xml6
-rw-r--r--doc/classes/TileMap.xml47
-rw-r--r--doc/classes/TileSet.xml18
-rw-r--r--doc/classes/Timer.xml4
-rw-r--r--doc/classes/Tween.xml111
-rw-r--r--doc/classes/Vector2.xml56
-rw-r--r--doc/classes/Vector3.xml48
-rw-r--r--doc/classes/Viewport.xml3
-rw-r--r--doc/classes/VisualServer.xml37
-rw-r--r--doc/classes/WebSocketClient.xml57
-rw-r--r--doc/classes/WebSocketPeer.xml51
-rw-r--r--doc/classes/WebSocketServer.xml69
-rwxr-xr-x[-rw-r--r--]doc/tools/makerst.py37
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.cpp13
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.h1
-rw-r--r--drivers/dummy/rasterizer_dummy.h14
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp49
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp9
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h2
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp105
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.h5
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp48
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp7
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp64
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h4
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp1
-rw-r--r--drivers/gles3/shaders/canvas.glsl58
-rw-r--r--drivers/gles3/shaders/scene.glsl6
-rw-r--r--drivers/gles3/shaders/tonemap.glsl4
-rw-r--r--drivers/unix/os_unix.cpp19
-rw-r--r--drivers/unix/os_unix.h1
-rw-r--r--drivers/windows/file_access_windows.cpp2
-rw-r--r--editor/code_editor.cpp20
-rw-r--r--editor/connections_dialog.cpp676
-rw-r--r--editor/connections_dialog.h85
-rw-r--r--editor/create_dialog.cpp9
-rw-r--r--editor/dependency_editor.cpp26
-rw-r--r--editor/editor_autoload_settings.cpp164
-rw-r--r--editor/editor_autoload_settings.h2
-rw-r--r--editor/editor_data.cpp12
-rw-r--r--editor/editor_data.h3
-rw-r--r--editor/editor_fonts.cpp65
-rw-r--r--editor/editor_help.cpp224
-rw-r--r--editor/editor_help.h46
-rw-r--r--editor/editor_node.cpp7
-rw-r--r--editor/editor_plugin.cpp5
-rw-r--r--editor/editor_plugin.h1
-rw-r--r--editor/editor_settings.cpp28
-rw-r--r--editor/editor_themes.cpp17
-rw-r--r--editor/filesystem_dock.cpp17
-rw-r--r--editor/filesystem_dock.h3
-rw-r--r--editor/icons/icon_bone_2_d.svg61
-rw-r--r--editor/icons/icon_physical_bone.svg77
-rw-r--r--editor/icons/icon_play_overlay.svg4
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp2
-rw-r--r--editor/output_strings.cpp1
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp29
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp302
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h25
-rw-r--r--editor/plugins/editor_preview_plugins.cpp9
-rw-r--r--editor/plugins/physical_bone_plugin.cpp123
-rw-r--r--editor/plugins/physical_bone_plugin.h78
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp220
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.h8
-rw-r--r--editor/plugins/script_text_editor.cpp6
-rw-r--r--editor/plugins/skeleton_editor_plugin.cpp183
-rw-r--r--editor/plugins/skeleton_editor_plugin.h95
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp54
-rw-r--r--editor/plugins/theme_editor_plugin.cpp56
-rw-r--r--editor/project_export.cpp9
-rw-r--r--editor/project_manager.cpp12
-rw-r--r--editor/project_settings_editor.cpp11
-rw-r--r--editor/property_editor.cpp24
-rw-r--r--editor/rename_dialog.cpp691
-rw-r--r--editor/rename_dialog.h119
-rw-r--r--editor/scene_tree_dock.cpp22
-rw-r--r--editor/scene_tree_dock.h3
-rw-r--r--editor/script_editor_debugger.cpp51
-rw-r--r--editor/script_editor_debugger.h4
-rw-r--r--editor/settings_config_dialog.cpp9
-rw-r--r--editor/spatial_editor_gizmos.cpp137
-rw-r--r--editor/spatial_editor_gizmos.h13
-rw-r--r--editor/translations/af.po46
-rw-r--r--editor/translations/ar.po52
-rw-r--r--editor/translations/bg.po46
-rw-r--r--editor/translations/bn.po60
-rw-r--r--editor/translations/ca.po64
-rw-r--r--editor/translations/cs.po51
-rw-r--r--editor/translations/da.po97
-rw-r--r--editor/translations/de.po100
-rw-r--r--editor/translations/de_CH.po51
-rw-r--r--editor/translations/editor.pot46
-rw-r--r--editor/translations/el.po62
-rw-r--r--editor/translations/es.po135
-rw-r--r--editor/translations/es_AR.po62
-rw-r--r--editor/translations/fa.po155
-rw-r--r--editor/translations/fi.po60
-rw-r--r--editor/translations/fr.po389
-rw-r--r--editor/translations/he.po155
-rw-r--r--editor/translations/hi.po46
-rw-r--r--editor/translations/hu.po306
-rw-r--r--editor/translations/id.po78
-rw-r--r--editor/translations/is.po46
-rw-r--r--editor/translations/it.po164
-rw-r--r--editor/translations/ja.po71
-rw-r--r--editor/translations/ko.po88
-rw-r--r--editor/translations/lt.po46
-rw-r--r--editor/translations/nb.po348
-rw-r--r--editor/translations/nl.po626
-rw-r--r--editor/translations/pl.po67
-rw-r--r--editor/translations/pr.po46
-rw-r--r--editor/translations/pt_BR.po119
-rw-r--r--editor/translations/pt_PT.po113
-rw-r--r--editor/translations/ro.po551
-rw-r--r--editor/translations/ru.po98
-rw-r--r--editor/translations/sk.po46
-rw-r--r--editor/translations/sl.po396
-rw-r--r--editor/translations/sr_Cyrl.po50
-rw-r--r--editor/translations/sr_Latn.po7954
-rw-r--r--editor/translations/sv.po46
-rw-r--r--editor/translations/ta.po46
-rw-r--r--editor/translations/th.po62
-rw-r--r--editor/translations/tr.po96
-rw-r--r--editor/translations/uk.po79
-rw-r--r--editor/translations/ur_PK.po46
-rw-r--r--editor/translations/vi.po89
-rw-r--r--editor/translations/zh_CN.po189
-rw-r--r--editor/translations/zh_HK.po51
-rw-r--r--editor/translations/zh_TW.po240
-rw-r--r--main/main.cpp490
-rw-r--r--main/main.h1
-rw-r--r--main/tests/test_oa_hash_map.cpp6
-rw-r--r--methods.py21
-rw-r--r--misc/dist/html/default.html6
-rw-r--r--misc/dist/linux/godot.64
-rw-r--r--modules/bmp/SCsub9
-rw-r--r--modules/bmp/config.py7
-rw-r--r--modules/bmp/image_loader_bmp.cpp194
-rw-r--r--modules/bmp/image_loader_bmp.h84
-rw-r--r--modules/bmp/register_types.cpp44
-rw-r--r--modules/bmp/register_types.h32
-rw-r--r--modules/bullet/generic_6dof_joint_bullet.cpp13
-rw-r--r--modules/bullet/godot_result_callbacks.cpp2
-rw-r--r--modules/csg/config.py16
-rw-r--r--modules/csg/csg.cpp2
-rw-r--r--modules/csg/csg.h2
-rw-r--r--modules/csg/csg_shape.cpp10
-rw-r--r--modules/csg/doc_classes/CSGBox.xml25
-rw-r--r--modules/csg/doc_classes/CSGCombiner.xml15
-rw-r--r--modules/csg/doc_classes/CSGCylinder.xml29
-rw-r--r--modules/csg/doc_classes/CSGMesh.xml19
-rw-r--r--modules/csg/doc_classes/CSGPolygon.xml49
-rw-r--r--modules/csg/doc_classes/CSGPrimitive.xml19
-rw-r--r--modules/csg/doc_classes/CSGShape.xml35
-rw-r--r--modules/csg/doc_classes/CSGSphere.xml27
-rw-r--r--modules/csg/doc_classes/CSGTorus.xml29
-rw-r--r--modules/enet/doc_classes/NetworkedMultiplayerENet.xml60
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp167
-rw-r--r--modules/enet/networked_multiplayer_enet.h17
-rw-r--r--modules/freetype/SCsub3
-rw-r--r--modules/gdnative/SCsub35
-rw-r--r--modules/gdnative/gdnative.cpp4
-rw-r--r--modules/gdnative/gdnative_api.json13
-rw-r--r--modules/gdscript/SCsub3
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp (renamed from modules/gdscript/gdscript_highlighter.cpp)73
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.h (renamed from modules/gdscript/gdscript_highlighter.h)14
-rw-r--r--modules/gdscript/gdscript.cpp9
-rw-r--r--modules/gdscript/gdscript.h6
-rw-r--r--modules/gdscript/gdscript_compiler.cpp24
-rw-r--r--modules/gdscript/gdscript_compiler.h3
-rw-r--r--modules/gdscript/gdscript_editor.cpp2
-rw-r--r--modules/gdscript/gdscript_function.cpp15
-rw-r--r--modules/gdscript/gdscript_function.h10
-rw-r--r--modules/gdscript/gdscript_functions.cpp40
-rw-r--r--modules/gdscript/gdscript_functions.h1
-rw-r--r--modules/gdscript/gdscript_parser.cpp58
-rw-r--r--modules/gdscript/register_types.cpp2
-rw-r--r--modules/mono/csharp_script.cpp2
-rw-r--r--modules/mono/glue/cs_files/Vector2.cs10
-rw-r--r--modules/mono/glue/cs_files/Vector3.cs5
-rw-r--r--modules/visual_script/register_types.cpp2
-rw-r--r--modules/webm/libvpx/SCsub5
-rw-r--r--modules/websocket/config.py11
-rw-r--r--modules/websocket/doc_classes/WebSocketClient.xml70
-rw-r--r--modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml (renamed from doc/classes/WebSocketMultiplayerPeer.xml)4
-rw-r--r--modules/websocket/doc_classes/WebSocketPeer.xml75
-rw-r--r--modules/websocket/doc_classes/WebSocketServer.xml109
-rw-r--r--modules/websocket/websocket_server.cpp6
-rw-r--r--platform/android/AndroidManifest.xml.template2
-rw-r--r--platform/android/build.gradle.template1
-rw-r--r--platform/android/export/export.cpp4
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java10
-rw-r--r--platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java8
-rw-r--r--platform/iphone/app_delegate.h1
-rw-r--r--platform/iphone/app_delegate.mm98
-rw-r--r--platform/javascript/engine.js21
-rw-r--r--platform/javascript/export/export.cpp2
-rw-r--r--platform/javascript/os_javascript.cpp12
-rw-r--r--platform/osx/os_osx.h6
-rw-r--r--platform/osx/os_osx.mm160
-rw-r--r--platform/uwp/export/export.cpp4
-rw-r--r--platform/windows/detect.py10
-rw-r--r--platform/windows/os_windows.cpp195
-rw-r--r--platform/windows/os_windows.h14
-rw-r--r--platform/x11/context_gl_x11.cpp83
-rw-r--r--platform/x11/context_gl_x11.h1
-rw-r--r--platform/x11/detect.py6
-rw-r--r--platform/x11/os_x11.cpp81
-rw-r--r--platform/x11/os_x11.h6
-rw-r--r--scene/2d/animated_sprite.cpp46
-rw-r--r--scene/2d/animated_sprite.h5
-rw-r--r--scene/2d/canvas_item.cpp2
-rw-r--r--scene/2d/canvas_item.h6
-rw-r--r--scene/2d/light_occluder_2d.cpp6
-rw-r--r--scene/2d/light_occluder_2d.h2
-rw-r--r--scene/2d/line_2d.cpp3
-rw-r--r--scene/2d/parallax_layer.cpp1
-rw-r--r--scene/2d/polygon_2d.cpp86
-rw-r--r--scene/2d/skeleton_2d.cpp84
-rw-r--r--scene/2d/skeleton_2d.h11
-rw-r--r--scene/2d/sprite.cpp34
-rw-r--r--scene/2d/tile_map.cpp8
-rw-r--r--scene/3d/camera.h4
-rw-r--r--scene/3d/particles.cpp25
-rw-r--r--scene/3d/physics_body.cpp1113
-rw-r--r--scene/3d/physics_body.h264
-rw-r--r--scene/3d/physics_joint.cpp21
-rw-r--r--scene/3d/physics_joint.h3
-rw-r--r--scene/3d/skeleton.cpp177
-rw-r--r--scene/3d/skeleton.h37
-rw-r--r--scene/3d/spatial.cpp19
-rw-r--r--scene/3d/spatial.h7
-rw-r--r--scene/3d/sprite_3d.cpp29
-rw-r--r--scene/3d/vehicle_body.cpp5
-rw-r--r--scene/3d/voxel_light_baker.cpp5
-rw-r--r--scene/animation/animation_player.cpp22
-rw-r--r--scene/animation/animation_tree_player.cpp8
-rw-r--r--scene/animation/animation_tree_player.h2
-rw-r--r--scene/gui/base_button.cpp16
-rw-r--r--scene/gui/base_button.h4
-rw-r--r--scene/gui/item_list.cpp5
-rw-r--r--scene/gui/label.cpp12
-rw-r--r--scene/gui/line_edit.cpp13
-rw-r--r--scene/gui/line_edit.h4
-rw-r--r--scene/gui/option_button.cpp2
-rw-r--r--scene/gui/progress_bar.cpp9
-rw-r--r--scene/gui/rich_text_label.cpp135
-rw-r--r--scene/gui/rich_text_label.h8
-rw-r--r--scene/gui/split_container.cpp7
-rw-r--r--scene/gui/text_edit.cpp1584
-rw-r--r--scene/gui/text_edit.h60
-rw-r--r--scene/main/instance_placeholder.cpp24
-rw-r--r--scene/main/instance_placeholder.h1
-rw-r--r--scene/main/node.cpp47
-rw-r--r--scene/main/node.h10
-rw-r--r--scene/main/scene_tree.cpp74
-rw-r--r--scene/main/scene_tree.h8
-rwxr-xr-xscene/main/timer.cpp7
-rwxr-xr-xscene/main/timer.h2
-rw-r--r--scene/main/viewport.cpp73
-rw-r--r--scene/main/viewport.h11
-rw-r--r--scene/register_scene_types.cpp1
-rw-r--r--scene/resources/curve.cpp166
-rw-r--r--scene/resources/curve.h4
-rw-r--r--scene/resources/default_theme/default_theme.cpp7
-rw-r--r--scene/resources/dynamic_font.cpp540
-rw-r--r--scene/resources/dynamic_font.h37
-rw-r--r--scene/resources/dynamic_font_stb.cpp22
-rw-r--r--scene/resources/dynamic_font_stb.h4
-rw-r--r--scene/resources/font.cpp43
-rw-r--r--scene/resources/font.h49
-rw-r--r--scene/resources/material.cpp8
-rw-r--r--scene/resources/material.h3
-rw-r--r--scene/resources/mesh.cpp4
-rw-r--r--scene/resources/primitive_meshes.cpp56
-rw-r--r--scene/resources/primitive_meshes.h8
-rw-r--r--scene/resources/style_box.cpp2
-rw-r--r--scene/scene_string_names.cpp1
-rw-r--r--scene/scene_string_names.h1
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp4
-rw-r--r--servers/physics_2d/space_2d_sw.cpp1
-rw-r--r--servers/physics_server.cpp3
-rw-r--r--servers/physics_server.h3
-rw-r--r--servers/visual/rasterizer.h7
-rw-r--r--servers/visual/shader_language.cpp46
-rw-r--r--servers/visual/shader_language.h1
-rw-r--r--servers/visual/shader_types.cpp3
-rw-r--r--servers/visual/visual_server_canvas.cpp6
-rw-r--r--servers/visual/visual_server_canvas.h4
-rw-r--r--servers/visual/visual_server_raster.h5
-rw-r--r--servers/visual/visual_server_viewport.cpp36
-rw-r--r--servers/visual/visual_server_viewport.h3
-rw-r--r--servers/visual/visual_server_wrap_mt.h5
-rw-r--r--servers/visual_server.cpp3
-rw-r--r--servers/visual_server.h5
-rw-r--r--thirdparty/README.md4
-rw-r--r--thirdparty/fonts/NotoSansUI_Bold.ttfbin0 -> 311496 bytes
-rw-r--r--thirdparty/freetype/FTL.TXT2
-rw-r--r--thirdparty/freetype/include/freetype/config/ftconfig.h108
-rw-r--r--thirdparty/freetype/include/freetype/config/ftheader.h128
-rw-r--r--thirdparty/freetype/include/freetype/config/ftoption.h93
-rw-r--r--thirdparty/freetype/include/freetype/config/ftstdlib.h2
-rw-r--r--thirdparty/freetype/include/freetype/freetype.h270
-rw-r--r--thirdparty/freetype/include/freetype/ftadvanc.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftbbox.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftbdf.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftbitmap.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftbzip2.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftcache.h17
-rw-r--r--thirdparty/freetype/include/freetype/ftchapters.h3
-rw-r--r--thirdparty/freetype/include/freetype/ftcid.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftdriver.h1225
-rw-r--r--thirdparty/freetype/include/freetype/fterrdef.h2
-rw-r--r--thirdparty/freetype/include/freetype/fterrors.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftfntfmt.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftgasp.h7
-rw-r--r--thirdparty/freetype/include/freetype/ftglyph.h6
-rw-r--r--thirdparty/freetype/include/freetype/ftgxval.h10
-rw-r--r--thirdparty/freetype/include/freetype/ftgzip.h5
-rw-r--r--thirdparty/freetype/include/freetype/ftimage.h36
-rw-r--r--thirdparty/freetype/include/freetype/ftincrem.h15
-rw-r--r--thirdparty/freetype/include/freetype/ftlcdfil.h23
-rw-r--r--thirdparty/freetype/include/freetype/ftlist.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftlzw.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftmac.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftmm.h110
-rw-r--r--thirdparty/freetype/include/freetype/ftmodapi.h23
-rw-r--r--thirdparty/freetype/include/freetype/ftmoderr.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftotval.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftoutln.h11
-rw-r--r--thirdparty/freetype/include/freetype/ftparams.h205
-rw-r--r--thirdparty/freetype/include/freetype/ftpfr.h8
-rw-r--r--thirdparty/freetype/include/freetype/ftrender.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftsizes.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftsnames.h50
-rw-r--r--thirdparty/freetype/include/freetype/ftstroke.h12
-rw-r--r--thirdparty/freetype/include/freetype/ftsynth.h2
-rw-r--r--thirdparty/freetype/include/freetype/ftsystem.h2
-rw-r--r--thirdparty/freetype/include/freetype/fttrigon.h2
-rw-r--r--thirdparty/freetype/include/freetype/fttypes.h4
-rw-r--r--thirdparty/freetype/include/freetype/ftwinfnt.h4
-rw-r--r--thirdparty/freetype/include/freetype/internal/autohint.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/cffotypes.h108
-rw-r--r--thirdparty/freetype/include/freetype/internal/cfftypes.h412
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftcalc.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftdebug.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftdrv.h400
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftgloadr.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftmemory.h4
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftobjs.h85
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftpic.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftpsprop.h48
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftrfork.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftserv.h103
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftstream.h6
-rw-r--r--thirdparty/freetype/include/freetype/internal/fttrace.h9
-rw-r--r--thirdparty/freetype/include/freetype/internal/ftvalid.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/internal.h8
-rw-r--r--thirdparty/freetype/include/freetype/internal/psaux.h501
-rw-r--r--thirdparty/freetype/include/freetype/internal/pshints.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svbdf.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svcfftl.h112
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svcid.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svfntfmt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svgldict.h6
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svgxval.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svkern.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svmetric.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svmm.h57
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svotval.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpfr.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpostnm.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svprop.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpscmap.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svpsinfo.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svsfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svttcmap.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svtteng.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svttglyf.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/services/svwinfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/sfnt.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/t1types.h2
-rw-r--r--thirdparty/freetype/include/freetype/internal/tttypes.h12
-rw-r--r--thirdparty/freetype/include/freetype/t1tables.h11
-rw-r--r--thirdparty/freetype/include/freetype/ttnameid.h4
-rw-r--r--thirdparty/freetype/include/freetype/tttables.h2
-rw-r--r--thirdparty/freetype/include/freetype/tttags.h2
-rw-r--r--thirdparty/freetype/include/ft2build.h2
-rw-r--r--thirdparty/freetype/src/autofit/afangles.c2
-rw-r--r--thirdparty/freetype/src/autofit/afblue.c8
-rw-r--r--thirdparty/freetype/src/autofit/afblue.cin2
-rw-r--r--thirdparty/freetype/src/autofit/afblue.dat10
-rw-r--r--thirdparty/freetype/src/autofit/afblue.h300
-rw-r--r--thirdparty/freetype/src/autofit/afblue.hin2
-rw-r--r--thirdparty/freetype/src/autofit/afcjk.c6
-rw-r--r--thirdparty/freetype/src/autofit/afcjk.h2
-rw-r--r--thirdparty/freetype/src/autofit/afcover.h2
-rw-r--r--thirdparty/freetype/src/autofit/afdummy.c2
-rw-r--r--thirdparty/freetype/src/autofit/afdummy.h2
-rw-r--r--thirdparty/freetype/src/autofit/aferrors.h2
-rw-r--r--thirdparty/freetype/src/autofit/afglobal.c2
-rw-r--r--thirdparty/freetype/src/autofit/afglobal.h2
-rw-r--r--thirdparty/freetype/src/autofit/afhints.c15
-rw-r--r--thirdparty/freetype/src/autofit/afhints.h4
-rw-r--r--thirdparty/freetype/src/autofit/afindic.c2
-rw-r--r--thirdparty/freetype/src/autofit/afindic.h2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin.c2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin.h2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin2.c2
-rw-r--r--thirdparty/freetype/src/autofit/aflatin2.h2
-rw-r--r--thirdparty/freetype/src/autofit/afloader.c2
-rw-r--r--thirdparty/freetype/src/autofit/afloader.h2
-rw-r--r--thirdparty/freetype/src/autofit/afmodule.c4
-rw-r--r--thirdparty/freetype/src/autofit/afmodule.h2
-rw-r--r--thirdparty/freetype/src/autofit/afpic.c2
-rw-r--r--thirdparty/freetype/src/autofit/afpic.h2
-rw-r--r--thirdparty/freetype/src/autofit/afranges.c27
-rw-r--r--thirdparty/freetype/src/autofit/afranges.h2
-rw-r--r--thirdparty/freetype/src/autofit/afscript.h4
-rw-r--r--thirdparty/freetype/src/autofit/afshaper.c33
-rw-r--r--thirdparty/freetype/src/autofit/afshaper.h2
-rw-r--r--thirdparty/freetype/src/autofit/afstyles.h2
-rw-r--r--thirdparty/freetype/src/autofit/aftypes.h8
-rw-r--r--thirdparty/freetype/src/autofit/afwarp.c2
-rw-r--r--thirdparty/freetype/src/autofit/afwarp.h2
-rw-r--r--thirdparty/freetype/src/autofit/afwrtsys.h2
-rw-r--r--thirdparty/freetype/src/autofit/autofit.c2
-rw-r--r--thirdparty/freetype/src/autofit/module.mk2
-rw-r--r--thirdparty/freetype/src/autofit/rules.mk2
-rw-r--r--thirdparty/freetype/src/base/basepic.c2
-rw-r--r--thirdparty/freetype/src/base/basepic.h2
-rw-r--r--thirdparty/freetype/src/base/ftadvanc.c16
-rw-r--r--thirdparty/freetype/src/base/ftapi.c2
-rw-r--r--thirdparty/freetype/src/base/ftbase.c5
-rw-r--r--thirdparty/freetype/src/base/ftbase.h8
-rw-r--r--thirdparty/freetype/src/base/ftbbox.c2
-rw-r--r--thirdparty/freetype/src/base/ftbdf.c2
-rw-r--r--thirdparty/freetype/src/base/ftbitmap.c77
-rw-r--r--thirdparty/freetype/src/base/ftcalc.c2
-rw-r--r--thirdparty/freetype/src/base/ftcid.c2
-rw-r--r--thirdparty/freetype/src/base/ftdbgmem.c10
-rw-r--r--thirdparty/freetype/src/base/ftdebug.c4
-rw-r--r--thirdparty/freetype/src/base/ftfntfmt.c2
-rw-r--r--thirdparty/freetype/src/base/ftfstype.c2
-rw-r--r--thirdparty/freetype/src/base/ftgasp.c2
-rw-r--r--thirdparty/freetype/src/base/ftgloadr.c2
-rw-r--r--thirdparty/freetype/src/base/ftglyph.c2
-rw-r--r--thirdparty/freetype/src/base/ftgxval.c2
-rw-r--r--thirdparty/freetype/src/base/ftinit.c2
-rw-r--r--thirdparty/freetype/src/base/ftlcdfil.c59
-rw-r--r--thirdparty/freetype/src/base/ftmac.c2
-rw-r--r--thirdparty/freetype/src/base/ftmm.c81
-rw-r--r--thirdparty/freetype/src/base/ftobjs.c470
-rw-r--r--thirdparty/freetype/src/base/ftotval.c2
-rw-r--r--thirdparty/freetype/src/base/ftoutln.c13
-rw-r--r--thirdparty/freetype/src/base/ftpatent.c2
-rw-r--r--thirdparty/freetype/src/base/ftpfr.c2
-rw-r--r--thirdparty/freetype/src/base/ftpic.c2
-rw-r--r--thirdparty/freetype/src/base/ftpsprop.c285
-rw-r--r--thirdparty/freetype/src/base/ftrfork.c4
-rw-r--r--thirdparty/freetype/src/base/ftsnames.c2
-rw-r--r--thirdparty/freetype/src/base/ftstream.c2
-rw-r--r--thirdparty/freetype/src/base/ftstroke.c2
-rw-r--r--thirdparty/freetype/src/base/ftsynth.c2
-rw-r--r--thirdparty/freetype/src/base/ftsystem.c2
-rw-r--r--thirdparty/freetype/src/base/fttrigon.c2
-rw-r--r--thirdparty/freetype/src/base/fttype1.c2
-rw-r--r--thirdparty/freetype/src/base/ftutil.c2
-rw-r--r--thirdparty/freetype/src/base/ftver.rc61
-rw-r--r--thirdparty/freetype/src/base/ftwinfnt.c2
-rw-r--r--thirdparty/freetype/src/base/rules.mk5
-rw-r--r--thirdparty/freetype/src/bdf/README2
-rw-r--r--thirdparty/freetype/src/bdf/bdfdrivr.c2
-rw-r--r--thirdparty/freetype/src/bdf/bdflib.c12
-rw-r--r--thirdparty/freetype/src/bzip2/ftbzip2.c2
-rw-r--r--thirdparty/freetype/src/bzip2/rules.mk2
-rw-r--r--thirdparty/freetype/src/cache/ftcache.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcbasic.c2
-rw-r--r--thirdparty/freetype/src/cache/ftccache.c2
-rw-r--r--thirdparty/freetype/src/cache/ftccache.h2
-rw-r--r--thirdparty/freetype/src/cache/ftccback.h2
-rw-r--r--thirdparty/freetype/src/cache/ftccmap.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcerror.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcglyph.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcglyph.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcimage.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcimage.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcmanag.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcmanag.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcmru.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcmru.h2
-rw-r--r--thirdparty/freetype/src/cache/ftcsbits.c2
-rw-r--r--thirdparty/freetype/src/cache/ftcsbits.h2
-rw-r--r--thirdparty/freetype/src/cache/rules.mk2
-rw-r--r--thirdparty/freetype/src/cff/cff.c13
-rw-r--r--thirdparty/freetype/src/cff/cffcmap.c2
-rw-r--r--thirdparty/freetype/src/cff/cffcmap.h4
-rw-r--r--thirdparty/freetype/src/cff/cffdrivr.c381
-rw-r--r--thirdparty/freetype/src/cff/cffdrivr.h2
-rw-r--r--thirdparty/freetype/src/cff/cfferrs.h2
-rw-r--r--thirdparty/freetype/src/cff/cffgload.c2623
-rw-r--r--thirdparty/freetype/src/cff/cffgload.h187
-rw-r--r--thirdparty/freetype/src/cff/cffload.c84
-rw-r--r--thirdparty/freetype/src/cff/cffload.h9
-rw-r--r--thirdparty/freetype/src/cff/cffobjs.c120
-rw-r--r--thirdparty/freetype/src/cff/cffobjs.h106
-rw-r--r--thirdparty/freetype/src/cff/cffparse.c27
-rw-r--r--thirdparty/freetype/src/cff/cffparse.h4
-rw-r--r--thirdparty/freetype/src/cff/cffpic.c2
-rw-r--r--thirdparty/freetype/src/cff/cffpic.h7
-rw-r--r--thirdparty/freetype/src/cff/cfftoken.h2
-rw-r--r--thirdparty/freetype/src/cff/module.mk2
-rw-r--r--thirdparty/freetype/src/cff/rules.mk19
-rw-r--r--thirdparty/freetype/src/cid/ciderrs.h2
-rw-r--r--thirdparty/freetype/src/cid/cidgload.c87
-rw-r--r--thirdparty/freetype/src/cid/cidgload.h2
-rw-r--r--thirdparty/freetype/src/cid/cidload.c2
-rw-r--r--thirdparty/freetype/src/cid/cidload.h2
-rw-r--r--thirdparty/freetype/src/cid/cidobjs.c40
-rw-r--r--thirdparty/freetype/src/cid/cidobjs.h2
-rw-r--r--thirdparty/freetype/src/cid/cidparse.c2
-rw-r--r--thirdparty/freetype/src/cid/cidparse.h2
-rw-r--r--thirdparty/freetype/src/cid/cidriver.c22
-rw-r--r--thirdparty/freetype/src/cid/cidriver.h2
-rw-r--r--thirdparty/freetype/src/cid/cidtoken.h2
-rw-r--r--thirdparty/freetype/src/cid/module.mk2
-rw-r--r--thirdparty/freetype/src/cid/rules.mk2
-rw-r--r--thirdparty/freetype/src/cid/type1cid.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/README12
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvalid.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvalid.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvbsln.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvcommn.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvcommn.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxverror.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfeat.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfeat.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvfgen.c4
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvjust.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvkern.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvlcar.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmod.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmod.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort0.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort1.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort2.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort4.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmort5.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx.h2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx0.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx1.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx2.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx4.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvmorx5.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvopbd.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvprop.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/gxvtrak.c2
-rw-r--r--thirdparty/freetype/src/gxvalid/module.mk2
-rw-r--r--thirdparty/freetype/src/gxvalid/rules.mk2
-rw-r--r--thirdparty/freetype/src/gzip/ftgzip.c2
-rw-r--r--thirdparty/freetype/src/gzip/rules.mk2
-rw-r--r--thirdparty/freetype/src/lzw/ftlzw.c2
-rw-r--r--thirdparty/freetype/src/lzw/ftzopen.c2
-rw-r--r--thirdparty/freetype/src/lzw/ftzopen.h2
-rw-r--r--thirdparty/freetype/src/lzw/rules.mk2
-rw-r--r--thirdparty/freetype/src/otvalid/module.mk2
-rw-r--r--thirdparty/freetype/src/otvalid/otvalid.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvalid.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvbase.c35
-rw-r--r--thirdparty/freetype/src/otvalid/otvcommn.c30
-rw-r--r--thirdparty/freetype/src/otvalid/otvcommn.h54
-rw-r--r--thirdparty/freetype/src/otvalid/otverror.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgdef.c113
-rw-r--r--thirdparty/freetype/src/otvalid/otvgpos.c56
-rw-r--r--thirdparty/freetype/src/otvalid/otvgpos.h2
-rw-r--r--thirdparty/freetype/src/otvalid/otvgsub.c36
-rw-r--r--thirdparty/freetype/src/otvalid/otvjstf.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvmath.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvmod.c2
-rw-r--r--thirdparty/freetype/src/otvalid/otvmod.h2
-rw-r--r--thirdparty/freetype/src/otvalid/rules.mk2
-rw-r--r--thirdparty/freetype/src/pcf/pcfdrivr.c2
-rw-r--r--thirdparty/freetype/src/pcf/pcfread.c6
-rw-r--r--thirdparty/freetype/src/pfr/module.mk2
-rw-r--r--thirdparty/freetype/src/pfr/pfr.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrcmap.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrcmap.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrdrivr.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrdrivr.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrerror.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrgload.c12
-rw-r--r--thirdparty/freetype/src/pfr/pfrgload.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrload.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrload.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrobjs.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrobjs.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrsbit.c2
-rw-r--r--thirdparty/freetype/src/pfr/pfrsbit.h2
-rw-r--r--thirdparty/freetype/src/pfr/pfrtypes.h2
-rw-r--r--thirdparty/freetype/src/pfr/rules.mk2
-rw-r--r--thirdparty/freetype/src/psaux/afmparse.c2
-rw-r--r--thirdparty/freetype/src/psaux/afmparse.h2
-rw-r--r--thirdparty/freetype/src/psaux/cffdecode.c2370
-rw-r--r--thirdparty/freetype/src/psaux/cffdecode.h64
-rw-r--r--thirdparty/freetype/src/psaux/module.mk2
-rw-r--r--thirdparty/freetype/src/psaux/psarrst.c241
-rw-r--r--thirdparty/freetype/src/psaux/psarrst.h100
-rw-r--r--thirdparty/freetype/src/psaux/psaux.c13
-rw-r--r--thirdparty/freetype/src/psaux/psauxerr.h2
-rw-r--r--thirdparty/freetype/src/psaux/psauxmod.c56
-rw-r--r--thirdparty/freetype/src/psaux/psauxmod.h11
-rw-r--r--thirdparty/freetype/src/psaux/psblues.c582
-rw-r--r--thirdparty/freetype/src/psaux/psblues.h185
-rw-r--r--thirdparty/freetype/src/psaux/psconv.c2
-rw-r--r--thirdparty/freetype/src/psaux/psconv.h2
-rw-r--r--thirdparty/freetype/src/psaux/pserror.c52
-rw-r--r--thirdparty/freetype/src/psaux/pserror.h119
-rw-r--r--thirdparty/freetype/src/psaux/psfixed.h95
-rw-r--r--thirdparty/freetype/src/psaux/psfont.c567
-rw-r--r--thirdparty/freetype/src/psaux/psfont.h134
-rw-r--r--thirdparty/freetype/src/psaux/psft.c890
-rw-r--r--thirdparty/freetype/src/psaux/psft.h167
-rw-r--r--thirdparty/freetype/src/psaux/psglue.h144
-rw-r--r--thirdparty/freetype/src/psaux/pshints.c1939
-rw-r--r--thirdparty/freetype/src/psaux/pshints.h288
-rw-r--r--thirdparty/freetype/src/psaux/psintrp.c3040
-rw-r--r--thirdparty/freetype/src/psaux/psintrp.h83
-rw-r--r--thirdparty/freetype/src/psaux/psobjs.c753
-rw-r--r--thirdparty/freetype/src/psaux/psobjs.h103
-rw-r--r--thirdparty/freetype/src/psaux/psread.c112
-rw-r--r--thirdparty/freetype/src/psaux/psread.h68
-rw-r--r--thirdparty/freetype/src/psaux/psstack.c328
-rw-r--r--thirdparty/freetype/src/psaux/psstack.h121
-rw-r--r--thirdparty/freetype/src/psaux/pstypes.h78
-rw-r--r--thirdparty/freetype/src/psaux/rules.mk19
-rw-r--r--thirdparty/freetype/src/psaux/t1cmap.c2
-rw-r--r--thirdparty/freetype/src/psaux/t1cmap.h2
-rw-r--r--thirdparty/freetype/src/psaux/t1decode.c350
-rw-r--r--thirdparty/freetype/src/psaux/t1decode.h12
-rw-r--r--thirdparty/freetype/src/pshinter/module.mk2
-rw-r--r--thirdparty/freetype/src/pshinter/pshalgo.c4
-rw-r--r--thirdparty/freetype/src/pshinter/pshalgo.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshglob.c6
-rw-r--r--thirdparty/freetype/src/pshinter/pshglob.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshinter.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshmod.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshmod.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshnterr.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshpic.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshpic.h2
-rw-r--r--thirdparty/freetype/src/pshinter/pshrec.c2
-rw-r--r--thirdparty/freetype/src/pshinter/pshrec.h2
-rw-r--r--thirdparty/freetype/src/pshinter/rules.mk2
-rw-r--r--thirdparty/freetype/src/psnames/module.mk2
-rw-r--r--thirdparty/freetype/src/psnames/psmodule.c2
-rw-r--r--thirdparty/freetype/src/psnames/psmodule.h2
-rw-r--r--thirdparty/freetype/src/psnames/psnamerr.h2
-rw-r--r--thirdparty/freetype/src/psnames/psnames.c2
-rw-r--r--thirdparty/freetype/src/psnames/pspic.c2
-rw-r--r--thirdparty/freetype/src/psnames/pspic.h2
-rw-r--r--thirdparty/freetype/src/psnames/pstables.h2
-rw-r--r--thirdparty/freetype/src/psnames/rules.mk2
-rw-r--r--thirdparty/freetype/src/raster/ftmisc.h2
-rw-r--r--thirdparty/freetype/src/raster/ftraster.c2
-rw-r--r--thirdparty/freetype/src/raster/ftraster.h2
-rw-r--r--thirdparty/freetype/src/raster/ftrend1.c111
-rw-r--r--thirdparty/freetype/src/raster/ftrend1.h2
-rw-r--r--thirdparty/freetype/src/raster/module.mk2
-rw-r--r--thirdparty/freetype/src/raster/raster.c2
-rw-r--r--thirdparty/freetype/src/raster/rasterrs.h2
-rw-r--r--thirdparty/freetype/src/raster/rastpic.c2
-rw-r--r--thirdparty/freetype/src/raster/rastpic.h2
-rw-r--r--thirdparty/freetype/src/raster/rules.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/module.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/pngshim.c61
-rw-r--r--thirdparty/freetype/src/sfnt/pngshim.h2
-rw-r--r--thirdparty/freetype/src/sfnt/rules.mk2
-rw-r--r--thirdparty/freetype/src/sfnt/sfdriver.c9
-rw-r--r--thirdparty/freetype/src/sfnt/sfdriver.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sferrors.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sfnt.c2
-rw-r--r--thirdparty/freetype/src/sfnt/sfntpic.c2
-rw-r--r--thirdparty/freetype/src/sfnt/sfntpic.h2
-rw-r--r--thirdparty/freetype/src/sfnt/sfobjs.c19
-rw-r--r--thirdparty/freetype/src/sfnt/sfobjs.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttbdf.c2
-rw-r--r--thirdparty/freetype/src/sfnt/ttbdf.h6
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmap.c47
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmap.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttcmapc.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttkern.c2
-rw-r--r--thirdparty/freetype/src/sfnt/ttkern.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttload.c4
-rw-r--r--thirdparty/freetype/src/sfnt/ttload.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttmtx.c2
-rw-r--r--thirdparty/freetype/src/sfnt/ttmtx.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttpost.c6
-rw-r--r--thirdparty/freetype/src/sfnt/ttpost.h2
-rw-r--r--thirdparty/freetype/src/sfnt/ttsbit.c9
-rw-r--r--thirdparty/freetype/src/sfnt/ttsbit.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftgrays.c85
-rw-r--r--thirdparty/freetype/src/smooth/ftgrays.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftsmerrs.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftsmooth.c287
-rw-r--r--thirdparty/freetype/src/smooth/ftsmooth.h2
-rw-r--r--thirdparty/freetype/src/smooth/ftspic.c2
-rw-r--r--thirdparty/freetype/src/smooth/ftspic.h2
-rw-r--r--thirdparty/freetype/src/smooth/module.mk2
-rw-r--r--thirdparty/freetype/src/smooth/rules.mk2
-rw-r--r--thirdparty/freetype/src/smooth/smooth.c2
-rw-r--r--thirdparty/freetype/src/truetype/module.mk2
-rw-r--r--thirdparty/freetype/src/truetype/rules.mk2
-rw-r--r--thirdparty/freetype/src/truetype/truetype.c2
-rw-r--r--thirdparty/freetype/src/truetype/ttdriver.c13
-rw-r--r--thirdparty/freetype/src/truetype/ttdriver.h2
-rw-r--r--thirdparty/freetype/src/truetype/tterrors.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttgload.c139
-rw-r--r--thirdparty/freetype/src/truetype/ttgload.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttgxvar.c646
-rw-r--r--thirdparty/freetype/src/truetype/ttgxvar.h10
-rw-r--r--thirdparty/freetype/src/truetype/ttinterp.c115
-rw-r--r--thirdparty/freetype/src/truetype/ttinterp.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttobjs.c101
-rw-r--r--thirdparty/freetype/src/truetype/ttobjs.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttpic.c2
-rw-r--r--thirdparty/freetype/src/truetype/ttpic.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttpload.c2
-rw-r--r--thirdparty/freetype/src/truetype/ttpload.h2
-rw-r--r--thirdparty/freetype/src/truetype/ttsubpix.c28
-rw-r--r--thirdparty/freetype/src/truetype/ttsubpix.h2
-rw-r--r--thirdparty/freetype/src/type1/module.mk2
-rw-r--r--thirdparty/freetype/src/type1/rules.mk2
-rw-r--r--thirdparty/freetype/src/type1/t1afm.c2
-rw-r--r--thirdparty/freetype/src/type1/t1afm.h2
-rw-r--r--thirdparty/freetype/src/type1/t1driver.c21
-rw-r--r--thirdparty/freetype/src/type1/t1driver.h2
-rw-r--r--thirdparty/freetype/src/type1/t1errors.h2
-rw-r--r--thirdparty/freetype/src/type1/t1gload.c118
-rw-r--r--thirdparty/freetype/src/type1/t1gload.h2
-rw-r--r--thirdparty/freetype/src/type1/t1load.c113
-rw-r--r--thirdparty/freetype/src/type1/t1load.h6
-rw-r--r--thirdparty/freetype/src/type1/t1objs.c42
-rw-r--r--thirdparty/freetype/src/type1/t1objs.h8
-rw-r--r--thirdparty/freetype/src/type1/t1parse.c2
-rw-r--r--thirdparty/freetype/src/type1/t1parse.h2
-rw-r--r--thirdparty/freetype/src/type1/t1tokens.h2
-rw-r--r--thirdparty/freetype/src/type1/type1.c2
-rw-r--r--thirdparty/freetype/src/type42/module.mk2
-rw-r--r--thirdparty/freetype/src/type42/rules.mk2
-rw-r--r--thirdparty/freetype/src/type42/t42drivr.c2
-rw-r--r--thirdparty/freetype/src/type42/t42drivr.h2
-rw-r--r--thirdparty/freetype/src/type42/t42error.h2
-rw-r--r--thirdparty/freetype/src/type42/t42objs.c2
-rw-r--r--thirdparty/freetype/src/type42/t42objs.h2
-rw-r--r--thirdparty/freetype/src/type42/t42parse.c2
-rw-r--r--thirdparty/freetype/src/type42/t42parse.h2
-rw-r--r--thirdparty/freetype/src/type42/t42types.h2
-rw-r--r--thirdparty/freetype/src/type42/type42.c2
-rw-r--r--thirdparty/freetype/src/winfonts/fnterrs.h2
-rw-r--r--thirdparty/freetype/src/winfonts/module.mk2
-rw-r--r--thirdparty/freetype/src/winfonts/rules.mk2
-rw-r--r--thirdparty/freetype/src/winfonts/winfnt.c2
-rw-r--r--thirdparty/freetype/src/winfonts/winfnt.h2
-rw-r--r--thirdparty/glad/KHR/khrplatform.h16
-rw-r--r--thirdparty/glad/glad.c27
-rw-r--r--thirdparty/glad/glad/glad.h4
851 files changed, 43715 insertions, 10534 deletions
diff --git a/.gitignore b/.gitignore
index f8296ef51e..35fadafbda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -288,6 +288,7 @@ logo.h
TAGS
!TAGS/
tags
+*.tags
!tags/
gtags.files
GTAGS
diff --git a/.travis.yml b/.travis.yml
index 57580c1c41..cb0b33679c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,6 +40,9 @@ matrix:
os: osx
osx_image: xcode9.3
compiler: clang
+ - env: GODOT_TARGET=server TOOLS=no CACHE_NAME=${GODOT_TARGET}-clang"
+ os: linux
+ compiler: clang
addons:
apt:
diff --git a/AUTHORS.md b/AUTHORS.md
index a5ef24e825..67563298f2 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -97,6 +97,7 @@ name is available.
Ramesh Ravone (RameshRavone)
Ray Koopa (RayKoopa)
Rémi Verschelde (akien-mga)
+ Roberto F. Arroyo (robfram)
Ruslan Mustakov (endragor)
Saniko (sanikoyes)
SaracenOne
@@ -108,6 +109,7 @@ name is available.
Wilhem Barbier (nounoursheureux)
Will Nations (willnationsdev)
Wilson E. Alvarez (Rubonnek)
+ Xavier Cho (mysticfall)
Yuri Roubinski (Chaosus)
Zher Huei Lee (leezh)
ZuBsPaCe
@@ -117,7 +119,6 @@ name is available.
m4nu3lf
marynate
mrezai
- robfram
romulox-x
rraallvv
sersoong
diff --git a/DONORS.md b/DONORS.md
index 1a129e36d7..c0ab24390a 100644
--- a/DONORS.md
+++ b/DONORS.md
@@ -27,7 +27,7 @@ generous deed immortalized in the next stable release of Godot Engine.
Christian Uldall Pedersen
Christopher Igoe
Christoph Woinke
- codetrotter
+ Claudiu Dumitru
E Hewert
Hein-Pieter van Braam
Igors Vaitkus
@@ -61,10 +61,10 @@ generous deed immortalized in the next stable release of Godot Engine.
Allen Schade
Andreas Schüle
Austen McRae
- Benjamin Botwin
Bernhard Liebl
Catalin Moldovan
DeepSquid
+ Duane Johnson
Florian Breisch
Gary Oberbrunner
Johannes Wuensch
@@ -72,13 +72,13 @@ generous deed immortalized in the next stable release of Godot Engine.
Joshua Lesperance
Libre-Dépanne
Matthew Bennett
+ Paul LaMotte
Ranoller
- Rob Messick
Svenne Krap
Timothy Hagberg
BanjoNode2D
- Brandon
+ Beliar
Chris Serino
Conrad Curry
Craig Smith
@@ -87,18 +87,17 @@ generous deed immortalized in the next stable release of Godot Engine.
Dexter Miguel
Garrett Dockins
Guilherme Felipe de C. G. da Silva
- Harman Bains
John
Justo Delgado Baudí
- Karsten Bock
Laurence Bannister
Rami
Robert Willes
Robin Arys
- Rufus Sasparilla
+ Rufus Xavier Sarsaparilla
ScottMakesGames
Testus Maximus
Thomas Bjarnelöf
+ William Connell
Wojciech Chojnacki
Xavier Tan
Zaq Poi
@@ -107,15 +106,19 @@ generous deed immortalized in the next stable release of Godot Engine.
Alexey Dyadchenko
Amanda Haldy
Chris Brown
+ Chris Petrich
Chris Wilson
Cody Parker
D
Daniel Eliasinski
+ E.G.
Eric Monson
flesk
François Cantin
G Barnes
GGGames.org
+ Giovanni Solimeno
+ Hasen Judy
Heath Hayes
Jeppe Zapp
Jeremi Biernacki
@@ -126,18 +129,18 @@ generous deed immortalized in the next stable release of Godot Engine.
Justin Arnold
Leandro Voltolino
Lisandro Lorea
- Marco Andrew Cafolla
Markus Wiesner
Marvin
+ Mohammad Taleb
Nick Nikitin
Pablo Cholaky
Patrick Schnorbus
Pete Goodwin
Phyronnaz
+ SeokHui Lee
Simon De Greve
Sofox
Ted
- Travis Womack
Trent McPheron
Vladimir
@@ -149,8 +152,7 @@ generous deed immortalized in the next stable release of Godot Engine.
Alder Stefano
Alessandro Senese
Ãlvaro Domínguez López
- Andrea Badii
- Andrew Thomas
+ Anders Jensen-Urstad
Anthony Bongiovanni
Arda Erol
Arthur S. Muszynski
@@ -161,22 +163,24 @@ generous deed immortalized in the next stable release of Godot Engine.
Benjamin Beshara
Ben Vercammen
Blair Allen
- Bryanna M
+ Brandon
Bryan Stevenson
Carwyn Edwards
Casey Foote
Chris Chapin
Christian Baune
Christian Winter
+ Christopher Schmitt
Collin Shooltz
Daniel Egger
Daniel Kaplan
- Daniel Langegger
+ DanielMaximiano
Daniel Mircea
David
David Cravens
David May
Dominik Wetzel
+ Edward Herbert
Eric Martini
Fabian Becker
fengjiongmax
@@ -193,11 +197,13 @@ generous deed immortalized in the next stable release of Godot Engine.
Hunter Jones
ialex32x
Ivan Vodopiviz
+ Jahn Johansen
Jaime Ruiz-Borau Vizárraga
Jed
Jeff Hungerford
Joel Fivat
Johan Lindberg
+ Jonas Rudlang
Jonas Yamazaki
Jonathan Martin
Jonathan Nieto
@@ -212,6 +218,7 @@ generous deed immortalized in the next stable release of Godot Engine.
Kevin Boyer
Kevin Kamper Meejach Petersen
Klavdij Voncina
+ Krzysztof Jankowski
Lars pfeffer
Linus Lind Lundgren
Macil
@@ -231,12 +238,15 @@ generous deed immortalized in the next stable release of Godot Engine.
Moritz Laass
nee
Neil Blakey-Milner
+ Nick Pavlica
Niclas Eriksen
- Nik Lee
+ Nicolás Montaña
+ Nicolas SAN AGUSTIN
Niko Leopold
nivardus
Noi Sek
Oleg Tyshchenko
+ Oleksandr Yemets
Pablo Seibelt
Pan Ip
Pat LaBine
@@ -252,6 +262,7 @@ generous deed immortalized in the next stable release of Godot Engine.
Roger Smith
Roman Tinkov
Ryan Whited
+ Samuel El-Borai
Sasori Olkof
Scott D. Yelich
Sootstone
@@ -260,11 +271,12 @@ generous deed immortalized in the next stable release of Godot Engine.
Thomas Bell
Thomas Herzog & Xananax
Thomas Kurz
+ Tomasz Wacławek
Tom Larrow
Tyler Stafos
UltyX
+ Victor
Victor Gonzalez Fernandez
- Victor Holt
Viktor Ferenczi
werner mendizabal
Wout Standaert
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index a51f2397c6..3270b33f1c 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -336,6 +336,14 @@ void _OS::set_borderless_window(bool p_borderless) {
OS::get_singleton()->set_borderless_window(p_borderless);
}
+bool _OS::get_window_per_pixel_transparency_enabled() const {
+ return OS::get_singleton()->get_window_per_pixel_transparency_enabled();
+}
+
+void _OS::set_window_per_pixel_transparency_enabled(bool p_enabled) {
+ OS::get_singleton()->set_window_per_pixel_transparency_enabled(p_enabled);
+}
+
bool _OS::get_borderless_window() const {
return OS::get_singleton()->get_borderless_window();
}
@@ -1068,6 +1076,9 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window);
ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window);
+ ClassDB::bind_method(D_METHOD("get_window_per_pixel_transparency_enabled"), &_OS::get_window_per_pixel_transparency_enabled);
+ ClassDB::bind_method(D_METHOD("set_window_per_pixel_transparency_enabled", "enabled"), &_OS::set_window_per_pixel_transparency_enabled);
+
ClassDB::bind_method(D_METHOD("set_ime_position", "position"), &_OS::set_ime_position);
ClassDB::bind_method(D_METHOD("set_screen_orientation", "orientation"), &_OS::set_screen_orientation);
@@ -1185,6 +1196,7 @@ void _OS::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "screen_orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor"), "set_screen_orientation", "get_screen_orientation");
ADD_GROUP("Window", "window_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_borderless"), "set_borderless_window", "get_borderless_window");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_per_pixel_transparency_enabled"), "set_window_per_pixel_transparency_enabled", "get_window_per_pixel_transparency_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_fullscreen"), "set_window_fullscreen", "is_window_fullscreen");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_maximized"), "set_window_maximized", "is_window_maximized");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "window_minimized"), "set_window_minimized", "is_window_minimized");
@@ -1281,6 +1293,16 @@ Variant _Geometry::segment_intersects_segment_2d(const Vector2 &p_from_a, const
};
};
+Variant _Geometry::line_intersects_line_2d(const Vector2 &p_from_a, const Vector2 &p_dir_a, const Vector2 &p_from_b, const Vector2 &p_dir_b) {
+
+ Vector2 result;
+ if (Geometry::line_intersects_line_2d(p_from_a, p_dir_a, p_from_b, p_dir_b, result)) {
+ return result;
+ } else {
+ return Variant();
+ }
+}
+
PoolVector<Vector2> _Geometry::get_closest_points_between_segments_2d(const Vector2 &p1, const Vector2 &q1, const Vector2 &p2, const Vector2 &q2) {
Vector2 r1, r2;
@@ -1436,6 +1458,7 @@ void _Geometry::_bind_methods() {
ClassDB::bind_method(D_METHOD("build_capsule_planes", "radius", "height", "sides", "lats", "axis"), &_Geometry::build_capsule_planes, DEFVAL(Vector3::AXIS_Z));
ClassDB::bind_method(D_METHOD("segment_intersects_circle", "segment_from", "segment_to", "circle_position", "circle_radius"), &_Geometry::segment_intersects_circle);
ClassDB::bind_method(D_METHOD("segment_intersects_segment_2d", "from_a", "to_a", "from_b", "to_b"), &_Geometry::segment_intersects_segment_2d);
+ ClassDB::bind_method(D_METHOD("line_intersects_line_2d", "from_a", "dir_a", "from_b", "dir_b"), &_Geometry::line_intersects_line_2d);
ClassDB::bind_method(D_METHOD("get_closest_points_between_segments_2d", "p1", "q1", "p2", "q2"), &_Geometry::get_closest_points_between_segments_2d);
ClassDB::bind_method(D_METHOD("get_closest_points_between_segments", "p1", "p2", "q1", "q2"), &_Geometry::get_closest_points_between_segments);
@@ -2641,6 +2664,14 @@ int _Engine::get_iterations_per_second() const {
return Engine::get_singleton()->get_iterations_per_second();
}
+void _Engine::set_physics_jitter_fix(float p_threshold) {
+ Engine::get_singleton()->set_physics_jitter_fix(p_threshold);
+}
+
+float _Engine::get_physics_jitter_fix() const {
+ return Engine::get_singleton()->get_physics_jitter_fix();
+}
+
void _Engine::set_target_fps(int p_fps) {
Engine::get_singleton()->set_target_fps(p_fps);
}
@@ -2707,6 +2738,8 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_iterations_per_second", "iterations_per_second"), &_Engine::set_iterations_per_second);
ClassDB::bind_method(D_METHOD("get_iterations_per_second"), &_Engine::get_iterations_per_second);
+ ClassDB::bind_method(D_METHOD("set_physics_jitter_fix", "physics_jitter_fix"), &_Engine::set_physics_jitter_fix);
+ ClassDB::bind_method(D_METHOD("get_physics_jitter_fix"), &_Engine::get_physics_jitter_fix);
ClassDB::bind_method(D_METHOD("set_target_fps", "target_fps"), &_Engine::set_target_fps);
ClassDB::bind_method(D_METHOD("get_target_fps"), &_Engine::get_target_fps);
@@ -2732,6 +2765,7 @@ void _Engine::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "iterations_per_second"), "set_iterations_per_second", "get_iterations_per_second");
ADD_PROPERTY(PropertyInfo(Variant::INT, "target_fps"), "set_target_fps", "get_target_fps");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "time_scale"), "set_time_scale", "get_time_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "physics_jitter_fix"), "set_physics_jitter_fix", "get_physics_jitter_fix");
}
_Engine *_Engine::singleton = NULL;
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 1790c68757..a363f5970f 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -180,6 +180,9 @@ public:
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window() const;
+ virtual bool get_window_per_pixel_transparency_enabled() const;
+ virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
+
virtual void set_ime_position(const Point2 &p_pos);
Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
@@ -358,6 +361,7 @@ public:
PoolVector<Plane> build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis = Vector3::AXIS_Z);
PoolVector<Plane> build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis = Vector3::AXIS_Z);
Variant segment_intersects_segment_2d(const Vector2 &p_from_a, const Vector2 &p_to_a, const Vector2 &p_from_b, const Vector2 &p_to_b);
+ Variant line_intersects_line_2d(const Vector2 &p_from_a, const Vector2 &p_dir_a, const Vector2 &p_from_b, const Vector2 &p_dir_b);
PoolVector<Vector2> get_closest_points_between_segments_2d(const Vector2 &p1, const Vector2 &q1, const Vector2 &p2, const Vector2 &q2);
PoolVector<Vector3> get_closest_points_between_segments(const Vector3 &p1, const Vector3 &p2, const Vector3 &q1, const Vector3 &q2);
Vector2 get_closest_point_to_segment_2d(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b);
@@ -669,6 +673,9 @@ public:
void set_iterations_per_second(int p_ips);
int get_iterations_per_second() const;
+ void set_physics_jitter_fix(float p_threshold);
+ float get_physics_jitter_fix() const;
+
void set_target_fps(int p_fps);
int get_target_fps() const;
diff --git a/core/class_db.cpp b/core/class_db.cpp
index 08c1ade679..59b100e282 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -357,7 +357,7 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
ClassInfo *t = classes.getptr(E->get());
ERR_FAIL_COND_V(!t, 0);
- if (t->api != p_api)
+ if (t->api != p_api || !t->exposed)
continue;
hash = hash_djb2_one_64(t->name.hash(), hash);
hash = hash_djb2_one_64(t->inherits.hash(), hash);
diff --git a/core/engine.cpp b/core/engine.cpp
index af9052110f..b2c34a853c 100644
--- a/core/engine.cpp
+++ b/core/engine.cpp
@@ -42,6 +42,16 @@ int Engine::get_iterations_per_second() const {
return ips;
}
+void Engine::set_physics_jitter_fix(float p_threshold) {
+ if (p_threshold < 0)
+ p_threshold = 0;
+ physics_jitter_fix = p_threshold;
+}
+
+float Engine::get_physics_jitter_fix() const {
+ return physics_jitter_fix;
+}
+
void Engine::set_target_fps(int p_fps) {
_target_fps = p_fps > 0 ? p_fps : 0;
}
@@ -137,6 +147,7 @@ Engine::Engine() {
singleton = this;
frames_drawn = 0;
ips = 60;
+ physics_jitter_fix = 0.5;
_frame_delay = 0;
_fps = 1;
_target_fps = 0;
diff --git a/core/engine.h b/core/engine.h
index 54b30ab81f..665992699a 100644
--- a/core/engine.h
+++ b/core/engine.h
@@ -57,6 +57,7 @@ private:
float _frame_step;
int ips;
+ float physics_jitter_fix;
float _fps;
int _target_fps;
float _time_scale;
@@ -79,6 +80,9 @@ public:
virtual void set_iterations_per_second(int p_ips);
virtual int get_iterations_per_second() const;
+ void set_physics_jitter_fix(float p_threshold);
+ float get_physics_jitter_fix() const;
+
virtual void set_target_fps(int p_fps);
virtual float get_target_fps() const;
diff --git a/core/image.cpp b/core/image.cpp
index 58f49d69e6..51fbe75dec 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -1161,6 +1161,9 @@ PoolVector<uint8_t> Image::get_data() const {
void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format) {
+ ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH);
+ ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT);
+
int mm = 0;
int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0);
data.resize(size);
@@ -1625,6 +1628,12 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
ERR_FAIL_COND(format != p_src->format);
Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+
+ if (p_dest.x < 0)
+ clipped_src_rect.position.x = ABS(p_dest.x);
+ if (p_dest.y < 0)
+ clipped_src_rect.position.y = ABS(p_dest.y);
+
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
@@ -1673,6 +1682,12 @@ void Image::blit_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, co
ERR_FAIL_COND(format != p_src->format);
Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+
+ if (p_dest.x < 0)
+ clipped_src_rect.position.x = ABS(p_dest.x);
+ if (p_dest.y < 0)
+ clipped_src_rect.position.y = ABS(p_dest.y);
+
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
@@ -1724,6 +1739,12 @@ void Image::blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const P
ERR_FAIL_COND(format != p_src->format);
Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+
+ if (p_dest.x < 0)
+ clipped_src_rect.position.x = ABS(p_dest.x);
+ if (p_dest.y < 0)
+ clipped_src_rect.position.y = ABS(p_dest.y);
+
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
@@ -1772,6 +1793,12 @@ void Image::blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, c
ERR_FAIL_COND(format != p_src->format);
Rect2i clipped_src_rect = Rect2i(0, 0, p_src->width, p_src->height).clip(p_src_rect);
+
+ if (p_dest.x < 0)
+ clipped_src_rect.position.x = ABS(p_dest.x);
+ if (p_dest.y < 0)
+ clipped_src_rect.position.y = ABS(p_dest.y);
+
if (clipped_src_rect.size.x <= 0 || clipped_src_rect.size.y <= 0)
return;
@@ -1907,6 +1934,10 @@ void Image::unlock() {
write_lock = PoolVector<uint8_t>::Write();
}
+Color Image::get_pixelv(const Point2 &p_src) const {
+ return get_pixel(p_src.x, p_src.y);
+}
+
Color Image::get_pixel(int p_x, int p_y) const {
uint8_t *ptr = write_lock.ptr();
@@ -2053,6 +2084,10 @@ Color Image::get_pixel(int p_x, int p_y) const {
return Color();
}
+void Image::set_pixelv(const Point2 &p_dst, const Color &p_color) {
+ return set_pixel(p_dst.x, p_dst.y, p_color);
+}
+
void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
uint8_t *ptr = write_lock.ptr();
@@ -2284,8 +2319,10 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("lock"), &Image::lock);
ClassDB::bind_method(D_METHOD("unlock"), &Image::unlock);
- ClassDB::bind_method(D_METHOD("set_pixel", "x", "y", "color"), &Image::set_pixel);
+ ClassDB::bind_method(D_METHOD("get_pixelv", "src"), &Image::get_pixelv);
ClassDB::bind_method(D_METHOD("get_pixel", "x", "y"), &Image::get_pixel);
+ ClassDB::bind_method(D_METHOD("set_pixelv", "dst", "color"), &Image::set_pixelv);
+ ClassDB::bind_method(D_METHOD("set_pixel", "x", "y", "color"), &Image::set_pixel);
ClassDB::bind_method(D_METHOD("load_png_from_buffer", "buffer"), &Image::load_png_from_buffer);
ClassDB::bind_method(D_METHOD("load_jpg_from_buffer", "buffer"), &Image::load_jpg_from_buffer);
diff --git a/core/image.h b/core/image.h
index 3c43e49950..80a0c339dd 100644
--- a/core/image.h
+++ b/core/image.h
@@ -321,7 +321,9 @@ public:
DetectChannels get_detected_channels();
+ Color get_pixelv(const Point2 &p_src) const;
Color get_pixel(int p_x, int p_y) const;
+ void set_pixelv(const Point2 &p_dest, const Color &p_color);
void set_pixel(int p_x, int p_y, const Color &p_color);
void copy_internals_from(const Ref<Image> &p_image) {
diff --git a/core/input_map.cpp b/core/input_map.cpp
index 67c0e4eb04..d33f40cbcf 100644
--- a/core/input_map.cpp
+++ b/core/input_map.cpp
@@ -48,6 +48,7 @@ void InputMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("action_add_event", "action", "event"), &InputMap::action_add_event);
ClassDB::bind_method(D_METHOD("action_has_event", "action", "event"), &InputMap::action_has_event);
ClassDB::bind_method(D_METHOD("action_erase_event", "action", "event"), &InputMap::action_erase_event);
+ ClassDB::bind_method(D_METHOD("action_erase_events", "action"), &InputMap::action_erase_events);
ClassDB::bind_method(D_METHOD("get_action_list", "action"), &InputMap::_get_action_list);
ClassDB::bind_method(D_METHOD("event_is_action", "event", "action"), &InputMap::event_is_action);
ClassDB::bind_method(D_METHOD("load_from_globals"), &InputMap::load_from_globals);
@@ -155,6 +156,13 @@ void InputMap::action_erase_event(const StringName &p_action, const Ref<InputEve
input_map[p_action].inputs.erase(E);
}
+void InputMap::action_erase_events(const StringName &p_action) {
+
+ ERR_FAIL_COND(!input_map.has(p_action));
+
+ input_map[p_action].inputs.clear();
+}
+
Array InputMap::_get_action_list(const StringName &p_action) {
Array ret;
diff --git a/core/input_map.h b/core/input_map.h
index f497a2b86e..bdec75c65b 100644
--- a/core/input_map.h
+++ b/core/input_map.h
@@ -75,6 +75,7 @@ public:
void action_add_event(const StringName &p_action, const Ref<InputEvent> &p_event);
bool action_has_event(const StringName &p_action, const Ref<InputEvent> &p_event);
void action_erase_event(const StringName &p_action, const Ref<InputEvent> &p_event);
+ void action_erase_events(const StringName &p_action);
const List<Ref<InputEvent> > *get_action_list(const StringName &p_action);
bool event_is_action(const Ref<InputEvent> &p_event, const StringName &p_action) const;
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 2ebe8d6df7..0a3a6c1ba1 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -1211,7 +1211,9 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
r_len += len;
if (buf)
buf += len;
- encode_variant(d[E->get()], buf, len, p_object_as_id);
+ Variant *v = d.getptr(E->get());
+ ERR_FAIL_COND_V(!v, ERR_BUG);
+ encode_variant(*v, buf, len, p_object_as_id);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index cbe7f87d92..456d29520f 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -47,11 +47,11 @@ void MultiplayerAPI::set_root_node(Node *p_node) {
void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_peer) {
if (network_peer.is_valid()) {
- network_peer->disconnect("peer_connected", this, "add_peer");
- network_peer->disconnect("peer_disconnected", this, "del_peer");
- network_peer->disconnect("connection_succeeded", this, "connected_to_server");
- network_peer->disconnect("connection_failed", this, "connection_failed");
- network_peer->disconnect("server_disconnected", this, "server_disconnected");
+ network_peer->disconnect("peer_connected", this, "_add_peer");
+ network_peer->disconnect("peer_disconnected", this, "_del_peer");
+ network_peer->disconnect("connection_succeeded", this, "_connected_to_server");
+ network_peer->disconnect("connection_failed", this, "_connection_failed");
+ network_peer->disconnect("server_disconnected", this, "_server_disconnected");
clear();
}
@@ -61,11 +61,11 @@ void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_pee
ERR_FAIL_COND(p_peer.is_valid() && p_peer->get_connection_status() == NetworkedMultiplayerPeer::CONNECTION_DISCONNECTED);
if (network_peer.is_valid()) {
- network_peer->connect("peer_connected", this, "add_peer");
- network_peer->connect("peer_disconnected", this, "del_peer");
- network_peer->connect("connection_succeeded", this, "connected_to_server");
- network_peer->connect("connection_failed", this, "connection_failed");
- network_peer->connect("server_disconnected", this, "server_disconnected");
+ network_peer->connect("peer_connected", this, "_add_peer");
+ network_peer->connect("peer_disconnected", this, "_del_peer");
+ network_peer->connect("connection_succeeded", this, "_connected_to_server");
+ network_peer->connect("connection_failed", this, "_connection_failed");
+ network_peer->connect("server_disconnected", this, "_server_disconnected");
}
}
@@ -76,7 +76,7 @@ Ref<NetworkedMultiplayerPeer> MultiplayerAPI::get_network_peer() const {
void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_packet_len) {
ERR_FAIL_COND(root_node == NULL);
- ERR_FAIL_COND(p_packet_len < 5);
+ ERR_FAIL_COND(p_packet_len < 1);
uint8_t packet_type = p_packet[0];
@@ -123,6 +123,11 @@ void MultiplayerAPI::_process_packet(int p_from, const uint8_t *p_packet, int p_
}
} break;
+
+ case NETWORK_COMMAND_RAW: {
+
+ _process_raw(p_from, p_packet, p_packet_len);
+ } break;
}
}
@@ -259,6 +264,8 @@ void MultiplayerAPI::_process_simplify_path(int p_from, const uint8_t *p_packet,
void MultiplayerAPI::_process_confirm_path(int p_from, const uint8_t *p_packet, int p_packet_len) {
+ ERR_FAIL_COND(p_packet_len < 2);
+
String paths;
paths.parse_utf8((const char *)&p_packet[1], p_packet_len - 1);
@@ -458,29 +465,29 @@ void MultiplayerAPI::_send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p
}
}
-void MultiplayerAPI::add_peer(int p_id) {
+void MultiplayerAPI::_add_peer(int p_id) {
connected_peers.insert(p_id);
path_get_cache.insert(p_id, PathGetCache());
emit_signal("network_peer_connected", p_id);
}
-void MultiplayerAPI::del_peer(int p_id) {
+void MultiplayerAPI::_del_peer(int p_id) {
connected_peers.erase(p_id);
path_get_cache.erase(p_id); //I no longer need your cache, sorry
emit_signal("network_peer_disconnected", p_id);
}
-void MultiplayerAPI::connected_to_server() {
+void MultiplayerAPI::_connected_to_server() {
emit_signal("connected_to_server");
}
-void MultiplayerAPI::connection_failed() {
+void MultiplayerAPI::_connection_failed() {
emit_signal("connection_failed");
}
-void MultiplayerAPI::server_disconnected() {
+void MultiplayerAPI::_server_disconnected() {
emit_signal("server_disconnected");
}
@@ -648,6 +655,34 @@ void MultiplayerAPI::rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const
_send_rpc(p_node, p_peer_id, p_unreliable, true, p_property, &vptr, 1);
}
+Error MultiplayerAPI::send_bytes(PoolVector<uint8_t> p_data, int p_to) {
+
+ ERR_FAIL_COND_V(p_data.size() < 1, ERR_INVALID_DATA);
+ ERR_FAIL_COND_V(!network_peer.is_valid(), ERR_UNCONFIGURED);
+ ERR_FAIL_COND_V(network_peer->get_connection_status() != NetworkedMultiplayerPeer::CONNECTION_CONNECTED, ERR_UNCONFIGURED);
+
+ MAKE_ROOM(p_data.size() + 1);
+ PoolVector<uint8_t>::Read r = p_data.read();
+ packet_cache[0] = NETWORK_COMMAND_RAW;
+ memcpy(&packet_cache[1], &r[0], p_data.size());
+ network_peer->set_target_peer(p_to);
+ return network_peer->put_packet(packet_cache.ptr(), p_data.size() + 1);
+}
+
+void MultiplayerAPI::_process_raw(int p_from, const uint8_t *p_packet, int p_packet_len) {
+
+ ERR_FAIL_COND(p_packet_len < 2);
+
+ PoolVector<uint8_t> out;
+ int len = p_packet_len - 1;
+ out.resize(len);
+ {
+ PoolVector<uint8_t>::Write w = out.write();
+ memcpy(&w[0], &p_packet[1], len);
+ }
+ emit_signal("network_peer_packet", p_from, out);
+}
+
int MultiplayerAPI::get_network_unique_id() const {
ERR_FAIL_COND_V(!network_peer.is_valid(), 0);
@@ -686,20 +721,21 @@ Vector<int> MultiplayerAPI::get_network_connected_peers() const {
void MultiplayerAPI::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_root_node", "node"), &MultiplayerAPI::set_root_node);
+ ClassDB::bind_method(D_METHOD("send_bytes", "bytes", "id"), &MultiplayerAPI::send_bytes, DEFVAL(NetworkedMultiplayerPeer::TARGET_PEER_BROADCAST));
ClassDB::bind_method(D_METHOD("has_network_peer"), &MultiplayerAPI::has_network_peer);
ClassDB::bind_method(D_METHOD("get_network_peer"), &MultiplayerAPI::get_network_peer);
ClassDB::bind_method(D_METHOD("get_network_unique_id"), &MultiplayerAPI::get_network_unique_id);
ClassDB::bind_method(D_METHOD("is_network_server"), &MultiplayerAPI::is_network_server);
ClassDB::bind_method(D_METHOD("get_rpc_sender_id"), &MultiplayerAPI::get_rpc_sender_id);
- ClassDB::bind_method(D_METHOD("add_peer", "id"), &MultiplayerAPI::add_peer);
- ClassDB::bind_method(D_METHOD("del_peer", "id"), &MultiplayerAPI::del_peer);
+ ClassDB::bind_method(D_METHOD("_add_peer", "id"), &MultiplayerAPI::_add_peer);
+ ClassDB::bind_method(D_METHOD("_del_peer", "id"), &MultiplayerAPI::_del_peer);
ClassDB::bind_method(D_METHOD("set_network_peer", "peer"), &MultiplayerAPI::set_network_peer);
ClassDB::bind_method(D_METHOD("poll"), &MultiplayerAPI::poll);
ClassDB::bind_method(D_METHOD("clear"), &MultiplayerAPI::clear);
- ClassDB::bind_method(D_METHOD("connected_to_server"), &MultiplayerAPI::connected_to_server);
- ClassDB::bind_method(D_METHOD("connection_failed"), &MultiplayerAPI::connection_failed);
- ClassDB::bind_method(D_METHOD("server_disconnected"), &MultiplayerAPI::server_disconnected);
+ ClassDB::bind_method(D_METHOD("_connected_to_server"), &MultiplayerAPI::_connected_to_server);
+ ClassDB::bind_method(D_METHOD("_connection_failed"), &MultiplayerAPI::_connection_failed);
+ ClassDB::bind_method(D_METHOD("_server_disconnected"), &MultiplayerAPI::_server_disconnected);
ClassDB::bind_method(D_METHOD("get_network_connected_peers"), &MultiplayerAPI::get_network_connected_peers);
ClassDB::bind_method(D_METHOD("set_refuse_new_network_connections", "refuse"), &MultiplayerAPI::set_refuse_new_network_connections);
ClassDB::bind_method(D_METHOD("is_refusing_new_network_connections"), &MultiplayerAPI::is_refusing_new_network_connections);
@@ -708,6 +744,7 @@ void MultiplayerAPI::_bind_methods() {
ADD_SIGNAL(MethodInfo("network_peer_connected", PropertyInfo(Variant::INT, "id")));
ADD_SIGNAL(MethodInfo("network_peer_disconnected", PropertyInfo(Variant::INT, "id")));
+ ADD_SIGNAL(MethodInfo("network_peer_packet", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::POOL_BYTE_ARRAY, "packet")));
ADD_SIGNAL(MethodInfo("connected_to_server"));
ADD_SIGNAL(MethodInfo("connection_failed"));
ADD_SIGNAL(MethodInfo("server_disconnected"));
diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h
index e7c6ffbea6..25f445004d 100644
--- a/core/io/multiplayer_api.h
+++ b/core/io/multiplayer_api.h
@@ -43,6 +43,7 @@ protected:
Node *_process_get_node(int p_from, const uint8_t *p_packet, int p_packet_len);
void _process_rpc(Node *p_node, const StringName &p_name, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset);
void _process_rset(Node *p_node, const StringName &p_name, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset);
+ void _process_raw(int p_from, const uint8_t *p_packet, int p_packet_len);
void _send_rpc(Node *p_from, int p_to, bool p_unreliable, bool p_set, const StringName &p_name, const Variant **p_arg, int p_argcount);
bool _send_confirm_path(NodePath p_path, PathSentCache *psc, int p_from);
@@ -53,6 +54,7 @@ public:
NETWORK_COMMAND_REMOTE_SET,
NETWORK_COMMAND_SIMPLIFY_PATH,
NETWORK_COMMAND_CONFIRM_PATH,
+ NETWORK_COMMAND_RAW,
};
void poll();
@@ -60,17 +62,18 @@ public:
void set_root_node(Node *p_node);
void set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_peer);
Ref<NetworkedMultiplayerPeer> get_network_peer() const;
+ Error send_bytes(PoolVector<uint8_t> p_data, int p_to = NetworkedMultiplayerPeer::TARGET_PEER_BROADCAST);
// Called by Node.rpc
void rpcp(Node *p_node, int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount);
// Called by Node.rset
void rsetp(Node *p_node, int p_peer_id, bool p_unreliable, const StringName &p_property, const Variant &p_value);
- void add_peer(int p_id);
- void del_peer(int p_id);
- void connected_to_server();
- void connection_failed();
- void server_disconnected();
+ void _add_peer(int p_id);
+ void _del_peer(int p_id);
+ void _connected_to_server();
+ void _connection_failed();
+ void _server_disconnected();
bool has_network_peer() const { return network_peer.is_valid(); }
Vector<int> get_network_connected_peers() const;
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp
index bd851ebb6d..b777a9f960 100644
--- a/core/io/packet_peer.cpp
+++ b/core/io/packet_peer.cpp
@@ -172,6 +172,7 @@ Error PacketPeerStream::_poll_buffer() const {
ERR_FAIL_COND_V(peer.is_null(), ERR_UNCONFIGURED);
int read = 0;
+ ERR_FAIL_COND_V(input_buffer.size() < ring_buffer.space_left(), ERR_UNAVAILABLE);
Error err = peer->get_partial_data(&input_buffer[0], ring_buffer.space_left(), read);
if (err)
return err;
@@ -223,6 +224,7 @@ Error PacketPeerStream::get_packet(const uint8_t **r_buffer, int &r_buffer_size)
uint32_t len = decode_uint32(lbuf);
ERR_FAIL_COND_V(remaining < (int)len, ERR_UNAVAILABLE);
+ ERR_FAIL_COND_V(input_buffer.size() < len, ERR_UNAVAILABLE);
ring_buffer.read(lbuf, 4); //get rid of first 4 bytes
ring_buffer.read(&input_buffer[0], len); // read packet
diff --git a/core/math/geometry.h b/core/math/geometry.h
index 73a53c53b6..be998aef0b 100644
--- a/core/math/geometry.h
+++ b/core/math/geometry.h
@@ -529,6 +529,21 @@ public:
return p_segment[0] + n * d; // inside
}
+ static bool line_intersects_line_2d(const Vector2 &p_from_a, const Vector2 &p_dir_a, const Vector2 &p_from_b, const Vector2 &p_dir_b, Vector2 &r_result) {
+
+ // see http://paulbourke.net/geometry/pointlineplane/
+
+ const real_t denom = p_dir_b.y * p_dir_a.x - p_dir_b.x * p_dir_a.y;
+ if (Math::abs(denom) < CMP_EPSILON) { // parallel?
+ return false;
+ }
+
+ const Vector2 v = p_from_a - p_from_b;
+ const real_t t = (p_dir_b.x * v.y - p_dir_b.y * v.x) / denom;
+ r_result = p_from_a + t * p_dir_a;
+ return true;
+ }
+
static bool segment_intersects_segment_2d(const Vector2 &p_from_a, const Vector2 &p_to_a, const Vector2 &p_from_b, const Vector2 &p_to_b, Vector2 *r_result) {
Vector2 B = p_to_a - p_from_a;
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp
index 3767d298a1..a053ffbd93 100644
--- a/core/math/math_2d.cpp
+++ b/core/math/math_2d.cpp
@@ -103,6 +103,16 @@ Vector2 Vector2::floor() const {
return Vector2(Math::floor(x), Math::floor(y));
}
+Vector2 Vector2::ceil() const {
+
+ return Vector2(Math::ceil(x), Math::ceil(y));
+}
+
+Vector2 Vector2::round() const {
+
+ return Vector2(Math::round(x), Math::round(y));
+}
+
Vector2 Vector2::rotated(real_t p_by) const {
Vector2 v;
diff --git a/core/math/math_2d.h b/core/math/math_2d.h
index e7188da85b..611d47e3ff 100644
--- a/core/math/math_2d.h
+++ b/core/math/math_2d.h
@@ -162,6 +162,8 @@ struct Vector2 {
}
Vector2 floor() const;
+ Vector2 ceil() const;
+ Vector2 round() const;
Vector2 snapped(const Vector2 &p_by) const;
real_t aspect() const { return width / height; }
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 10ec4f5641..3bbfd7627c 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -103,6 +103,7 @@ struct Vector3 {
_FORCE_INLINE_ Vector3 floor() const;
_FORCE_INLINE_ Vector3 sign() const;
_FORCE_INLINE_ Vector3 ceil() const;
+ _FORCE_INLINE_ Vector3 round() const;
_FORCE_INLINE_ real_t distance_to(const Vector3 &p_b) const;
_FORCE_INLINE_ real_t distance_squared_to(const Vector3 &p_b) const;
@@ -204,6 +205,11 @@ Vector3 Vector3::ceil() const {
return Vector3(Math::ceil(x), Math::ceil(y), Math::ceil(z));
}
+Vector3 Vector3::round() const {
+
+ return Vector3(Math::round(x), Math::round(y), Math::round(z));
+}
+
Vector3 Vector3::linear_interpolate(const Vector3 &p_b, real_t p_t) const {
return Vector3(
diff --git a/core/method_bind.h b/core/method_bind.h
index e02d64c935..41b500c401 100644
--- a/core/method_bind.h
+++ b/core/method_bind.h
@@ -128,10 +128,36 @@ struct VariantCaster<const T &> {
// Object enum casts must go here
VARIANT_ENUM_CAST(Object::ConnectFlags);
+template <typename T>
+struct VariantObjectClassChecker {
+ static _FORCE_INLINE_ bool check(const Variant &p_variant) {
+ return true;
+ }
+};
+
+template <>
+struct VariantObjectClassChecker<Node *> {
+ static _FORCE_INLINE_ bool check(const Variant &p_variant) {
+ Object *obj = p_variant;
+ Node *node = p_variant;
+ return node || !obj;
+ }
+};
+
+template <>
+struct VariantObjectClassChecker<Control *> {
+ static _FORCE_INLINE_ bool check(const Variant &p_variant) {
+ Object *obj = p_variant;
+ Control *control = p_variant;
+ return control || !obj;
+ }
+};
+
#define CHECK_ARG(m_arg) \
if ((m_arg - 1) < p_arg_count) { \
Variant::Type argtype = get_argument_type(m_arg - 1); \
- if (!Variant::can_convert_strict(p_args[m_arg - 1]->get_type(), argtype)) { \
+ if (!Variant::can_convert_strict(p_args[m_arg - 1]->get_type(), argtype) || \
+ !VariantObjectClassChecker<P##m_arg>::check(*p_args[m_arg - 1])) { \
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; \
r_error.argument = m_arg - 1; \
r_error.expected = argtype; \
diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h
index 280aea6a14..0b3b40f30c 100644
--- a/core/oa_hash_map.h
+++ b/core/oa_hash_map.h
@@ -36,176 +36,181 @@
#include "os/copymem.h"
#include "os/memory.h"
-// uncomment this to disable initial local storage.
-#define OA_HASH_MAP_INITIAL_LOCAL_STORAGE
-
/**
- * This class implements a hash map datastructure that uses open addressing with
- * local probing.
- *
- * It can give huge performance improvements over a chained HashMap because of
- * the increased data locality.
- *
- * Because of that locality property it's important to not use "large" value
- * types as the "TData" type. If TData values are too big it can cause more
- * cache misses then chaining. If larger values are needed then storing those
- * in a separate array and using pointers or indices to reference them is the
- * better solution.
- *
- * This hash map also implements real-time incremental rehashing.
+ * A HashMap implementation that uses open addressing with robinhood hashing.
+ * Robinhood hashing swaps out entries that have a smaller probing distance
+ * than the to-be-inserted entry, that evens out the average probing distance
+ * and enables faster lookups.
*
+ * The entries are stored inplace, so huge keys or values might fill cache lines
+ * a lot faster.
*/
-template <class TKey, class TData,
- uint16_t INITIAL_NUM_ELEMENTS = 64,
+template <class TKey, class TValue,
class Hasher = HashMapHasherDefault,
class Comparator = HashMapComparatorDefault<TKey> >
class OAHashMap {
private:
-#ifdef OA_HASH_MAP_INITIAL_LOCAL_STORAGE
- TData local_data[INITIAL_NUM_ELEMENTS];
- TKey local_keys[INITIAL_NUM_ELEMENTS];
- uint32_t local_hashes[INITIAL_NUM_ELEMENTS];
- uint8_t local_flags[INITIAL_NUM_ELEMENTS / 4 + (INITIAL_NUM_ELEMENTS % 4 != 0 ? 1 : 0)];
-#endif
+ TValue *values;
+ TKey *keys;
+ uint32_t *hashes;
- struct {
- TData *data;
- TKey *keys;
- uint32_t *hashes;
+ uint32_t capacity;
- // This is actually an array of bits, 4 bit pairs per octet.
- // | ba ba ba ba | ba ba ba ba | ....
- //
- // if a is set it means that there is an element present.
- // if b is set it means that an element was deleted. This is needed for
- // the local probing to work without relocating any succeeding and
- // colliding entries.
- uint8_t *flags;
+ uint32_t num_elements;
- uint32_t capacity;
- } table, old_table;
+ static const uint32_t EMPTY_HASH = 0;
+ static const uint32_t DELETED_HASH_BIT = 1 << 31;
- bool is_rehashing;
- uint32_t rehash_position;
- uint32_t rehash_amount;
+ _FORCE_INLINE_ uint32_t _hash(const TKey &p_key) {
+ uint32_t hash = Hasher::hash(p_key);
- uint32_t elements;
+ if (hash == EMPTY_HASH) {
+ hash = EMPTY_HASH + 1;
+ } else if (hash & DELETED_HASH_BIT) {
+ hash &= ~DELETED_HASH_BIT;
+ }
- /* Methods */
+ return hash;
+ }
- // returns true if the value already existed, false if it's a new entry
- bool _raw_set_with_hash(uint32_t p_hash, const TKey &p_key, const TData &p_data) {
- for (int i = 0; i < table.capacity; i++) {
+ _FORCE_INLINE_ uint32_t _get_probe_length(uint32_t p_pos, uint32_t p_hash) {
+ p_hash = p_hash & ~DELETED_HASH_BIT; // we don't care if it was deleted or not
- int pos = (p_hash + i) % table.capacity;
+ uint32_t original_pos = p_hash % capacity;
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
+ return p_pos - original_pos;
+ }
- bool is_filled_flag = table.flags[flags_pos] & (1 << (2 * flags_pos_offset));
- bool is_deleted_flag = table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1));
+ _FORCE_INLINE_ void _construct(uint32_t p_pos, uint32_t p_hash, const TKey &p_key, const TValue &p_value) {
+ memnew_placement(&keys[p_pos], TKey(p_key));
+ memnew_placement(&values[p_pos], TValue(p_value));
+ hashes[p_pos] = p_hash;
- if (is_filled_flag) {
- if (table.hashes[pos] == p_hash && Comparator::compare(table.keys[pos], p_key)) {
- table.data[pos] = p_data;
- return true;
- }
- continue;
+ num_elements++;
+ }
+
+ bool _lookup_pos(const TKey &p_key, uint32_t &r_pos) {
+ uint32_t hash = _hash(p_key);
+ uint32_t pos = hash % capacity;
+ uint32_t distance = 0;
+
+ while (42) {
+ if (hashes[pos] == EMPTY_HASH) {
+ return false;
}
- table.keys[pos] = p_key;
- table.data[pos] = p_data;
- table.hashes[pos] = p_hash;
+ if (distance > _get_probe_length(pos, hashes[pos])) {
+ return false;
+ }
- table.flags[flags_pos] |= (1 << (2 * flags_pos_offset));
- table.flags[flags_pos] &= ~(1 << (2 * flags_pos_offset + 1));
+ if (hashes[pos] == hash && Comparator::compare(keys[pos], p_key)) {
+ r_pos = pos;
+ return true;
+ }
- return false;
+ pos = (pos + 1) % capacity;
+ distance++;
}
- return false;
}
-public:
- _FORCE_INLINE_ uint32_t get_capacity() const { return table.capacity; }
- _FORCE_INLINE_ uint32_t get_num_elements() const { return elements; }
+ void _insert_with_hash(uint32_t p_hash, const TKey &p_key, const TValue &p_value) {
- void set(const TKey &p_key, const TData &p_data) {
+ uint32_t hash = p_hash;
+ uint32_t distance = 0;
+ uint32_t pos = hash % capacity;
- uint32_t hash = Hasher::hash(p_key);
+ TKey key = p_key;
+ TValue value = p_value;
- // We don't progress the rehashing if the table just got resized
- // to keep the cost of this function low.
- if (is_rehashing) {
+ while (42) {
+ if (hashes[pos] == EMPTY_HASH) {
+ _construct(pos, hash, p_key, p_value);
- // rehash progress
+ return;
+ }
- for (int i = 0; i <= rehash_amount && rehash_position < old_table.capacity; rehash_position++) {
+ // not an empty slot, let's check the probing length of the existing one
+ uint32_t existing_probe_len = _get_probe_length(pos, hashes[pos]);
+ if (existing_probe_len < distance) {
- int flags_pos = rehash_position / 4;
- int flags_pos_offset = rehash_position % 4;
+ if (hashes[pos] & DELETED_HASH_BIT) {
+ // we found a place where we can fit in!
+ _construct(pos, hash, p_key, p_value);
- bool is_filled_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
- bool is_deleted_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1))) > 0;
+ return;
+ }
- if (is_filled_flag) {
- _raw_set_with_hash(old_table.hashes[rehash_position], old_table.keys[rehash_position], old_table.data[rehash_position]);
+ SWAP(hash, hashes[pos]);
+ SWAP(key, keys[pos]);
+ SWAP(value, values[pos]);
+ distance = existing_probe_len;
+ }
- old_table.keys[rehash_position].~TKey();
- old_table.data[rehash_position].~TData();
+ pos = (pos + 1) % capacity;
+ distance++;
+ }
+ }
+ void _resize_and_rehash() {
- memnew_placement(&old_table.keys[rehash_position], TKey);
- memnew_placement(&old_table.data[rehash_position], TData);
+ TKey *old_keys = keys;
+ TValue *old_values = values;
+ uint32_t *old_hashes = hashes;
- old_table.flags[flags_pos] &= ~(1 << (2 * flags_pos_offset));
- old_table.flags[flags_pos] |= (1 << (2 * flags_pos_offset + 1));
- }
- }
+ uint32_t old_capacity = capacity;
- if (rehash_position >= old_table.capacity) {
+ capacity = old_capacity * 2;
+ num_elements = 0;
- // wohooo, we can get rid of the old table.
- is_rehashing = false;
+ keys = memnew_arr(TKey, capacity);
+ values = memnew_arr(TValue, capacity);
+ hashes = memnew_arr(uint32_t, capacity);
-#ifdef OA_HASH_MAP_INITIAL_LOCAL_STORAGE
- if (old_table.data == local_data) {
- // Everything is local, so no cleanup :P
- } else
-#endif
- {
- memdelete_arr(old_table.data);
- memdelete_arr(old_table.keys);
- memdelete_arr(old_table.hashes);
- memdelete_arr(old_table.flags);
- }
- }
+ for (int i = 0; i < capacity; i++) {
+ hashes[i] = 0;
}
- // Table is almost full, resize and start rehashing process.
- if (elements >= table.capacity * 0.7) {
+ for (uint32_t i = 0; i < old_capacity; i++) {
+ if (old_hashes[i] == EMPTY_HASH) {
+ continue;
+ }
+ if (old_hashes[i] & DELETED_HASH_BIT) {
+ continue;
+ }
- old_table.capacity = table.capacity;
- old_table.data = table.data;
- old_table.flags = table.flags;
- old_table.hashes = table.hashes;
- old_table.keys = table.keys;
+ _insert_with_hash(old_hashes[i], old_keys[i], old_values[i]);
+ }
- table.capacity = old_table.capacity * 2;
+ memdelete_arr(old_keys);
+ memdelete_arr(old_values);
+ memdelete_arr(old_hashes);
+ }
- table.data = memnew_arr(TData, table.capacity);
- table.flags = memnew_arr(uint8_t, table.capacity / 4 + (table.capacity % 4 != 0 ? 1 : 0));
- table.hashes = memnew_arr(uint32_t, table.capacity);
- table.keys = memnew_arr(TKey, table.capacity);
+public:
+ _FORCE_INLINE_ uint32_t get_capacity() const { return capacity; }
+ _FORCE_INLINE_ uint32_t get_num_elements() const { return num_elements; }
- zeromem(table.flags, table.capacity / 4 + (table.capacity % 4 != 0 ? 1 : 0));
+ void insert(const TKey &p_key, const TValue &p_value) {
- is_rehashing = true;
- rehash_position = 0;
- rehash_amount = (elements * 2) / (table.capacity * 0.7 - old_table.capacity);
+ if ((float)num_elements / (float)capacity > 0.9) {
+ _resize_and_rehash();
}
- if (!_raw_set_with_hash(hash, p_key, p_data))
- elements++;
+ uint32_t hash = _hash(p_key);
+
+ _insert_with_hash(hash, p_key, p_value);
+ }
+
+ void set(const TKey &p_key, const TValue &p_data) {
+ uint32_t pos = 0;
+ bool exists = _lookup_pos(p_key, pos);
+
+ if (exists) {
+ values[pos].~TValue();
+ memnew_placement(&values[pos], TValue(p_data));
+ } else {
+ insert(p_key, p_data);
+ }
}
/**
@@ -214,380 +219,108 @@ public:
* if r_data is not NULL then the value will be written to the object
* it points to.
*/
- bool lookup(const TKey &p_key, TData *r_data) {
-
- uint32_t hash = Hasher::hash(p_key);
-
- bool check_old_table = is_rehashing;
- bool check_new_table = true;
-
- // search for the key and return the value associated with it
- //
- // if we're rehashing we need to check both the old and the
- // current table. If we find a value in the old table we still
- // need to continue searching in the new table as it might have
- // been added after
-
- TData *value = NULL;
-
- for (int i = 0; i < table.capacity; i++) {
-
- if (!check_new_table && !check_old_table) {
-
- break;
- }
-
- // if we're rehashing check the old table
- if (check_old_table && i < old_table.capacity) {
-
- int pos = (hash + i) % old_table.capacity;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
- bool is_deleted_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1))) > 0;
-
- if (is_filled_flag) {
- // found our entry?
- if (old_table.hashes[pos] == hash && Comparator::compare(old_table.keys[pos], p_key)) {
- value = &old_table.data[pos];
- check_old_table = false;
- }
- } else if (!is_deleted_flag) {
-
- // we hit an empty field here, we don't
- // need to further check this old table
- // because we know it's not in here.
+ bool lookup(const TKey &p_key, TValue &r_data) {
+ uint32_t pos = 0;
+ bool exists = _lookup_pos(p_key, pos);
- check_old_table = false;
- }
- }
-
- if (check_new_table) {
-
- int pos = (hash + i) % table.capacity;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
- bool is_deleted_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1))) > 0;
-
- if (is_filled_flag) {
- // found our entry?
- if (table.hashes[pos] == hash && Comparator::compare(table.keys[pos], p_key)) {
- if (r_data != NULL)
- *r_data = table.data[pos];
- return true;
- }
- continue;
- } else if (is_deleted_flag) {
- continue;
- } else if (value != NULL) {
-
- // We found a value in the old table
- if (r_data != NULL)
- *r_data = *value;
- return true;
- } else {
- check_new_table = false;
- }
- }
- }
-
- if (value != NULL) {
- if (r_data != NULL)
- *r_data = *value;
+ if (exists) {
+ r_data.~TValue();
+ memnew_placement(&r_data, TValue(values[pos]));
return true;
}
+
return false;
}
_FORCE_INLINE_ bool has(const TKey &p_key) {
- return lookup(p_key, NULL);
+ uint32_t _pos = 0;
+ return _lookup_pos(p_key, _pos);
}
void remove(const TKey &p_key) {
- uint32_t hash = Hasher::hash(p_key);
-
- bool check_old_table = is_rehashing;
- bool check_new_table = true;
-
- for (int i = 0; i < table.capacity; i++) {
-
- if (!check_new_table && !check_old_table) {
- return;
- }
-
- // if we're rehashing check the old table
- if (check_old_table && i < old_table.capacity) {
-
- int pos = (hash + i) % old_table.capacity;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
- bool is_deleted_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1))) > 0;
-
- if (is_filled_flag) {
- // found our entry?
- if (old_table.hashes[pos] == hash && Comparator::compare(old_table.keys[pos], p_key)) {
- old_table.keys[pos].~TKey();
- old_table.data[pos].~TData();
+ uint32_t pos = 0;
+ bool exists = _lookup_pos(p_key, pos);
- memnew_placement(&old_table.keys[pos], TKey);
- memnew_placement(&old_table.data[pos], TData);
-
- old_table.flags[flags_pos] &= ~(1 << (2 * flags_pos_offset));
- old_table.flags[flags_pos] |= (1 << (2 * flags_pos_offset + 1));
-
- elements--;
- return;
- }
- } else if (!is_deleted_flag) {
-
- // we hit an empty field here, we don't
- // need to further check this old table
- // because we know it's not in here.
-
- check_old_table = false;
- }
- }
-
- if (check_new_table) {
-
- int pos = (hash + i) % table.capacity;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
- bool is_deleted_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset + 1))) > 0;
-
- if (is_filled_flag) {
- // found our entry?
- if (table.hashes[pos] == hash && Comparator::compare(table.keys[pos], p_key)) {
- table.keys[pos].~TKey();
- table.data[pos].~TData();
-
- memnew_placement(&table.keys[pos], TKey);
- memnew_placement(&table.data[pos], TData);
-
- table.flags[flags_pos] &= ~(1 << (2 * flags_pos_offset));
- table.flags[flags_pos] |= (1 << (2 * flags_pos_offset + 1));
-
- // don't return here, this value might still be in the old table
- // if it was already relocated.
-
- elements--;
- return;
- }
- continue;
- } else if (is_deleted_flag) {
- continue;
- } else {
- check_new_table = false;
- }
- }
+ if (!exists) {
+ return;
}
+
+ hashes[pos] |= DELETED_HASH_BIT;
+ values[pos].~TValue();
+ keys[pos].~TKey();
+ num_elements--;
}
struct Iterator {
bool valid;
- uint32_t hash;
-
const TKey *key;
- const TData *data;
+ const TValue *value;
private:
+ uint32_t pos;
friend class OAHashMap;
- bool was_from_old_table;
};
Iterator iter() const {
Iterator it;
- it.valid = false;
- it.was_from_old_table = false;
-
- bool check_old_table = is_rehashing;
-
- for (int i = 0; i < table.capacity; i++) {
-
- // if we're rehashing check the old table first
- if (check_old_table && i < old_table.capacity) {
-
- int pos = i;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
-
- if (is_filled_flag) {
- it.valid = true;
- it.hash = old_table.hashes[pos];
- it.data = &old_table.data[pos];
- it.key = &old_table.keys[pos];
-
- it.was_from_old_table = true;
-
- return it;
- }
- }
-
- {
-
- int pos = i;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
-
- if (is_filled_flag) {
- it.valid = true;
- it.hash = table.hashes[pos];
- it.data = &table.data[pos];
- it.key = &table.keys[pos];
-
- return it;
- }
- }
- }
+ it.valid = true;
+ it.pos = 0;
- return it;
+ return next_iter(it);
}
Iterator next_iter(const Iterator &p_iter) const {
+
if (!p_iter.valid) {
return p_iter;
}
Iterator it;
-
it.valid = false;
- it.was_from_old_table = false;
-
- bool check_old_table = is_rehashing;
-
- // we use this to skip the first check or not
- bool was_from_old_table = p_iter.was_from_old_table;
-
- int prev_index = (p_iter.data - (p_iter.was_from_old_table ? old_table.data : table.data));
-
- if (!was_from_old_table) {
- prev_index++;
- }
+ it.pos = p_iter.pos;
+ it.key = NULL;
+ it.value = NULL;
- for (int i = prev_index; i < table.capacity; i++) {
+ for (uint32_t i = it.pos; i < capacity; i++) {
+ it.pos = i + 1;
- // if we're rehashing check the old table first
- if (check_old_table && i < old_table.capacity && !was_from_old_table) {
-
- int pos = i;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (old_table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
-
- if (is_filled_flag) {
- it.valid = true;
- it.hash = old_table.hashes[pos];
- it.data = &old_table.data[pos];
- it.key = &old_table.keys[pos];
-
- it.was_from_old_table = true;
-
- return it;
- }
+ if (hashes[i] == EMPTY_HASH) {
+ continue;
}
-
- was_from_old_table = false;
-
- {
- int pos = i;
-
- int flags_pos = pos / 4;
- int flags_pos_offset = pos % 4;
-
- bool is_filled_flag = (table.flags[flags_pos] & (1 << (2 * flags_pos_offset))) > 0;
-
- if (is_filled_flag) {
- it.valid = true;
- it.hash = table.hashes[pos];
- it.data = &table.data[pos];
- it.key = &table.keys[pos];
-
- return it;
- }
+ if (hashes[i] & DELETED_HASH_BIT) {
+ continue;
}
+
+ it.valid = true;
+ it.key = &keys[i];
+ it.value = &values[i];
+ return it;
}
return it;
}
- OAHashMap(uint32_t p_initial_capacity = INITIAL_NUM_ELEMENTS) {
+ OAHashMap(uint32_t p_initial_capacity = 64) {
-#ifdef OA_HASH_MAP_INITIAL_LOCAL_STORAGE
+ capacity = p_initial_capacity;
+ num_elements = 0;
- if (p_initial_capacity <= INITIAL_NUM_ELEMENTS) {
- table.data = local_data;
- table.keys = local_keys;
- table.hashes = local_hashes;
- table.flags = local_flags;
+ keys = memnew_arr(TKey, p_initial_capacity);
+ values = memnew_arr(TValue, p_initial_capacity);
+ hashes = memnew_arr(uint32_t, p_initial_capacity);
- zeromem(table.flags, INITIAL_NUM_ELEMENTS / 4 + (INITIAL_NUM_ELEMENTS % 4 != 0 ? 1 : 0));
-
- table.capacity = INITIAL_NUM_ELEMENTS;
- elements = 0;
- } else
-#endif
- {
- table.data = memnew_arr(TData, p_initial_capacity);
- table.keys = memnew_arr(TKey, p_initial_capacity);
- table.hashes = memnew_arr(uint32_t, p_initial_capacity);
- table.flags = memnew_arr(uint8_t, p_initial_capacity / 4 + (p_initial_capacity % 4 != 0 ? 1 : 0));
-
- zeromem(table.flags, p_initial_capacity / 4 + (p_initial_capacity % 4 != 0 ? 1 : 0));
-
- table.capacity = p_initial_capacity;
- elements = 0;
+ for (int i = 0; i < p_initial_capacity; i++) {
+ hashes[i] = 0;
}
-
- is_rehashing = false;
- rehash_position = 0;
}
~OAHashMap() {
-#ifdef OA_HASH_MAP_INITIAL_LOCAL_STORAGE
- if (table.capacity <= INITIAL_NUM_ELEMENTS) {
- return; // Everything is local, so no cleanup :P
- }
-#endif
- if (is_rehashing) {
-
-#ifdef OA_HASH_MAP_INITIAL_LOCAL_STORAGE
- if (old_table.data == local_data) {
- // Everything is local, so no cleanup :P
- } else
-#endif
- {
- memdelete_arr(old_table.data);
- memdelete_arr(old_table.keys);
- memdelete_arr(old_table.hashes);
- memdelete_arr(old_table.flags);
- }
- }
- memdelete_arr(table.data);
- memdelete_arr(table.keys);
- memdelete_arr(table.hashes);
- memdelete_arr(table.flags);
+ memdelete_arr(keys);
+ memdelete_arr(values);
+ memdelete(hashes);
}
};
diff --git a/core/object.cpp b/core/object.cpp
index aaa37e6cf2..239700a4ab 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -1919,9 +1919,7 @@ ObjectID ObjectDB::add_instance(Object *p_object) {
rw_lock->write_lock();
instances[++instance_counter] = p_object;
-#ifdef DEBUG_ENABLED
instance_checks[p_object] = instance_counter;
-#endif
rw_lock->write_unlock();
return instance_counter;
@@ -1932,9 +1930,7 @@ void ObjectDB::remove_instance(Object *p_object) {
rw_lock->write_lock();
instances.erase(p_object->get_instance_id());
-#ifdef DEBUG_ENABLED
instance_checks.erase(p_object);
-#endif
rw_lock->write_unlock();
}
diff --git a/core/object.h b/core/object.h
index 8306b5a356..c405e22557 100644
--- a/core/object.h
+++ b/core/object.h
@@ -762,15 +762,10 @@ public:
static void debug_objects(DebugFunc p_func);
static int get_object_count();
-#ifdef DEBUG_ENABLED
_FORCE_INLINE_ static bool instance_validate(Object *p_ptr) {
return instance_checks.has(p_ptr);
}
-#else
- _FORCE_INLINE_ static bool instance_validate(Object *p_ptr) { return true; }
-
-#endif
};
//needed by macros
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 854d554b10..5eed10e30c 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -672,6 +672,7 @@ OS::OS() {
_render_thread_mode = RENDER_THREAD_SAFE;
_allow_hidpi = false;
+ _allow_layered = false;
_stack_bottom = (void *)(&stack_bottom);
_logger = NULL;
diff --git a/core/os/os.h b/core/os/os.h
index 943c0498f1..b36f94060c 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -65,6 +65,7 @@ class OS {
int _exit_code;
int _orientation;
bool _allow_hidpi;
+ bool _allow_layered;
bool _use_vsync;
char *last_error;
@@ -102,6 +103,8 @@ public:
bool maximized;
bool always_on_top;
bool use_vsync;
+ bool layered_splash;
+ bool layered;
float get_aspect() const { return (float)width / (float)height; }
VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_always_on_top = false, bool p_use_vsync = false) {
width = p_width;
@@ -112,6 +115,8 @@ public:
maximized = p_maximized;
always_on_top = p_always_on_top;
use_vsync = p_use_vsync;
+ layered = false;
+ layered_splash = false;
}
};
@@ -220,6 +225,13 @@ public:
virtual void set_borderless_window(bool p_borderless) {}
virtual bool get_borderless_window() { return 0; }
+ virtual bool get_window_per_pixel_transparency_enabled() const { return false; }
+ virtual void set_window_per_pixel_transparency_enabled(bool p_enabled) {}
+
+ virtual uint8_t *get_layered_buffer_data() { return NULL; }
+ virtual Size2 get_layered_buffer_size() { return Size2(0, 0); }
+ virtual void swap_layered_buffer() {}
+
virtual void set_ime_position(const Point2 &p_pos) {}
virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp) {}
@@ -320,6 +332,7 @@ public:
virtual void disable_crash_handler() {}
virtual bool is_disable_crash_handler() const { return false; }
+ virtual void initialize_debugging() {}
enum CursorShape {
CURSOR_ARROW,
@@ -480,6 +493,7 @@ public:
virtual void force_process_input(){};
bool has_feature(const String &p_feature);
+ bool is_layered_allowed() const { return _allow_layered; }
bool is_hidpi_allowed() const { return _allow_hidpi; }
OS();
virtual ~OS();
diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp
index c0e115e300..55d7270473 100644
--- a/core/script_debugger_local.cpp
+++ b/core/script_debugger_local.cpp
@@ -29,12 +29,23 @@
/*************************************************************************/
#include "script_debugger_local.h"
+#include "scene/main/scene_tree.h"
#include "os/os.h"
void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue) {
- print_line("Debugger Break, Reason: '" + p_script->debug_get_error() + "'");
+ if (!target_function.empty()) {
+ String current_function = p_script->debug_get_stack_level_function(0);
+ if (current_function != target_function) {
+ set_depth(0);
+ set_lines_left(1);
+ return;
+ }
+ target_function = "";
+ }
+
+ print_line("\nDebugger Break, Reason: '" + p_script->debug_get_error() + "'");
print_line("*Frame " + itos(0) + " - " + p_script->debug_get_stack_level_source(0) + ":" + itos(p_script->debug_get_stack_level_line(0)) + " in function '" + p_script->debug_get_stack_level_function(0) + "'");
print_line("Enter \"help\" for assistance.");
int current_frame = 0;
@@ -44,8 +55,11 @@ void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue) {
OS::get_singleton()->print("debug> ");
String line = OS::get_singleton()->get_stdin_string().strip_edges();
+ // Cache options
+ String variable_prefix = options["variable_prefix"];
+
if (line == "") {
- print_line("Debugger Break, Reason: '" + p_script->debug_get_error() + "'");
+ print_line("\nDebugger Break, Reason: '" + p_script->debug_get_error() + "'");
print_line("*Frame " + itos(current_frame) + " - " + p_script->debug_get_stack_level_source(current_frame) + ":" + itos(p_script->debug_get_stack_level_line(current_frame)) + " in function '" + p_script->debug_get_stack_level_function(current_frame) + "'");
print_line("Enter \"help\" for assistance.");
} else if (line == "c" || line == "continue")
@@ -72,38 +86,56 @@ void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue) {
}
}
+ } else if (line.begins_with("set")) {
+
+ if (line.get_slice_count(" ") == 1) {
+
+ for (Map<String, String>::Element *E = options.front(); E; E = E->next()) {
+ print_line("\t" + E->key() + "=" + E->value());
+ }
+
+ } else {
+ String key_value = line.get_slicec(' ', 1);
+ int value_pos = key_value.find("=");
+
+ if (value_pos < 0) {
+ print_line("Error: Invalid set format. Use: set key=value");
+ } else {
+
+ String key = key_value.left(value_pos);
+
+ if (!options.has(key)) {
+ print_line("Error: Unknown option " + key);
+ } else {
+
+ // Allow explicit tab character
+ String value = key_value.right(value_pos + 1).replace("\\t", "\t");
+
+ options[key] = value;
+ }
+ }
+ }
+
} else if (line == "lv" || line == "locals") {
List<String> locals;
List<Variant> values;
p_script->debug_get_stack_level_locals(current_frame, &locals, &values);
- List<Variant>::Element *V = values.front();
- for (List<String>::Element *E = locals.front(); E; E = E->next()) {
- print_line(E->get() + ": " + String(V->get()));
- V = V->next();
- }
+ print_variables(locals, values, variable_prefix);
} else if (line == "gv" || line == "globals") {
- List<String> locals;
+ List<String> globals;
List<Variant> values;
- p_script->debug_get_globals(&locals, &values);
- List<Variant>::Element *V = values.front();
- for (List<String>::Element *E = locals.front(); E; E = E->next()) {
- print_line(E->get() + ": " + String(V->get()));
- V = V->next();
- }
+ p_script->debug_get_globals(&globals, &values);
+ print_variables(globals, values, variable_prefix);
} else if (line == "mv" || line == "members") {
- List<String> locals;
+ List<String> members;
List<Variant> values;
- p_script->debug_get_stack_level_members(current_frame, &locals, &values);
- List<Variant>::Element *V = values.front();
- for (List<String>::Element *E = locals.front(); E; E = E->next()) {
- print_line(E->get() + ": " + String(V->get()));
- V = V->next();
- }
+ p_script->debug_get_stack_level_members(current_frame, &members, &values);
+ print_variables(members, values, variable_prefix);
} else if (line.begins_with("p") || line.begins_with("print")) {
@@ -121,65 +153,149 @@ void ScriptDebuggerLocal::debug(ScriptLanguage *p_script, bool p_can_continue) {
set_depth(-1);
set_lines_left(1);
break;
- } else if (line.begins_with("n") || line.begins_with("next")) {
+ } else if (line == "n" || line == "next") {
set_depth(0);
set_lines_left(1);
break;
+ } else if (line == "fin" || line == "finish") {
+
+ String current_function = p_script->debug_get_stack_level_function(0);
+
+ for (int i = 0; i < total_frames; i++) {
+ target_function = p_script->debug_get_stack_level_function(i);
+ if (target_function != current_function) {
+ set_depth(0);
+ set_lines_left(1);
+ return;
+ }
+ }
+
+ print_line("Error: Reached last frame.");
+ target_function = "";
+
} else if (line.begins_with("br") || line.begins_with("break")) {
if (line.get_slice_count(" ") <= 1) {
- //show breakpoints
+
+ const Map<int, Set<StringName> > &breakpoints = get_breakpoints();
+ if (breakpoints.size() == 0) {
+ print_line("No Breakpoints.");
+ continue;
+ }
+
+ print_line("Breakpoint(s): " + itos(breakpoints.size()));
+ for (Map<int, Set<StringName> >::Element *E = breakpoints.front(); E; E = E->next()) {
+ print_line("\t" + String(E->value().front()->get()) + ":" + itos(E->key()));
+ }
+
} else {
- String bppos = line.get_slicec(' ', 1);
- String source = bppos.get_slicec(':', 0).strip_edges();
- int line = bppos.get_slicec(':', 1).strip_edges().to_int();
+ Pair<String, int> breakpoint = to_breakpoint(line);
+
+ String source = breakpoint.first;
+ int linenr = breakpoint.second;
- source = breakpoint_find_source(source);
+ if (source.empty())
+ continue;
- insert_breakpoint(line, source);
+ insert_breakpoint(linenr, source);
- print_line("BreakPoint at " + source + ":" + itos(line));
+ print_line("Added breakpoint at " + source + ":" + itos(linenr));
}
+ } else if (line == "q" || line == "quit") {
+
+ // Do not stop again on quit
+ clear_breakpoints();
+ ScriptDebugger::get_singleton()->set_depth(-1);
+ ScriptDebugger::get_singleton()->set_lines_left(-1);
+
+ SceneTree::get_singleton()->quit();
+ break;
} else if (line.begins_with("delete")) {
if (line.get_slice_count(" ") <= 1) {
clear_breakpoints();
} else {
- String bppos = line.get_slicec(' ', 1);
- String source = bppos.get_slicec(':', 0).strip_edges();
- int line = bppos.get_slicec(':', 1).strip_edges().to_int();
+ Pair<String, int> breakpoint = to_breakpoint(line);
+
+ String source = breakpoint.first;
+ int linenr = breakpoint.second;
- source = breakpoint_find_source(source);
+ if (source.empty())
+ continue;
- remove_breakpoint(line, source);
+ remove_breakpoint(linenr, source);
- print_line("Removed BreakPoint at " + source + ":" + itos(line));
+ print_line("Removed breakpoint at " + source + ":" + itos(linenr));
}
} else if (line == "h" || line == "help") {
print_line("Built-In Debugger command list:\n");
- print_line("\tc,continue :\t\t Continue execution.");
- print_line("\tbt,backtrace :\t\t Show stack trace (frames).");
+ print_line("\tc,continue\t\t Continue execution.");
+ print_line("\tbt,backtrace\t\t Show stack trace (frames).");
print_line("\tfr,frame <frame>:\t Change current frame.");
- print_line("\tlv,locals :\t\t Show local variables for current frame.");
- print_line("\tmv,members :\t\t Show member variables for \"this\" in frame.");
- print_line("\tgv,globals :\t\t Show global variables.");
- print_line("\tp,print <expr> :\t Execute and print variable in expression.");
- print_line("\ts,step :\t\t Step to next line.");
- print_line("\tn,next :\t\t Next line.");
- print_line("\tbr,break source:line :\t Place a breakpoint.");
- print_line("\tdelete [source:line]:\t\t Delete one/all breakpoints.");
+ print_line("\tlv,locals\t\t Show local variables for current frame.");
+ print_line("\tmv,members\t\t Show member variables for \"this\" in frame.");
+ print_line("\tgv,globals\t\t Show global variables.");
+ print_line("\tp,print <expr>\t\t Execute and print variable in expression.");
+ print_line("\ts,step\t\t\t Step to next line.");
+ print_line("\tn,next\t\t\t Next line.");
+ print_line("\tfin,finish\t\t Step out of current frame.");
+ print_line("\tbr,break [source:line]\t List all breakpoints or place a breakpoint.");
+ print_line("\tdelete [source:line]:\t Delete one/all breakpoints.");
+ print_line("\tset [key=value]:\t List all options, or set one.");
+ print_line("\tq,quit\t\t\t Quit application.");
} else {
print_line("Error: Invalid command, enter \"help\" for assistance.");
}
}
}
+void ScriptDebuggerLocal::print_variables(const List<String> &names, const List<Variant> &values, const String &variable_prefix) {
+
+ String value;
+ Vector<String> value_lines;
+ const List<Variant>::Element *V = values.front();
+ for (const List<String>::Element *E = names.front(); E; E = E->next()) {
+
+ value = String(V->get());
+
+ if (variable_prefix.empty()) {
+ print_line(E->get() + ": " + String(V->get()));
+ } else {
+
+ print_line(E->get() + ":");
+ value_lines = value.split("\n");
+ for (int i = 0; i < value_lines.size(); ++i) {
+ print_line(variable_prefix + value_lines[i]);
+ }
+ }
+
+ V = V->next();
+ }
+}
+
+Pair<String, int> ScriptDebuggerLocal::to_breakpoint(const String &p_line) {
+
+ String breakpoint_part = p_line.get_slicec(' ', 1);
+ Pair<String, int> breakpoint;
+
+ int last_colon = breakpoint_part.rfind(":");
+ if (last_colon < 0) {
+ print_line("Error: Invalid breakpoint format. Expected [source:line]");
+ return breakpoint;
+ }
+
+ breakpoint.first = breakpoint_find_source(breakpoint_part.left(last_colon).strip_edges());
+ breakpoint.second = breakpoint_part.right(last_colon).strip_edges().to_int();
+
+ return breakpoint;
+}
+
struct _ScriptDebuggerLocalProfileInfoSort {
bool operator()(const ScriptLanguage::ProfilingInfo &A, const ScriptLanguage::ProfilingInfo &B) const {
@@ -304,4 +420,5 @@ ScriptDebuggerLocal::ScriptDebuggerLocal() {
profiling = false;
idle_accum = OS::get_singleton()->get_ticks_usec();
+ options["variable_prefix"] = "";
}
diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h
index c87bc90bb4..7eea6ef215 100644
--- a/core/script_debugger_local.h
+++ b/core/script_debugger_local.h
@@ -31,6 +31,7 @@
#ifndef SCRIPT_DEBUGGER_LOCAL_H
#define SCRIPT_DEBUGGER_LOCAL_H
+#include "list.h"
#include "script_language.h"
class ScriptDebuggerLocal : public ScriptDebugger {
@@ -38,9 +39,14 @@ class ScriptDebuggerLocal : public ScriptDebugger {
bool profiling;
float frame_time, idle_time, physics_time, physics_frame_time;
uint64_t idle_accum;
+ String target_function;
+ Map<String, String> options;
Vector<ScriptLanguage::ProfilingInfo> pinfo;
+ Pair<String, int> to_breakpoint(const String &p_line);
+ void print_variables(const List<String> &names, const List<Variant> &values, const String &variable_prefix);
+
public:
void debug(ScriptLanguage *p_script, bool p_can_continue);
virtual void send_message(const String &p_message, const Array &p_args);
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 632285f48d..75bcedbbc8 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -37,6 +37,7 @@
#include "os/os.h"
#include "project_settings.h"
#include "scene/main/node.h"
+#include "scene/resources/packed_scene.h"
void ScriptDebuggerRemote::_send_video_memory() {
@@ -148,6 +149,16 @@ void ScriptDebuggerRemote::_put_variable(const String &p_name, const Variant &p_
}
}
+void ScriptDebuggerRemote::_save_node(ObjectID id, const String &p_path) {
+
+ Node *node = Object::cast_to<Node>(ObjectDB::get_instance(id));
+ ERR_FAIL_COND(!node);
+
+ Ref<PackedScene> ps = memnew(PackedScene);
+ ps->pack(node);
+ ResourceSaver::save(p_path, ps);
+}
+
void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue) {
//this function is called when there is a debugger break (bug on script)
@@ -322,6 +333,8 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue)
else
remove_breakpoint(cmd[2], cmd[1]);
+ } else if (command == "save_node") {
+ _save_node(cmd[1], cmd[2]);
} else {
_parse_live_edit(cmd);
}
diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h
index 2c4e29f172..cc12d978d6 100644
--- a/core/script_debugger_remote.h
+++ b/core/script_debugger_remote.h
@@ -133,6 +133,8 @@ class ScriptDebuggerRemote : public ScriptDebugger {
void _put_variable(const String &p_name, const Variant &p_variable);
+ void _save_node(ObjectID id, const String &p_path);
+
public:
struct ResourceUsage {
diff --git a/core/script_language.h b/core/script_language.h
index 0c1f99cea6..b4c55cac9e 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -236,6 +236,8 @@ public:
virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const = 0;
virtual void add_global_constant(const StringName &p_variable, const Variant &p_value) = 0;
+ virtual void add_named_global_constant(const StringName &p_name, const Variant &p_value) {}
+ virtual void remove_named_global_constant(const StringName &p_name) {}
/* MULTITHREAD FUNCTIONS */
@@ -386,6 +388,7 @@ public:
bool is_breakpoint(int p_line, const StringName &p_source) const;
bool is_breakpoint_line(int p_line) const;
void clear_breakpoints();
+ const Map<int, Set<StringName> > &get_breakpoints() const { return breakpoints; }
virtual void debug(ScriptLanguage *p_script, bool p_can_continue = true) = 0;
virtual void idle_poll();
diff --git a/core/self_list.h b/core/self_list.h
index e83afb66ef..6e84e1cd5f 100644
--- a/core/self_list.h
+++ b/core/self_list.h
@@ -39,6 +39,7 @@ public:
class List {
SelfList<T> *_first;
+ SelfList<T> *_last;
public:
void add(SelfList<T> *p_elem) {
@@ -48,47 +49,54 @@ public:
p_elem->_root = this;
p_elem->_next = _first;
p_elem->_prev = NULL;
- if (_first)
+
+ if (_first) {
_first->_prev = p_elem;
+
+ } else {
+ _last = p_elem;
+ }
+
_first = p_elem;
}
+
void add_last(SelfList<T> *p_elem) {
ERR_FAIL_COND(p_elem->_root);
- if (!_first) {
- add(p_elem);
- return;
- }
+ p_elem->_root = this;
+ p_elem->_next = NULL;
+ p_elem->_prev = _last;
- SelfList<T> *e = _first;
+ if (_last) {
+ _last->_next = p_elem;
- while (e->next()) {
- e = e->next();
+ } else {
+ _first = p_elem;
}
- e->_next = p_elem;
- p_elem->_prev = e->_next;
- p_elem->_root = this;
+ _last = p_elem;
}
void remove(SelfList<T> *p_elem) {
ERR_FAIL_COND(p_elem->_root != this);
if (p_elem->_next) {
-
p_elem->_next->_prev = p_elem->_prev;
}
- if (p_elem->_prev) {
+ if (p_elem->_prev) {
p_elem->_prev->_next = p_elem->_next;
}
if (_first == p_elem) {
-
_first = p_elem->_next;
}
+ if (_last == p_elem) {
+ _last = p_elem->_prev;
+ }
+
p_elem->_next = NULL;
p_elem->_prev = NULL;
p_elem->_root = NULL;
@@ -96,7 +104,10 @@ public:
_FORCE_INLINE_ SelfList<T> *first() { return _first; }
_FORCE_INLINE_ const SelfList<T> *first() const { return _first; }
- _FORCE_INLINE_ List() { _first = NULL; }
+ _FORCE_INLINE_ List() {
+ _first = NULL;
+ _last = NULL;
+ }
_FORCE_INLINE_ ~List() { ERR_FAIL_COND(_first != NULL); }
};
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 921d20a6fd..85b7a16e6a 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -945,8 +945,8 @@ String String::num(double p_num, int p_decimals) {
#ifndef NO_USE_STDLIB
- if (p_decimals > 12)
- p_decimals = 12;
+ if (p_decimals > 16)
+ p_decimals = 16;
char fmt[7];
fmt[0] = '%';
diff --git a/core/variant.h b/core/variant.h
index 2cdb5c9ab6..f227e4bfdb 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -140,7 +140,6 @@ private:
::AABB *_aabb;
Basis *_basis;
Transform *_transform;
- RefPtr *_resource;
void *_ptr; //generic pointer
uint8_t _mem[sizeof(ObjData) > (sizeof(real_t) * 4) ? sizeof(ObjData) : (sizeof(real_t) * 4)];
} _data;
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 1b938e3f41..bd1cde5a82 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -344,6 +344,8 @@ struct _VariantCall {
VCALL_LOCALMEM1R(Vector2, rotated);
VCALL_LOCALMEM0R(Vector2, tangent);
VCALL_LOCALMEM0R(Vector2, floor);
+ VCALL_LOCALMEM0R(Vector2, ceil);
+ VCALL_LOCALMEM0R(Vector2, round);
VCALL_LOCALMEM1R(Vector2, snapped);
VCALL_LOCALMEM0R(Vector2, aspect);
VCALL_LOCALMEM1R(Vector2, dot);
@@ -386,6 +388,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Vector3, abs);
VCALL_LOCALMEM0R(Vector3, floor);
VCALL_LOCALMEM0R(Vector3, ceil);
+ VCALL_LOCALMEM0R(Vector3, round);
VCALL_LOCALMEM1R(Vector3, distance_to);
VCALL_LOCALMEM1R(Vector3, distance_squared_to);
VCALL_LOCALMEM1R(Vector3, angle_to);
@@ -1519,6 +1522,8 @@ void register_variant_methods() {
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, rotated, REAL, "phi", varray());
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, tangent, varray());
ADDFUNC0R(VECTOR2, VECTOR2, Vector2, floor, varray());
+ ADDFUNC0R(VECTOR2, VECTOR2, Vector2, ceil, varray());
+ ADDFUNC0R(VECTOR2, VECTOR2, Vector2, round, varray());
ADDFUNC1R(VECTOR2, VECTOR2, Vector2, snapped, VECTOR2, "by", varray());
ADDFUNC0R(VECTOR2, REAL, Vector2, aspect, varray());
ADDFUNC1R(VECTOR2, REAL, Vector2, dot, VECTOR2, "with", varray());
@@ -1560,6 +1565,7 @@ void register_variant_methods() {
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, abs, varray());
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, floor, varray());
ADDFUNC0R(VECTOR3, VECTOR3, Vector3, ceil, varray());
+ ADDFUNC0R(VECTOR3, VECTOR3, Vector3, round, varray());
ADDFUNC1R(VECTOR3, REAL, Vector3, distance_to, VECTOR3, "b", varray());
ADDFUNC1R(VECTOR3, REAL, Vector3, distance_squared_to, VECTOR3, "b", varray());
ADDFUNC1R(VECTOR3, REAL, Vector3, angle_to, VECTOR3, "to", varray());
diff --git a/doc/classes/@GDScript.xml b/doc/classes/@GDScript.xml
index acece05510..cddc59ab71 100644
--- a/doc/classes/@GDScript.xml
+++ b/doc/classes/@GDScript.xml
@@ -485,6 +485,14 @@
Returns True/False whether [code]s[/code] is an infinity value (either positive infinity or negative infinity).
</description>
</method>
+ <method name="is_instance_valid">
+ <return type="bool">
+ </return>
+ <argument index="0" name="instance" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="is_nan">
<return type="bool">
</return>
@@ -510,9 +518,9 @@
<method name="lerp">
<return type="float">
</return>
- <argument index="0" name="from" type="float">
+ <argument index="0" name="from" type="Variant">
</argument>
- <argument index="1" name="to" type="float">
+ <argument index="1" name="to" type="Variant">
</argument>
<argument index="2" name="weight" type="float">
</argument>
diff --git a/doc/classes/AnimatedSprite.xml b/doc/classes/AnimatedSprite.xml
index a6521c0cd1..a41ed0e689 100644
--- a/doc/classes/AnimatedSprite.xml
+++ b/doc/classes/AnimatedSprite.xml
@@ -60,6 +60,8 @@
<member name="playing" type="bool" setter="_set_playing" getter="_is_playing">
If [code]true[/code] the [member animation] is currently playing.
</member>
+ <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale">
+ </member>
</members>
<signals>
<signal name="animation_finished">
diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml
index 38aab5231e..80d7b7783f 100644
--- a/doc/classes/ArrayMesh.xml
+++ b/doc/classes/ArrayMesh.xml
@@ -91,7 +91,7 @@
<argument index="0" name="surf_idx" type="int">
</argument>
<description>
- Return the length in indices of the index array in the requested surface (see [method add_surface]).
+ Return the length in indices of the index array in the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
<method name="surface_get_array_len" qualifiers="const">
@@ -100,7 +100,7 @@
<argument index="0" name="surf_idx" type="int">
</argument>
<description>
- Return the length in vertices of the vertex array in the requested surface (see [method add_surface]).
+ Return the length in vertices of the vertex array in the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
<method name="surface_get_arrays" qualifiers="const">
@@ -125,7 +125,7 @@
<argument index="0" name="surf_idx" type="int">
</argument>
<description>
- Return the format mask of the requested surface (see [method add_surface]).
+ Return the format mask of the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
<method name="surface_get_material" qualifiers="const">
@@ -151,7 +151,7 @@
<argument index="0" name="surf_idx" type="int">
</argument>
<description>
- Return the primitive type of the requested surface (see [method add_surface]).
+ Return the primitive type of the requested surface (see [method add_surface_from_arrays]).
</description>
</method>
<method name="surface_remove">
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index 4a69695ae5..7d9fcf3e01 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -57,6 +57,7 @@
If the audio configuration has more than two speakers, this sets the target channels. See [code]MIX_TARGET_*[/code] constants.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale">
+ Changes the pitch and the tempo of the audio.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing">
If [code]true[/code] audio is playing.
diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml
index 495d37e6b8..81beab245d 100644
--- a/doc/classes/AudioStreamPlayer2D.xml
+++ b/doc/classes/AudioStreamPlayer2D.xml
@@ -63,6 +63,7 @@
Maximum distance from which audio is still hearable.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale">
+ Changes the pitch and the tempo of the audio.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing">
If [code]true[/code] audio is playing.
diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml
index 3418ef7a26..311efb7495 100644
--- a/doc/classes/AudioStreamPlayer3D.xml
+++ b/doc/classes/AudioStreamPlayer3D.xml
@@ -87,6 +87,7 @@
Decides if audio should pause when source is outside of 'max_distance' range.
</member>
<member name="pitch_scale" type="float" setter="set_pitch_scale" getter="get_pitch_scale">
+ Changes the pitch and the tempo of the audio.
</member>
<member name="playing" type="bool" setter="_set_playing" getter="is_playing">
If [code]true[/code], audio is playing.
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index 2f44179adb..3ff8634010 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -15,7 +15,7 @@
<return type="void">
</return>
<description>
- Called when button is pressed.
+ Called when the button is pressed.
</description>
</method>
<method name="_toggled" qualifiers="virtual">
@@ -24,7 +24,7 @@
<argument index="0" name="button_pressed" type="bool">
</argument>
<description>
- Called when button is toggled (only if toggle_mode is active).
+ Called when the button is toggled (only if toggle_mode is active).
</description>
</method>
<method name="get_draw_mode" qualifiers="const">
@@ -38,7 +38,7 @@
<return type="bool">
</return>
<description>
- Return true if mouse entered the button before it exit.
+ Return true if the mouse has entered the button and has not left it yet.
</description>
</method>
</methods>
@@ -46,6 +46,10 @@
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" enum="BaseButton.ActionMode">
Determines when the button is considered clicked, one of the ACTION_MODE_* constants.
</member>
+ <member name="button_mask" type="int" setter="set_button_mask" getter="get_button_mask">
+ Binary mask to choose which mouse buttons this button will respond to.
+ To allow both left-click and right-click, set this to 3, because it's BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT.
+ </member>
<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
If [code]true[/code] the button is in disabled state and can't be clicked or toggled.
</member>
diff --git a/doc/classes/Bone2D.xml b/doc/classes/Bone2D.xml
new file mode 100644
index 0000000000..7e714305cd
--- /dev/null
+++ b/doc/classes/Bone2D.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Bone2D" inherits="Node2D" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="apply_rest">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_index_in_skeleton" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_skeleton_rest" qualifiers="const">
+ <return type="Transform2D">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="default_length" type="float" setter="set_default_length" getter="get_default_length">
+ </member>
+ <member name="rest" type="Transform2D" setter="set_rest" getter="get_rest">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 1705808c04..c8622be4ad 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -566,6 +566,9 @@
<constant name="BLEND_MODE_PREMULT_ALPHA" value="4" enum="BlendMode">
Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value.
</constant>
+ <constant name="BLEND_MODE_DISABLED" value="5" enum="BlendMode">
+ Disable blending mode. Colors including alpha are written as is. Only applicable for render targets with a transparent background. No lighting will be applied.
+ </constant>
<constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29">
Canvas item transform has changed. Only received if requested.
</constant>
diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml
index 2617aaef17..104c9e0a98 100644
--- a/doc/classes/Color.xml
+++ b/doc/classes/Color.xml
@@ -129,9 +129,9 @@
<argument index="3" name="a" type="float" default="1">
</argument>
<description>
- Constructs a color from an HSV profile. [code]h[/code] is a value between 0 and 360. [code]s[/code] and [code]v[/code] are values between 0 and 1.
+ Constructs a color from an HSV profile. [code]h[/code], [code]s[/code], and [code]v[/code] are values between 0 and 1.
[codeblock]
- var c = Color.from_hsv(210, 0.5, 0.79, 0.8) # equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8)
+ var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8)
[/codeblock]
</description>
</method>
diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml
index eb86dc8af8..656fce587f 100644
--- a/doc/classes/ColorPickerButton.xml
+++ b/doc/classes/ColorPickerButton.xml
@@ -42,6 +42,10 @@
Emitted when the color changes.
</description>
</signal>
+ <signal name="popup_closed">
+ <description>
+ </description>
+ </signal>
</signals>
<constants>
</constants>
diff --git a/doc/classes/Curve2D.xml b/doc/classes/Curve2D.xml
index 03db9c2ea1..71bdaff688 100644
--- a/doc/classes/Curve2D.xml
+++ b/doc/classes/Curve2D.xml
@@ -49,6 +49,22 @@
Returns the cache of points as a [PoolVector2Array].
</description>
</method>
+ <method name="get_closest_offset" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="to_point" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_closest_point" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <argument index="0" name="to_point" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_point_count" qualifiers="const">
<return type="int">
</return>
diff --git a/doc/classes/Curve3D.xml b/doc/classes/Curve3D.xml
index f2308de12c..c012e2794e 100644
--- a/doc/classes/Curve3D.xml
+++ b/doc/classes/Curve3D.xml
@@ -56,6 +56,22 @@
Returns the cache of tilts as a [RealArray].
</description>
</method>
+ <method name="get_closest_offset" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="to_point" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_closest_point" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <argument index="0" name="to_point" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_point_count" qualifiers="const">
<return type="int">
</return>
diff --git a/doc/classes/DynamicFont.xml b/doc/classes/DynamicFont.xml
index 03752c6e89..2e2904c16c 100644
--- a/doc/classes/DynamicFont.xml
+++ b/doc/classes/DynamicFont.xml
@@ -73,6 +73,10 @@
<member name="font_data" type="DynamicFontData" setter="set_font_data" getter="get_font_data">
The font data.
</member>
+ <member name="outline_color" type="Color" setter="set_outline_color" getter="get_outline_color">
+ </member>
+ <member name="outline_size" type="int" setter="set_outline_size" getter="get_outline_size">
+ </member>
<member name="size" type="int" setter="set_size" getter="get_size">
The font size.
</member>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index 846d6f18ff..e8e2c4fd74 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -114,7 +114,7 @@
<argument index="3" name="ud" type="Variant" default="null">
</argument>
<description>
- Adds a custom menu to 'Project > Tools' as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it.
+ Adds a custom menu to 'Project &gt; Tools' as [code]name[/code] that calls [code]callback[/code] on an instance of [code]handler[/code] with a parameter [code]ud[/code] when user activates it.
</description>
</method>
<method name="add_tool_submenu_item">
@@ -368,7 +368,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
- Removes a menu [code]name[/code] from 'Project > Tools'.
+ Removes a menu [code]name[/code] from 'Project &gt; Tools'.
</description>
</method>
<method name="save_external_data" qualifiers="virtual">
@@ -424,6 +424,12 @@
Emitted when user change main screen view (2D, 3D, Script, AssetLib). Works also with screens which are defined by plugins.
</description>
</signal>
+ <signal name="resource_saved">
+ <argument index="0" name="resource" type="Object">
+ </argument>
+ <description>
+ </description>
+ </signal>
<signal name="scene_changed">
<argument index="0" name="scene_root" type="Object">
</argument>
diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml
index ea3c404346..cc2ae4e768 100644
--- a/doc/classes/Engine.xml
+++ b/doc/classes/Engine.xml
@@ -46,9 +46,9 @@
<description>
Returns the current engine version information in a Dictionary.
- "major" - Holds the major version number as a String
- "minor" - Holds the minor version number as a String
- "patch" - Holds the patch version number as a String
+ "major" - Holds the major version number as an int
+ "minor" - Holds the minor version number as an int
+ "patch" - Holds the patch version number as an int
"status" - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String
"build" - Holds the build name (e.g. "custom-build") as a String
"string" - major + minor + patch + status + build in a single String
@@ -77,6 +77,8 @@
<member name="iterations_per_second" type="int" setter="set_iterations_per_second" getter="get_iterations_per_second">
The number of fixed iterations per second (for fixed process and physics).
</member>
+ <member name="physics_jitter_fix" type="float" setter="set_physics_jitter_fix" getter="get_physics_jitter_fix">
+ </member>
<member name="target_fps" type="int" setter="set_target_fps" getter="get_target_fps">
The desired frames per second. If the hardware cannot keep up, this setting may not be respected. Defaults to 0, which indicates no limit.
</member>
diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml
index 376d234ec3..3e47b167ef 100644
--- a/doc/classes/Font.xml
+++ b/doc/classes/Font.xml
@@ -24,6 +24,8 @@
</argument>
<argument index="4" name="clip_w" type="int" default="-1">
</argument>
+ <argument index="5" name="outline_modulate" type="Color" default="Color( 1, 1, 1, 1 )">
+ </argument>
<description>
Draw "string" into a canvas item using the font at a given position, with "modulate" color, and optionally clipping the width. "position" specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis.
</description>
@@ -41,6 +43,8 @@
</argument>
<argument index="4" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )">
</argument>
+ <argument index="5" name="outline" type="bool" default="false">
+ </argument>
<description>
Draw character "char" into a canvas item using the font at a given position, with "modulate" color, and optionally kerning if "next" is passed. clipping the width. "position" specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character.
</description>
@@ -75,6 +79,12 @@
Return the size of a string, taking kerning and advance into account.
</description>
</method>
+ <method name="has_outline" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_distance_field_hint" qualifiers="const">
<return type="bool">
</return>
diff --git a/doc/classes/Generic6DOFJoint.xml b/doc/classes/Generic6DOFJoint.xml
index 2aec6d7f4e..0863ead4ec 100644
--- a/doc/classes/Generic6DOFJoint.xml
+++ b/doc/classes/Generic6DOFJoint.xml
@@ -167,6 +167,33 @@
<member name="linear_limit_z/upper_distance" type="float" setter="set_param_z" getter="get_param_z">
The maximum difference between the pivot points' z-axis.
</member>
+ <member name="linear_motor_x/enabled" type="bool" setter="set_flag_x" getter="get_flag_x">
+ If [code]true[/code] then there is a linear motor on the x-axis. It will attempt to reach the target velocity while staying within the force limits.
+ </member>
+ <member name="linear_motor_x/force_limit" type="float" setter="set_param_x" getter="get_param_x">
+ The maximum force the linear motor can apply on the x-axis while trying to reach the target velocity.
+ </member>
+ <member name="linear_motor_x/target_velocity" type="float" setter="set_param_x" getter="get_param_x">
+ The speed that the linear motor will attempt to reach on the x-axis.
+ </member>
+ <member name="linear_motor_y/enabled" type="bool" setter="set_flag_y" getter="get_flag_y">
+ If [code]true[/code] then there is a linear motor on the y-axis. It will attempt to reach the target velocity while staying within the force limits.
+ </member>
+ <member name="linear_motor_y/force_limit" type="float" setter="set_param_y" getter="get_param_y">
+ The maximum force the linear motor can apply on the y-axis while trying to reach the target velocity.
+ </member>
+ <member name="linear_motor_y/target_velocity" type="float" setter="set_param_y" getter="get_param_y">
+ The speed that the linear motor will attempt to reach on the y-axis.
+ </member>
+ <member name="linear_motor_z/enabled" type="bool" setter="set_flag_z" getter="get_flag_z">
+ If [code]true[/code] then there is a linear motor on the z-axis. It will attempt to reach the target velocity while staying within the force limits.
+ </member>
+ <member name="linear_motor_z/force_limit" type="float" setter="set_param_z" getter="get_param_z">
+ The maximum force the linear motor can apply on the z-axis while trying to reach the target velocity.
+ </member>
+ <member name="linear_motor_z/target_velocity" type="float" setter="set_param_z" getter="get_param_z">
+ The speed that the linear motor will attempt to reach on the z-axis.
+ </member>
</members>
<constants>
<constant name="PARAM_LINEAR_LOWER_LIMIT" value="0" enum="Param">
@@ -184,34 +211,40 @@
<constant name="PARAM_LINEAR_DAMPING" value="4" enum="Param">
The amount of damping that happens at the linear motion across the axes.
</constant>
- <constant name="PARAM_ANGULAR_LOWER_LIMIT" value="5" enum="Param">
+ <constant name="PARAM_LINEAR_MOTOR_TARGET_VELOCITY" value="5" enum="Param">
+ The velocity the linear motor will try to reach.
+ </constant>
+ <constant name="PARAM_LINEAR_MOTOR_FORCE_LIMIT" value="6" enum="Param">
+ The maximum force the linear motor will apply while trying to reach the velocity target.
+ </constant>
+ <constant name="PARAM_ANGULAR_LOWER_LIMIT" value="7" enum="Param">
The minimum rotation in negative direction to break loose and rotate around the axes.
</constant>
- <constant name="PARAM_ANGULAR_UPPER_LIMIT" value="6" enum="Param">
+ <constant name="PARAM_ANGULAR_UPPER_LIMIT" value="8" enum="Param">
The minimum rotation in positive direction to break loose and rotate around the axes.
</constant>
- <constant name="PARAM_ANGULAR_LIMIT_SOFTNESS" value="7" enum="Param">
+ <constant name="PARAM_ANGULAR_LIMIT_SOFTNESS" value="9" enum="Param">
The speed of all rotations across the axes.
</constant>
- <constant name="PARAM_ANGULAR_DAMPING" value="8" enum="Param">
+ <constant name="PARAM_ANGULAR_DAMPING" value="10" enum="Param">
The amount of rotational damping across the axes. The lower, the more dampening occurs.
</constant>
- <constant name="PARAM_ANGULAR_RESTITUTION" value="9" enum="Param">
+ <constant name="PARAM_ANGULAR_RESTITUTION" value="11" enum="Param">
The amount of rotational restitution across the axes. The lower, the more restitution occurs.
</constant>
- <constant name="PARAM_ANGULAR_FORCE_LIMIT" value="10" enum="Param">
+ <constant name="PARAM_ANGULAR_FORCE_LIMIT" value="12" enum="Param">
The maximum amount of force that can occur, when rotating around the axes.
</constant>
- <constant name="PARAM_ANGULAR_ERP" value="11" enum="Param">
+ <constant name="PARAM_ANGULAR_ERP" value="13" enum="Param">
When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
</constant>
- <constant name="PARAM_ANGULAR_MOTOR_TARGET_VELOCITY" value="12" enum="Param">
+ <constant name="PARAM_ANGULAR_MOTOR_TARGET_VELOCITY" value="14" enum="Param">
Target speed for the motor at the axes.
</constant>
- <constant name="PARAM_ANGULAR_MOTOR_FORCE_LIMIT" value="13" enum="Param">
+ <constant name="PARAM_ANGULAR_MOTOR_FORCE_LIMIT" value="15" enum="Param">
Maximum acceleration for the motor at the axes.
</constant>
- <constant name="PARAM_MAX" value="14" enum="Param">
+ <constant name="PARAM_MAX" value="16" enum="Param">
End flag of PARAM_* constants, used internally.
</constant>
<constant name="FLAG_ENABLE_LINEAR_LIMIT" value="0" enum="Flag">
@@ -223,7 +256,9 @@
<constant name="FLAG_ENABLE_MOTOR" value="2" enum="Flag">
If [code]set[/code] there is a rotational motor across these axes.
</constant>
- <constant name="FLAG_MAX" value="3" enum="Flag">
+ <constant name="FLAG_ENABLE_LINEAR_MOTOR" value="3" enum="Flag">
+ </constant>
+ <constant name="FLAG_MAX" value="4" enum="Flag">
End flag of FLAG_* constants, used internally.
</constant>
</constants>
diff --git a/doc/classes/Geometry.xml b/doc/classes/Geometry.xml
index 7b25f87b19..ea2e2f7595 100644
--- a/doc/classes/Geometry.xml
+++ b/doc/classes/Geometry.xml
@@ -160,6 +160,21 @@
<description>
</description>
</method>
+ <method name="line_intersects_line_2d">
+ <return type="Variant">
+ </return>
+ <argument index="0" name="from_a" type="Vector2">
+ </argument>
+ <argument index="1" name="dir_a" type="Vector2">
+ </argument>
+ <argument index="2" name="from_b" type="Vector2">
+ </argument>
+ <argument index="3" name="dir_b" type="Vector2">
+ </argument>
+ <description>
+ Checks if the two lines ([code]from_a[/code], [code]dir_a[/code]) and ([code]from_b[/code], [code]dir_b[/code]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns an empty [Variant]. Note that the lines are specified using direction vectors, not end points.
+ </description>
+ </method>
<method name="make_atlas">
<return type="Dictionary">
</return>
diff --git a/doc/classes/GridContainer.xml b/doc/classes/GridContainer.xml
index 346ab9d357..8a8a9a2d24 100644
--- a/doc/classes/GridContainer.xml
+++ b/doc/classes/GridContainer.xml
@@ -11,6 +11,16 @@
<demos>
</demos>
<methods>
+ <method name="get_child_control_at_cell">
+ <return type="Control">
+ </return>
+ <argument index="0" name="row" type="int">
+ </argument>
+ <argument index="1" name="column" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="columns" type="int" setter="set_columns" getter="get_columns">
diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml
index ea61aced83..ca2d519e8a 100644
--- a/doc/classes/Image.xml
+++ b/doc/classes/Image.xml
@@ -210,6 +210,8 @@
<method name="generate_mipmaps">
<return type="int" enum="Error">
</return>
+ <argument index="0" name="renormalize" type="bool" default="false">
+ </argument>
<description>
Generates mipmaps for the image. Mipmaps are pre-calculated and lower resolution copies of the image. Mipmaps are automatically used if the image needs to be scaled down when rendered. This improves image quality and the performance of the rendering. Returns an error if the image is compressed, in a custom format or if the image's width/height is 0.
</description>
@@ -255,6 +257,14 @@
Returns the color of the pixel at [code](x, y)[/code] if the image is locked. If the image is unlocked it always returns a [Color] with the value [code](0, 0, 0, 1.0)[/code].
</description>
</method>
+ <method name="get_pixelv" qualifiers="const">
+ <return type="Color">
+ </return>
+ <argument index="0" name="src" type="Vector2">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_rect" qualifiers="const">
<return type="Image">
</return>
@@ -411,6 +421,16 @@
[/codeblock]
</description>
</method>
+ <method name="set_pixelv">
+ <return type="void">
+ </return>
+ <argument index="0" name="dst" type="Vector2">
+ </argument>
+ <argument index="1" name="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="shrink_x2">
<return type="void">
</return>
diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml
index f537908625..f92f8da5dd 100644
--- a/doc/classes/Input.xml
+++ b/doc/classes/Input.xml
@@ -48,6 +48,14 @@
If the device has an accelerometer, this will return the acceleration. Otherwise, it returns an empty [Vector3].
</description>
</method>
+ <method name="get_action_strength" qualifiers="const">
+ <return type="float">
+ </return>
+ <argument index="0" name="action" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_connected_joypads">
<return type="Array">
</return>
@@ -284,7 +292,15 @@
<argument index="2" name="hotspot" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
- Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. See enum [code]CURSOR_*[/code] for the list of shapes.
+ Set a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing [code]null[/code] to the image parameter resets to the system cursor. See enum [code]CURSOR_*[/code] for the list of shapes.
+ </description>
+ </method>
+ <method name="set_default_cursor_shape">
+ <return type="void">
+ </return>
+ <argument index="0" name="shape" type="int" enum="Input.CursorShape" default="0">
+ </argument>
+ <description>
</description>
</method>
<method name="set_mouse_mode">
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index b30b144614..cbed2285df 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -13,20 +13,19 @@
<demos>
</demos>
<methods>
- <method name="action_match" qualifiers="const">
- <return type="bool">
+ <method name="as_text" qualifiers="const">
+ <return type="String">
</return>
- <argument index="0" name="event" type="InputEvent">
- </argument>
<description>
- Returns [code]true[/code] if this event matches [code]event[/code].
+ Returns a [String] representation of the event.
</description>
</method>
- <method name="as_text" qualifiers="const">
- <return type="String">
+ <method name="get_action_strength" qualifiers="const">
+ <return type="float">
</return>
+ <argument index="0" name="action" type="String">
+ </argument>
<description>
- Returns a [String] representation of the event.
</description>
</method>
<method name="is_action" qualifiers="const">
diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml
index eeb225d445..3399a3f096 100644
--- a/doc/classes/InputMap.xml
+++ b/doc/classes/InputMap.xml
@@ -34,6 +34,14 @@
Removes an [InputEvent] from an action.
</description>
</method>
+ <method name="action_erase_events">
+ <return type="void">
+ </return>
+ <argument index="0" name="action" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="action_has_event">
<return type="bool">
</return>
@@ -45,13 +53,26 @@
Returns [true] if an action has an [InputEvent] associated with it.
</description>
</method>
+ <method name="action_set_deadzone">
+ <return type="void">
+ </return>
+ <argument index="0" name="deadzone" type="String">
+ </argument>
+ <argument index="1" name="arg1" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="add_action">
<return type="void">
</return>
<argument index="0" name="action" type="String">
</argument>
+ <argument index="1" name="deadzone" type="float" default="0.5">
+ </argument>
<description>
- Adds an (empty) action to the [code]InputMap[/code]. An [InputEvent] can then be added to this action with [method action_add_event].
+ Adds an (empty) action to the [code]InputMap[/code], with a configurable [code]deadzone[/code].
+ An [InputEvent] can then be added to this action with [method action_add_event].
</description>
</method>
<method name="erase_action">
diff --git a/doc/classes/InstancePlaceholder.xml b/doc/classes/InstancePlaceholder.xml
index 5945e1068f..71c859fd9e 100644
--- a/doc/classes/InstancePlaceholder.xml
+++ b/doc/classes/InstancePlaceholder.xml
@@ -12,6 +12,16 @@
<demos>
</demos>
<methods>
+ <method name="create_instance">
+ <return type="Node">
+ </return>
+ <argument index="0" name="replace" type="bool" default="false">
+ </argument>
+ <argument index="1" name="custom_scene" type="PackedScene" default="null">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="get_instance_path" qualifiers="const">
<return type="String">
</return>
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 24c28fc810..1e78a196b1 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -106,6 +106,8 @@
</theme_item>
<theme_item name="font_color_shadow" type="Color">
</theme_item>
+ <theme_item name="font_outline_modulate" type="Color">
+ </theme_item>
<theme_item name="line_spacing" type="int">
</theme_item>
<theme_item name="normal" type="StyleBox">
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index c31438283e..d7a0385bb3 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -112,7 +112,7 @@
<member name="secret" type="bool" setter="set_secret" getter="is_secret">
If [code]true[/code], every character is replaced with the secret character (see [member secret_character]).
</member>
- <member name="secret_character" type="string" setter="set_secret_character" getter="get_secret_character">
+ <member name="secret_character" type="String" setter="set_secret_character" getter="get_secret_character">
The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character.
</member>
<member name="text" type="String" setter="set_text" getter="get_text">
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 591d715174..f6950d0fbc 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -1,88 +1,79 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="MultiplayerAPI" inherits="Reference" category="Core" version="3.1">
<brief_description>
+ High Level Multiplayer API.
</brief_description>
<description>
+ This class implements most of the logic behind the high level multiplayer API.
+ By default, [SceneTree] has a reference to this class that is used to provide multiplayer capabilities (i.e. RPC/RSET) across the whole scene.
+ It is possible to override the MultiplayerAPI instance used by specific Nodes by setting the [member Node.custom_multiplayer] property, effectively allowing to run both client and server in the same scene.
</description>
<tutorials>
</tutorials>
<demos>
</demos>
<methods>
- <method name="add_peer">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="clear">
<return type="void">
</return>
<description>
- </description>
- </method>
- <method name="connected_to_server">
- <return type="void">
- </return>
- <description>
- </description>
- </method>
- <method name="connection_failed">
- <return type="void">
- </return>
- <description>
- </description>
- </method>
- <method name="del_peer">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
+ Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing).
</description>
</method>
<method name="get_network_connected_peers" qualifiers="const">
<return type="PoolIntArray">
</return>
<description>
+ Returns the peer IDs of all connected peers of this MultiplayerAPI's [member network_peer].
</description>
</method>
<method name="get_network_unique_id" qualifiers="const">
<return type="int">
</return>
<description>
+ Returns the unique peer ID of this MultiplayerAPI's [member network_peer].
</description>
</method>
<method name="get_rpc_sender_id" qualifiers="const">
<return type="int">
</return>
<description>
+ Returns the sender's peer ID for the RPC currently being executed.
+ NOTE: If not inside an RPC this method will return 0.
</description>
</method>
<method name="has_network_peer" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if there is a [member network_peer] set.
</description>
</method>
<method name="is_network_server" qualifiers="const">
<return type="bool">
</return>
<description>
+ Returns [code]true[/code] if this MultiplayerAPI's [member network_peer] is in server mode (listening for connections).
</description>
</method>
<method name="poll">
<return type="void">
</return>
<description>
+ Method used for polling the MultiplayerAPI.
+ You only need to worry about this if you are using [member Node.custom_multplayer] override.
+ SceneTree will poll the default MultiplayerAPI for you.
</description>
</method>
- <method name="server_disconnected">
- <return type="void">
+ <method name="send_bytes">
+ <return type="int" enum="Error">
</return>
+ <argument index="0" name="bytes" type="PoolByteArray">
+ </argument>
+ <argument index="1" name="id" type="int" default="0">
+ </argument>
<description>
+ Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method NetworkedMultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
</description>
</method>
<method name="set_root_node">
@@ -91,38 +82,56 @@
<argument index="0" name="node" type="Node">
</argument>
<description>
+ Sets the base root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
+ This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
</description>
</method>
</methods>
<members>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
+ The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_network_server]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals.
</member>
<member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections">
+ If [code]true[/code] the MultiplayerAPI's [member network_peer] refuses new incoming connections.
</member>
</members>
<signals>
<signal name="connected_to_server">
<description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] successfully connected to a server. Only emitted on clients.
</description>
</signal>
<signal name="connection_failed">
<description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients.
</description>
</signal>
<signal name="network_peer_connected">
<argument index="0" name="id" type="int">
</argument>
<description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1).
</description>
</signal>
<signal name="network_peer_disconnected">
<argument index="0" name="id" type="int">
</argument>
<description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server.
+ </description>
+ </signal>
+ <signal name="network_peer_packet">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="packet" type="PoolByteArray">
+ </argument>
+ <description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet.
</description>
</signal>
<signal name="server_disconnected">
<description>
+ Emitted whenever this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients.
</description>
</signal>
</signals>
diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml
index 71614c5f76..2780334384 100644
--- a/doc/classes/NetworkedMultiplayerPeer.xml
+++ b/doc/classes/NetworkedMultiplayerPeer.xml
@@ -46,7 +46,8 @@
<argument index="0" name="id" type="int">
</argument>
<description>
- The peer to which packets will be sent. Default value: [code]0[/code].
+ Sets the peer to which packets will be sent.
+ The [code]id[/code] can be one of: [code]TARGET_PEER_BROADCAST[/code] to send to all connected peers, [code]TARGET_PEER_SERVER[/code] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. Default: [code]TARGET_PEER_BROADCAST[/code]
</description>
</method>
</methods>
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 5d0f70bc59..05ac6b1c0e 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -586,7 +586,7 @@
<argument index="1" name="method" type="String">
</argument>
<description>
- Sends a [method rpc] to a specific peer identified by [code]peer_id[/code]. Returns an empty [Variant].
+ Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] (see [method NetworkedMultiplayerPeer.set_target_peer]). Returns an empty [Variant].
</description>
</method>
<method name="rpc_unreliable" qualifiers="vararg">
@@ -606,7 +606,7 @@
<argument index="1" name="method" type="String">
</argument>
<description>
- Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] using an unreliable protocol. Returns an empty [Variant].
+ Sends a [method rpc] to a specific peer identified by [code]peer_id[/code] using an unreliable protocol (see [method NetworkedMultiplayerPeer.set_target_peer]). Returns an empty [Variant].
</description>
</method>
<method name="rset">
@@ -641,7 +641,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Remotely changes the property's value on a specific peer identified by [code]peer_id[/code].
+ Remotely changes the property's value on a specific peer identified by [code]peer_id[/code] (see [method NetworkedMultiplayerPeer.set_target_peer]).
</description>
</method>
<method name="rset_unreliable">
@@ -665,7 +665,7 @@
<argument index="2" name="value" type="Variant">
</argument>
<description>
- Remotely changes property's value on a specific peer identified by [code]peer_id[/code] using an unreliable protocol.
+ Remotely changes property's value on a specific peer identified by [code]peer_id[/code] using an unreliable protocol (see [method NetworkedMultiplayerPeer.set_target_peer]).
</description>
</method>
<method name="set_display_folded">
@@ -703,7 +703,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method]_physics_process[/code] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
+ Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
</description>
</method>
<method name="set_process">
@@ -730,7 +730,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method]_process[/code] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
+ Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). Only useful for advanced uses to manipulate built-in nodes behaviour.
</description>
</method>
<method name="set_process_unhandled_input">
@@ -762,12 +762,14 @@
</method>
</methods>
<members>
- <member name="custom_multiplayer_api" type="MultiplayerAPI" setter="set_custom_multiplayer_api" getter="get_custom_multiplayer_api">
+ <member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer">
+ The override to the default [MultiplayerAPI]. Set to null to use the default SceneTree one.
</member>
<member name="filename" type="String" setter="set_filename" getter="get_filename">
When a scene is instanced from a file, its topmost node contains the filename from which it was loaded.
</member>
- <member name="multiplayer_api" type="MultiplayerAPI" setter="" getter="get_multiplayer_api">
+ <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer">
+ The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree).
</member>
<member name="name" type="String" setter="set_name" getter="get_name">
The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed
@@ -780,6 +782,11 @@
</member>
</members>
<signals>
+ <signal name="ready">
+ <description>
+ Emitted when the node is ready.
+ </description>
+ </signal>
<signal name="renamed">
<description>
Emitted when the node is renamed.
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index d38a89874c..e4375cfb79 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -430,6 +430,12 @@
Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or it is currently hidden.
</description>
</method>
+ <method name="get_window_safe_area" qualifiers="const">
+ <return type="Rect2">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="has_environment" qualifiers="const">
<return type="bool">
</return>
@@ -698,7 +704,7 @@
<member name="low_processor_usage_mode" type="bool" setter="set_low_processor_usage_mode" getter="is_in_low_processor_usage_mode">
If [code]true[/code] the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile.
</member>
- <member name="screen_orientation" type="int" setter="set_screen_orientation" getter="get_screen_orientation" enum="OS.ScreenOrientation">
+ <member name="screen_orientation" type="int" setter="set_screen_orientation" getter="get_screen_orientation" enum="_OS.ScreenOrientation">
The current screen orientation.
</member>
<member name="vsync_enabled" type="bool" setter="set_use_vsync" getter="is_vsync_enabled">
@@ -716,6 +722,8 @@
<member name="window_minimized" type="bool" setter="set_window_minimized" getter="is_window_minimized">
If [code]true[/code] the window is minimized.
</member>
+ <member name="window_per_pixel_transparency_enabled" type="bool" setter="set_window_per_pixel_transparency_enabled" getter="get_window_per_pixel_transparency_enabled">
+ </member>
<member name="window_position" type="Vector2" setter="set_window_position" getter="get_window_position">
The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right.
</member>
diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml
index 8cb53dd98e..c58c932b61 100644
--- a/doc/classes/OptionButton.xml
+++ b/doc/classes/OptionButton.xml
@@ -18,7 +18,7 @@
</argument>
<argument index="1" name="label" type="String">
</argument>
- <argument index="2" name="id" type="int">
+ <argument index="2" name="id" type="int" default="-1">
</argument>
<description>
Add an item, with a "texture" icon, text "label" and (optionally) id. If no "id" is passed, "id" becomes the item index. New items are appended at the end.
diff --git a/doc/classes/PacketPeerUDP.xml b/doc/classes/PacketPeerUDP.xml
index 1b821e06cf..d4e3d17de6 100644
--- a/doc/classes/PacketPeerUDP.xml
+++ b/doc/classes/PacketPeerUDP.xml
@@ -22,14 +22,14 @@
<return type="String">
</return>
<description>
- Return the IP of the remote peer that sent the last packet(that was received with [method get_packet] or [method get_var]).
+ Return the IP of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]).
</description>
</method>
<method name="get_packet_port" qualifiers="const">
<return type="int">
</return>
<description>
- Return the port of the remote peer that sent the last packet(that was received with [method get_packet] or [method get_var]).
+ Return the port of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]).
</description>
</method>
<method name="is_listening" qualifiers="const">
diff --git a/doc/classes/PanoramaSky.xml b/doc/classes/PanoramaSky.xml
index eb288d13be..402e65c573 100644
--- a/doc/classes/PanoramaSky.xml
+++ b/doc/classes/PanoramaSky.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="PanoramaSky" inherits="Sky" category="Core" version="3.1">
<brief_description>
+ A type of [Sky] used to draw a background texture.
</brief_description>
<description>
+ A resource referenced in an [Environment] that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines except it uses a equirectangular sky map instead of a cube map.
</description>
<tutorials>
</tutorials>
@@ -12,6 +14,7 @@
</methods>
<members>
<member name="panorama" type="Texture" setter="set_panorama" getter="get_panorama">
+ [Texture] to be applied to the PanoramaSky.
</member>
</members>
<constants>
diff --git a/doc/classes/Path.xml b/doc/classes/Path.xml
index 621a513da3..5ece747aaf 100644
--- a/doc/classes/Path.xml
+++ b/doc/classes/Path.xml
@@ -16,6 +16,12 @@
<member name="curve" type="Curve3D" setter="set_curve" getter="get_curve">
</member>
</members>
+ <signals>
+ <signal name="curve_changed">
+ <description>
+ </description>
+ </signal>
+ </signals>
<constants>
</constants>
</class>
diff --git a/doc/classes/PhysicalBone.xml b/doc/classes/PhysicalBone.xml
new file mode 100644
index 0000000000..80b3c11270
--- /dev/null
+++ b/doc/classes/PhysicalBone.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="PhysicalBone" inherits="PhysicsBody" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="is_simulating_physics">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="body_offset" type="Transform" setter="set_body_offset" getter="get_body_offset">
+ </member>
+ <member name="bounce" type="float" setter="set_bounce" getter="get_bounce">
+ </member>
+ <member name="friction" type="float" setter="set_friction" getter="get_friction">
+ </member>
+ <member name="gravity_scale" type="float" setter="set_gravity_scale" getter="get_gravity_scale">
+ </member>
+ <member name="joint_offset" type="Transform" setter="set_joint_offset" getter="get_joint_offset">
+ </member>
+ <member name="joint_type" type="int" setter="set_joint_type" getter="get_joint_type" enum="PhysicalBone.JointType">
+ </member>
+ <member name="mass" type="float" setter="set_mass" getter="get_mass">
+ </member>
+ <member name="simulate_physics" type="bool" setter="set_simulate_physics" getter="get_simulate_physics">
+ </member>
+ <member name="static_body" type="bool" setter="set_static_body" getter="is_static_body">
+ </member>
+ <member name="weight" type="float" setter="set_weight" getter="get_weight">
+ </member>
+ </members>
+ <constants>
+ <constant name="JOINT_TYPE_NONE" value="0" enum="JointType">
+ </constant>
+ <constant name="JOINT_TYPE_PIN" value="1" enum="JointType">
+ </constant>
+ <constant name="JOINT_TYPE_CONE" value="2" enum="JointType">
+ </constant>
+ <constant name="JOINT_TYPE_HINGE" value="3" enum="JointType">
+ </constant>
+ <constant name="JOINT_TYPE_SLIDER" value="4" enum="JointType">
+ </constant>
+ <constant name="JOINT_TYPE_6DOF" value="5" enum="JointType">
+ </constant>
+ </constants>
+</class>
diff --git a/doc/classes/Physics2DServer.xml b/doc/classes/Physics2DServer.xml
index 98535dd330..1098b0d6b1 100644
--- a/doc/classes/Physics2DServer.xml
+++ b/doc/classes/Physics2DServer.xml
@@ -688,7 +688,7 @@
<argument index="1" name="space" type="RID">
</argument>
<description>
- Assigns a space to the body (see [method create_space]).
+ Assigns a space to the body (see [method space_create]).
</description>
</method>
<method name="body_set_state">
diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml
index 6c3a435360..dd2c322ee3 100644
--- a/doc/classes/PhysicsServer.xml
+++ b/doc/classes/PhysicsServer.xml
@@ -1331,31 +1331,37 @@
<constant name="G6DOF_JOINT_LINEAR_DAMPING" value="4" enum="G6DOFJointAxisParam">
The amount of damping that happens at the linear motion across the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_LOWER_LIMIT" value="5" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY" value="5" enum="G6DOFJointAxisParam">
+ The velocity that the joint's linear motor will attempt to reach.
+ </constant>
+ <constant name="G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT" value="6" enum="G6DOFJointAxisParam">
+ The maximum force that the linear motor can apply while trying to reach the target velocity.
+ </constant>
+ <constant name="G6DOF_JOINT_ANGULAR_LOWER_LIMIT" value="7" enum="G6DOFJointAxisParam">
The minimum rotation in negative direction to break loose and rotate around the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_UPPER_LIMIT" value="6" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_UPPER_LIMIT" value="8" enum="G6DOFJointAxisParam">
The minimum rotation in positive direction to break loose and rotate around the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS" value="7" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS" value="9" enum="G6DOFJointAxisParam">
A factor that gets multiplied onto all rotations across the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_DAMPING" value="8" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_DAMPING" value="10" enum="G6DOFJointAxisParam">
The amount of rotational damping across the axes. The lower, the more dampening occurs.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_RESTITUTION" value="9" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_RESTITUTION" value="11" enum="G6DOFJointAxisParam">
The amount of rotational restitution across the axes. The lower, the more restitution occurs.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_FORCE_LIMIT" value="10" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_FORCE_LIMIT" value="12" enum="G6DOFJointAxisParam">
The maximum amount of force that can occur, when rotating around the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_ERP" value="11" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_ERP" value="13" enum="G6DOFJointAxisParam">
When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY" value="12" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY" value="14" enum="G6DOFJointAxisParam">
Target speed for the motor at the axes.
</constant>
- <constant name="G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT" value="13" enum="G6DOFJointAxisParam">
+ <constant name="G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT" value="15" enum="G6DOFJointAxisParam">
Maximum acceleration for the motor at the axes.
</constant>
<constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT" value="0" enum="G6DOFJointAxisFlag">
@@ -1367,6 +1373,9 @@
<constant name="G6DOF_JOINT_FLAG_ENABLE_MOTOR" value="2" enum="G6DOFJointAxisFlag">
If [code]set[/code] there is a rotational motor across these axes.
</constant>
+ <constant name="G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR" value="3" enum="G6DOFJointAxisFlag">
+ If [code]set[/code] there is a linear motor on this axis that targets a specific velocity.
+ </constant>
<constant name="SHAPE_PLANE" value="0" enum="ShapeType">
The [Shape] is a [PlaneShape].
</constant>
diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml
index 429114a128..bf4519fd0a 100644
--- a/doc/classes/Polygon2D.xml
+++ b/doc/classes/Polygon2D.xml
@@ -11,11 +11,79 @@
<demos>
</demos>
<methods>
+ <method name="add_bone">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="NodePath">
+ </argument>
+ <argument index="1" name="weights" type="PoolRealArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="clear_bones">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="erase_bone">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bone_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bone_path" qualifiers="const">
+ <return type="NodePath">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bone_weights" qualifiers="const">
+ <return type="PoolRealArray">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bone_path">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="path" type="NodePath">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_bone_weights">
+ <return type="void">
+ </return>
+ <argument index="0" name="index" type="int">
+ </argument>
+ <argument index="1" name="weights" type="PoolRealArray">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<members>
<member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased">
If [code]true[/code] polygon edges will be anti-aliased. Default value: [code]false[/code].
</member>
+ <member name="bones" type="Array" setter="_set_bones" getter="_get_bones">
+ </member>
<member name="color" type="Color" setter="set_color" getter="get_color">
The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code].
</member>
@@ -31,6 +99,8 @@
<member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon">
The polygon's list of vertices. The final point will be connected to the first.
</member>
+ <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton">
+ </member>
<member name="splits" type="PoolIntArray" setter="set_splits" getter="get_splits">
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml
index db8d927c9e..ae5bce5d7d 100644
--- a/doc/classes/Popup.xml
+++ b/doc/classes/Popup.xml
@@ -50,7 +50,7 @@
</methods>
<members>
<member name="popup_exclusive" type="bool" setter="set_exclusive" getter="is_exclusive">
- If [code]true[/code] the popup will not be hidden when a click event occurs outside of it, or when it receives the [code]ui_cancel[/code] action event.
+ If [code]true[/code] the popup will not be hidden when a click event occurs outside of it, or when it receives the [code]ui_cancel[/code] action event.
</member>
</members>
<signals>
diff --git a/doc/classes/PrimitiveMesh.xml b/doc/classes/PrimitiveMesh.xml
index c5bc3d6e47..0f0511258b 100644
--- a/doc/classes/PrimitiveMesh.xml
+++ b/doc/classes/PrimitiveMesh.xml
@@ -19,6 +19,10 @@
</method>
</methods>
<members>
+ <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb">
+ </member>
+ <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces">
+ </member>
<member name="material" type="Material" setter="set_material" getter="get_material">
The current [Material] of the primitive mesh.
</member>
diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml
index 49bb1aed45..4ec4bbee4f 100644
--- a/doc/classes/RichTextLabel.xml
+++ b/doc/classes/RichTextLabel.xml
@@ -47,6 +47,13 @@
Clears the tag stack and sets [member bbcode_text] to an empty string.
</description>
</method>
+ <method name="get_content_height">
+ <return type="int">
+ </return>
+ <description>
+ Returns the height of the content.
+ </description>
+ </method>
<method name="get_line_count" qualifiers="const">
<return type="int">
</return>
@@ -319,6 +326,8 @@
</theme_item>
<theme_item name="font_color_selected" type="Color">
</theme_item>
+ <theme_item name="font_color_shadow" type="Color">
+ </theme_item>
<theme_item name="italics_font" type="Font">
</theme_item>
<theme_item name="line_separation" type="int">
@@ -331,6 +340,12 @@
</theme_item>
<theme_item name="selection_color" type="Color">
</theme_item>
+ <theme_item name="shadow_as_outline" type="int">
+ </theme_item>
+ <theme_item name="shadow_offset_x" type="int">
+ </theme_item>
+ <theme_item name="shadow_offset_y" type="int">
+ </theme_item>
<theme_item name="table_hseparation" type="int">
</theme_item>
<theme_item name="table_vseparation" type="int">
diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml
index dec0cbbcc3..55063bbe24 100644
--- a/doc/classes/SceneTree.xml
+++ b/doc/classes/SceneTree.xml
@@ -266,7 +266,8 @@
<member name="edited_scene_root" type="Node" setter="set_edited_scene_root" getter="get_edited_scene_root">
The root of the edited scene.
</member>
- <member name="multiplayer_api" type="MultiplayerAPI" setter="set_multiplayer_api" getter="get_multiplayer_api">
+ <member name="multiplayer" type="MultiplayerAPI" setter="set_multiplayer" getter="get_multiplayer">
+ The default [MultiplayerAPI] instance for this SceneTree.
</member>
<member name="network_peer" type="NetworkedMultiplayerPeer" setter="set_network_peer" getter="get_network_peer">
The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the SceneTree will become a network server (check with [method is_network_server()]) and will set root node's network mode to master (see NETWORK_MODE_* constants in [Node]), or it will become a regular peer with root node set to slave. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to SceneTree's signals.
diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml
index 64b0fcfd83..f16b3920c2 100644
--- a/doc/classes/ScrollContainer.xml
+++ b/doc/classes/ScrollContainer.xml
@@ -22,7 +22,7 @@
If [code]true[/code], enables horizontal scrolling.
</member>
<member name="scroll_vertical" type="int" setter="set_v_scroll" getter="get_v_scroll">
- The current horizontal scroll value.
+ The current vertical scroll value.
</member>
<member name="scroll_vertical_enabled" type="bool" setter="set_enable_v_scroll" getter="is_v_scroll_enabled">
If [code]true[/code], enables vertical scrolling.
diff --git a/doc/classes/Skeleton.xml b/doc/classes/Skeleton.xml
index 0208d56cfa..67e10e8f0a 100644
--- a/doc/classes/Skeleton.xml
+++ b/doc/classes/Skeleton.xml
@@ -131,6 +131,30 @@
<description>
</description>
</method>
+ <method name="physical_bones_add_collision_exception">
+ <return type="void">
+ </return>
+ <argument index="0" name="exception" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="physical_bones_remove_collision_exception">
+ <return type="void">
+ </return>
+ <argument index="0" name="exception" type="RID">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="physical_bones_simulation">
+ <return type="void">
+ </return>
+ <argument index="0" name="start" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_bone_custom_pose">
<return type="void">
</return>
diff --git a/doc/classes/Skeleton2D.xml b/doc/classes/Skeleton2D.xml
new file mode 100644
index 0000000000..654c816ba8
--- /dev/null
+++ b/doc/classes/Skeleton2D.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="Skeleton2D" inherits="Node2D" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="get_bone">
+ <return type="Bone2D">
+ </return>
+ <argument index="0" name="arg0" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bone_count" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_skeleton" qualifiers="const">
+ <return type="RID">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml
index ace1aa846e..5feaf70e9d 100644
--- a/doc/classes/SpatialMaterial.xml
+++ b/doc/classes/SpatialMaterial.xml
@@ -84,6 +84,8 @@
</member>
<member name="flags_albedo_tex_force_srgb" type="bool" setter="set_flag" getter="get_flag">
</member>
+ <member name="flags_do_not_receive_shadows" type="bool" setter="set_flag" getter="get_flag">
+ </member>
<member name="flags_fixed_size" type="bool" setter="set_flag" getter="get_flag">
</member>
<member name="flags_no_depth_test" type="bool" setter="set_flag" getter="get_flag">
@@ -316,7 +318,9 @@
</constant>
<constant name="FLAG_ALBEDO_TEXTURE_FORCE_SRGB" value="13" enum="Flags">
</constant>
- <constant name="FLAG_MAX" value="14" enum="Flags">
+ <constant name="FLAG_DONT_RECEIVE_SHADOWS" value="14" enum="Flags">
+ </constant>
+ <constant name="FLAG_MAX" value="15" enum="Flags">
</constant>
<constant name="DIFFUSE_BURLEY" value="0" enum="DiffuseMode">
</constant>
diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml
index ec67370c79..775fef4fb7 100644
--- a/doc/classes/TileMap.xml
+++ b/doc/classes/TileMap.xml
@@ -16,14 +16,14 @@
<return type="void">
</return>
<description>
- Clear all cells.
+ Clears all cells.
</description>
</method>
<method name="fix_invalid_tiles">
<return type="void">
</return>
<description>
- Clear cells that does not exist in the tileset.
+ Clears cells that do not exist in the tileset.
</description>
</method>
<method name="get_cell" qualifiers="const">
@@ -34,7 +34,7 @@
<argument index="1" name="y" type="int">
</argument>
<description>
- Return the tile index of the referenced cell.
+ Returns the tile index of the given cell.
</description>
</method>
<method name="get_cellv" qualifiers="const">
@@ -43,7 +43,7 @@
<argument index="0" name="position" type="Vector2">
</argument>
<description>
- Return the tile index of the cell referenced by a Vector2.
+ Returns the tile index of the cell given by a Vector2.
</description>
</method>
<method name="get_collision_layer_bit" qualifiers="const">
@@ -52,6 +52,7 @@
<argument index="0" name="bit" type="int">
</argument>
<description>
+ Returns [code]true[/code] if the given collision layer bit is set.
</description>
</method>
<method name="get_collision_mask_bit" qualifiers="const">
@@ -60,13 +61,14 @@
<argument index="0" name="bit" type="int">
</argument>
<description>
+ Returns [code]true[/code] if the given collision mask bit is set.
</description>
</method>
<method name="get_used_cells" qualifiers="const">
<return type="Array">
</return>
<description>
- Return an array of all cells containing a tile from the tileset (i.e. a tile index different from -1).
+ Returns an array of all cells containing a tile from the tileset (i.e. a tile index different from [code]-1[/code]).
</description>
</method>
<method name="get_used_cells_by_id" qualifiers="const">
@@ -75,12 +77,14 @@
<argument index="0" name="id" type="int">
</argument>
<description>
+ Returns an array of all cells with the given tile id.
</description>
</method>
<method name="get_used_rect">
<return type="Rect2">
</return>
<description>
+ Returns a rectangle enclosing the used (non-empty) tiles of the map.
</description>
</method>
<method name="is_cell_transposed" qualifiers="const">
@@ -91,7 +95,7 @@
<argument index="1" name="y" type="int">
</argument>
<description>
- Return whether the referenced cell is transposed, i.e. the X and Y axes are swapped (mirroring with regard to the (1,1) vector).
+ Returns [code]true[/code] if the given cell is transposed, i.e. the x and y axes are swapped.
</description>
</method>
<method name="is_cell_x_flipped" qualifiers="const">
@@ -102,7 +106,7 @@
<argument index="1" name="y" type="int">
</argument>
<description>
- Return whether the referenced cell is flipped over the X axis.
+ Returns [code]true[/code] if the given cell is flipped in the x axis.
</description>
</method>
<method name="is_cell_y_flipped" qualifiers="const">
@@ -113,7 +117,7 @@
<argument index="1" name="y" type="int">
</argument>
<description>
- Return whether the referenced cell is flipped over the Y axis.
+ Returns [code]true[/code] if the given cell is flipped in the y axis.
</description>
</method>
<method name="map_to_world" qualifiers="const">
@@ -124,8 +128,8 @@
<argument index="1" name="ignore_half_ofs" type="bool" default="false">
</argument>
<description>
- Return the absolute world position corresponding to the tilemap (grid-based) coordinates given as an argument.
- Optionally, the tilemap's potential half offset can be ignored.
+ Returns the global position corresponding to the given tilemap (grid-based) coordinates.
+ Optionally, the tilemap's half offset can be ignored.
</description>
</method>
<method name="set_cell">
@@ -146,9 +150,9 @@
<argument index="6" name="autotile_coord" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
- Set the tile index for the cell referenced by its grid-based X and Y coordinates.
- A tile index of -1 clears the cell.
- Optionally, the tile can also be flipped over the X and Y coordinates, transposed, or be given autotile coordinates.
+ Sets the tile index for the cell given by a Vector2.
+ An index of [code]-1[/code] clears the cell.
+ Optionally, the tile can also be flipped, transposed, or given autotile coordinates.
</description>
</method>
<method name="set_cellv">
@@ -165,9 +169,9 @@
<argument index="4" name="transpose" type="bool" default="false">
</argument>
<description>
- Set the tile index for the cell referenced by a Vector2 of grid-based coordinates.
- A tile index of -1 clears the cell.
- Optionally, the tile can also be flipped over the X and Y axes or transposed.
+ Sets the tile index for the given cell.
+ An index of [code]-1[/code] clears the cell.
+ Optionally, the tile can also be flipped or transposed.
</description>
</method>
<method name="set_collision_layer_bit">
@@ -178,7 +182,7 @@
<argument index="1" name="value" type="bool">
</argument>
<description>
- Set any collision layer to be [code]true[/code] or [code]false[/code].
+ Sets the given collision layer bit.
</description>
</method>
<method name="set_collision_mask_bit">
@@ -189,6 +193,7 @@
<argument index="1" name="value" type="bool">
</argument>
<description>
+ Sets the given collision mask bit.
</description>
</method>
<method name="update_bitmask_area">
@@ -197,7 +202,7 @@
<argument index="0" name="position" type="Vector2">
</argument>
<description>
- Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates.
+ Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based x and y coordinates.
</description>
</method>
<method name="update_bitmask_region">
@@ -208,8 +213,8 @@
<argument index="1" name="end" type="Vector2" default="Vector2( 0, 0 )">
</argument>
<description>
- Applies autotiling rules to the cells in the given region (specified by grid-based X and Y coordinates).
- Calling with invalid (or missing) parameters applies autotiling rules for the entire TileMap.
+ Applies autotiling rules to the cells in the given region (specified by grid-based x and y coordinates).
+ Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap.
</description>
</method>
<method name="world_to_map" qualifiers="const">
@@ -218,7 +223,7 @@
<argument index="0" name="world_position" type="Vector2">
</argument>
<description>
- Return the tilemap (grid-based) coordinates corresponding to the absolute world position given as an argument.
+ Returns the tilemap (grid-based) coordinatescorresponding to the given global position.
</description>
</method>
</methods>
diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml
index 4e218f5595..8f7969505e 100644
--- a/doc/classes/TileSet.xml
+++ b/doc/classes/TileSet.xml
@@ -262,6 +262,14 @@
<description>
</description>
</method>
+ <method name="tile_get_z_index" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="tile_set_light_occluder">
<return type="void">
</return>
@@ -428,6 +436,16 @@
<description>
</description>
</method>
+ <method name="tile_set_z_index">
+ <return type="void">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="z_index" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
</methods>
<constants>
<constant name="BITMASK_2X2" value="0" enum="BitmaskMode">
diff --git a/doc/classes/Timer.xml b/doc/classes/Timer.xml
index aba1b78188..d1c8722901 100644
--- a/doc/classes/Timer.xml
+++ b/doc/classes/Timer.xml
@@ -21,8 +21,10 @@
<method name="start">
<return type="void">
</return>
+ <argument index="0" name="time_sec" type="float" default="-1">
+ </argument>
<description>
- Starts the timer. This also resets the remaining time to [code]wait_time[/code].
+ Starts the timer. Sets [code]wait_time[/code] to [code]time_sec[/code] if [code]time_sec[/code] &gt; 0. This also resets the remaining time to [code]wait_time[/code].
Note: this method will not resume a paused timer. See [method set_paused].
</description>
</method>
diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml
index 54e445d3ee..2332c1a7aa 100644
--- a/doc/classes/Tween.xml
+++ b/doc/classes/Tween.xml
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Tween" inherits="Node" category="Core" version="3.1">
<brief_description>
- Node useful for animations with unknown start and end points.
+ Smoothly animates a node's properties over time.
</brief_description>
<description>
- Node useful for animations with unknown start and end points, procedural animations, making one node follow another, and other simple behavior.
- Because it is easy to get it wrong, here is a quick usage example:
+ Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name *tween* comes from *in-betweening*, an animation technique where you specify *keyframes* and the computer interpolates the frames that appear between them.
+ Here is a brief usage example that causes a 2D node to move smoothly between two positions:
[codeblock]
var tween = get_node("Tween")
- tween.interpolate_property(get_node("Node2D_to_move"), "transform/origin", Vector2(0,0), Vector2(100,100), 1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
+ tween.interpolate_property($Node2D, "position",
+ Vector2(0, 0), Vector2(100, 100), 1,
+ Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
tween.start()
[/codeblock]
- Some of the methods of this class require a property name. You can get the property name by hovering over the property in the inspector of the editor.
- Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an TRANS_* constant, and refers to the way the timing of the animation is handled (you might want to see [code]http://easings.net/[/code] for some examples). The second accepts an EASE_* constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different TRANS_* constants with EASE_IN_OUT, and use the one that looks best.
+ Many methods require a property name, such as "position" above. You can find the correct property name by hovering over the property in the Inspector.
+ Many of the methods accept [code]trans_type[/code] and [code]ease_type[/code]. The first accepts an [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [code]http://easings.net/[/code] for some examples). The second accepts an [enum EaseType] constant, and controls the where [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [enum EASE_IN_OUT], and use the one that looks best.
</description>
<tutorials>
</tutorials>
@@ -41,8 +43,8 @@
<argument index="8" name="delay" type="float" default="0">
</argument>
<description>
- Follow [code]method[/code] of [code]object[/code] and apply the returned value on [code]target_method[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]duration[/code] seconds, [code]delay[/code] later. Methods are animated by calling them with consequitive values.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Follows [code]method[/code] of [code]object[/code] and applies the returned value on [code]target_method[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]duration[/code] seconds, [code]delay[/code] later. Methods are called with consecutive values.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="follow_property">
@@ -67,15 +69,15 @@
<argument index="8" name="delay" type="float" default="0">
</argument>
<description>
- Follow [code]property[/code] of [code]object[/code] and apply it on [code]target_property[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later. Note that [code]target:target_property[/code] would equal [code]object:property[/code] at the end of the tween.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Follows [code]property[/code] of [code]object[/code] and applies it on [code]target_property[/code] of [code]target[/code], beginning from [code]initial_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="get_runtime" qualifiers="const">
<return type="float">
</return>
<description>
- Returns the time needed for all tweens to end in seconds, measured from the start. Thus, if you have two tweens, one ending 10 seconds after the start and the other - 20 seconds, it would return 20 seconds, as by that time all tweens would have finished.
+ Returns the total time needed for all tweens to end. If you have two tweens, one lasting 10 seconds and the other 20 seconds, it would return 20 seconds, as by that time all tweens would have finished.
</description>
</method>
<method name="interpolate_callback">
@@ -98,7 +100,7 @@
<argument index="7" name="arg5" type="Variant" default="null">
</argument>
<description>
- Call [code]callback[/code] of [code]object[/code] after [code]duration[/code]. [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
+ Calls [code]callback[/code] of [code]object[/code] after [code]duration[/code]. [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
</description>
</method>
<method name="interpolate_deferred_callback">
@@ -121,7 +123,7 @@
<argument index="7" name="arg5" type="Variant" default="null">
</argument>
<description>
- Call [code]callback[/code] of [code]object[/code] after [code]duration[/code] on the main thread (similar to [method Object.call_deferred]). [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
+ Calls [code]callback[/code] of [code]object[/code] after [code]duration[/code] on the main thread (similar to [method Object.call_deferred]). [code]arg1[/code]-[code]arg5[/code] are arguments to be passed to the callback.
</description>
</method>
<method name="interpolate_method">
@@ -144,8 +146,8 @@
<argument index="7" name="delay" type="float" default="0">
</argument>
<description>
- Animate [code]method[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later. Methods are animated by calling them with consecutive values.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Animates [code]method[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later. Methods are called with consecutive values.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="interpolate_property">
@@ -168,15 +170,15 @@
<argument index="7" name="delay" type="float" default="0">
</argument>
<description>
- Animate [code]property[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Animates [code]property[/code] of [code]object[/code] from [code]initial_val[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="is_active" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns true if any tweens are currently running, and false otherwise. Note that this method doesn't consider tweens that have ended.
+ Returns [code]true[/code] if any tweens are currently running. Note that this method doesn't consider tweens that have ended.
</description>
</method>
<method name="remove">
@@ -187,14 +189,14 @@
<argument index="1" name="key" type="String" default="&quot;&quot;">
</argument>
<description>
- Stop animating and completely remove a tween, given its object and property/method pair. Passing empty String as key will remove all tweens for given object.
+ Stops animation and removes a tween, given its object and property/method pair. By default, all tweens are removed, unless [code]key[/code] is specified.
</description>
</method>
<method name="remove_all">
<return type="bool">
</return>
<description>
- Stop animating and completely remove all tweens.
+ Stops animation and removes all tweens.
</description>
</method>
<method name="reset">
@@ -205,7 +207,7 @@
<argument index="1" name="key" type="String" default="&quot;&quot;">
</argument>
<description>
- Resets a tween to the initial value (the one given, not the one before the tween), given its object and property/method pair. Passing empty String as key will reset all tweens for given object.
+ Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are removed, unless [code]key[/code] is specified.
</description>
</method>
<method name="reset_all">
@@ -223,14 +225,14 @@
<argument index="1" name="key" type="String" default="&quot;&quot;">
</argument>
<description>
- Continue animating a stopped tween, given its object and property/method pair. Passing empty String as key will resume all tweens for given object.
+ Continues animating a stopped tween, given its object and property/method pair. By default, all tweens are resumed, unless [code]key[/code] is specified.
</description>
</method>
<method name="resume_all">
<return type="bool">
</return>
<description>
- Continue animating all stopped tweens.
+ Continues animating all stopped tweens.
</description>
</method>
<method name="seek">
@@ -239,7 +241,7 @@
<argument index="0" name="time" type="float">
</argument>
<description>
- Seek the animation to the given [code]time[/code] in seconds.
+ Sets the interpolation to the given [code]time[/code] in seconds.
</description>
</method>
<method name="set_active">
@@ -248,14 +250,14 @@
<argument index="0" name="active" type="bool">
</argument>
<description>
- Activate/deactivate the tween. You can use this for pausing animations, though [method stop_all] and [method resume_all] might be more fit for this.
+ Activates/deactivates the tween. See also [method stop_all] and [method resume_all].
</description>
</method>
<method name="start">
<return type="bool">
</return>
<description>
- Start the tween node. You can define tweens both before and after this.
+ Starts the tween. You can define animations both before and after this.
</description>
</method>
<method name="stop">
@@ -266,14 +268,14 @@
<argument index="1" name="key" type="String" default="&quot;&quot;">
</argument>
<description>
- Stop animating a tween, given its object and property/method pair. Passing empty String as key will stop all tweens for given object.
+ Stops a tween, given its object and property/method pair. By default, all tweens are stopped, unless [code]key[/code] is specified.
</description>
</method>
<method name="stop_all">
<return type="bool">
</return>
<description>
- Stop animating all tweens.
+ Stops animating all tweens.
</description>
</method>
<method name="targeting_method">
@@ -298,8 +300,8 @@
<argument index="8" name="delay" type="float" default="0">
</argument>
<description>
- Animate [code]method[/code] of [code]object[/code] from the value returned by [code]initial.initial_method[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later. Methods are animated by calling them with consecutive values.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Animates [code]method[/code] of [code]object[/code] from the value returned by [code]initial_method[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later. Methods are animated by calling them with consecutive values.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="targeting_property">
@@ -324,8 +326,8 @@
<argument index="8" name="delay" type="float" default="0">
</argument>
<description>
- Animate [code]property[/code] of [code]object[/code] from the current value of the [code]initial_val[/code] property of [code]initial[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later.
- [code]trans_type[/code] accepts TRANS_* constants, and is the way the animation is interpolated, while [code]ease_type[/code] accepts EASE_* constants, and controls the place of the interpolation (the beginning, the end, or both). You can read more about them in the class description.
+ Animates [code]property[/code] of [code]object[/code] from the current value of the [code]initial_val[/code] property of [code]initial[/code] to [code]final_val[/code] for [code]duration[/code] seconds, [code]delay[/code] seconds later.
+ Use [enum TransitionType] for [code]trans_type[/code] and [enum EaseType] for [code]ease_type[/code] parameters. These values control the timing and direction of the interpolation. See the class description for more information
</description>
</method>
<method name="tell" qualifiers="const">
@@ -338,12 +340,13 @@
</methods>
<members>
<member name="playback_process_mode" type="int" setter="set_tween_process_mode" getter="get_tween_process_mode" enum="Tween.TweenProcessMode">
+ The tween's animation process thread. See [enum TweenProcessMode]. Default value: [enum TWEEN_PROCESS_IDLE].
</member>
<member name="playback_speed" type="float" setter="set_speed_scale" getter="get_speed_scale">
- The speed multiplier of the tween. Set it to 1 for normal speed, 2 for two times nromal speed, and 0.5 for half of the normal speed. Setting it to 0 would pause the animation, but you might consider using [method set_active] or [method stop_all] and [method resume_all] for this.
+ The tween's speed multiplier. For example, set it to [code]1.0[/code] for normal speed, [code]2.0[/code] for two times normal speed, or [code]0.5[/code] for half of the normal speed. A value of [code]0[/code] pauses the animation, but see also [method set_active] or [method stop_all] for this.
</member>
<member name="repeat" type="bool" setter="set_repeat" getter="is_repeat">
- If [code]true[/code], the tween will repeat.
+ If [code]true[/code] the tween loops.
</member>
</members>
<signals>
@@ -353,7 +356,7 @@
<argument index="1" name="key" type="NodePath">
</argument>
<description>
- This signal is emitted when a tween ends.
+ Emitted when a tween ends.
</description>
</signal>
<signal name="tween_started">
@@ -362,7 +365,7 @@
<argument index="1" name="key" type="NodePath">
</argument>
<description>
- This signal is emitted when a tween starts.
+ Emitted when a tween starts.
</description>
</signal>
<signal name="tween_step">
@@ -375,61 +378,61 @@
<argument index="3" name="value" type="Object">
</argument>
<description>
- This signal is emitted each step of the tweening.
+ Emitted at each step of the animation.
</description>
</signal>
</signals>
<constants>
<constant name="TWEEN_PROCESS_PHYSICS" value="0" enum="TweenProcessMode">
- The [code]Tween[/code] should use [code]_physics_process[/code] for timekeeping when this is enabled.
+ The tween updates with the [code]_physics_process[/code] callback.
</constant>
<constant name="TWEEN_PROCESS_IDLE" value="1" enum="TweenProcessMode">
- The [code]Tween[/code] should use [code]_process[/code] for timekeeping when this is enabled (default).
+ The tween updates with the [code]_process[/code] callback.
</constant>
<constant name="TRANS_LINEAR" value="0" enum="TransitionType">
- Means that the animation is interpolated linearly.
+ The animation is interpolated linearly.
</constant>
<constant name="TRANS_SINE" value="1" enum="TransitionType">
- Means that the animation is interpolated using a sine wave.
+ The animation is interpolated using a sine function.
</constant>
<constant name="TRANS_QUINT" value="2" enum="TransitionType">
- Means that the animation is interpolated with a quinary (to the power of 5) function.
+ The animation is interpolated with a quintic (to the power of 5) function.
</constant>
<constant name="TRANS_QUART" value="3" enum="TransitionType">
- Means that the animation is interpolated with a quartic (to the power of 4) function.
+ The animation is interpolated with a quartic (to the power of 4) function.
</constant>
<constant name="TRANS_QUAD" value="4" enum="TransitionType">
- Means that the animation is interpolated with a quadratic (to the power of 2) function.
+ The animation is interpolated with a quadratic (to the power of 2) function.
</constant>
<constant name="TRANS_EXPO" value="5" enum="TransitionType">
- Means that the animation is interpolated with an exponential (some number to the power of x) function.
+ The animation is interpolated with an exponential (to the power of x) function.
</constant>
<constant name="TRANS_ELASTIC" value="6" enum="TransitionType">
- Means that the animation is interpolated with elasticity, wiggling around the edges.
+ The animation is interpolated with elasticity, wiggling around the edges.
</constant>
<constant name="TRANS_CUBIC" value="7" enum="TransitionType">
- Means that the animation is interpolated with a cubic (to the power of 3) function.
+ The animation is interpolated with a cubic (to the power of 3) function.
</constant>
<constant name="TRANS_CIRC" value="8" enum="TransitionType">
- Means that the animation is interpolated with a function using square roots.
+ The animation is interpolated with a function using square roots.
</constant>
<constant name="TRANS_BOUNCE" value="9" enum="TransitionType">
- Means that the animation is interpolated by bouncing at, but never surpassing, the end.
+ The animation is interpolated by bouncing at the end.
</constant>
<constant name="TRANS_BACK" value="10" enum="TransitionType">
- Means that the animation is interpolated backing out at edges.
+ The animation is interpolated backing out at ends.
</constant>
<constant name="EASE_IN" value="0" enum="EaseType">
- Signifies that the interpolation should be focused in the beginning.
+ The interpolation starts slowly and speeds up towards the end.
</constant>
<constant name="EASE_OUT" value="1" enum="EaseType">
- Signifies that the interpolation should be focused in the end.
+ The interpolation starts quickly and slows down towards the end.
</constant>
<constant name="EASE_IN_OUT" value="2" enum="EaseType">
- Signifies that the interpolation should be focused in both ends.
+ A combination of EASE_IN and EASE_OUT. The interpolation is slowest at both ends.
</constant>
<constant name="EASE_OUT_IN" value="3" enum="EaseType">
- Signifies that the interpolation should be focused in both ends, but they should be switched (a bit hard to explain, try it for yourself to be sure).
+ A combination of EASE_IN and EASE_OUT. The interpolation is fastest at both ends.
</constant>
</constants>
</class>
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 5ffe807606..ec92dcf900 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Vector2" category="Built-In Types" version="3.1">
<brief_description>
- Vector used for 2D Math.
+ Vector used for 2D math.
</brief_description>
<description>
- 2-element structure that can be used to represent positions in 2d-space, or any other pair of numeric values.
+ 2-element structure that can be used to represent positions in 2d space or any other pair of numeric values.
</description>
<tutorials>
http://docs.godotengine.org/en/3.0/tutorials/math/index.html
@@ -34,8 +34,8 @@
<return type="float">
</return>
<description>
- Returns the result of atan2 when called with the Vector's x and y as parameters (Math::atan2(x,y)).
- Be aware that it therefore returns an angle oriented clockwise with regard to the (0, 1) unit vector, and not an angle oriented counter-clockwise with regard to the (1, 0) unit vector (which would be the typical trigonometric representation of the angle when calling Math::atan2(y,x)).
+ Returns the vector's angle in radians with respect to the x-axis, or [code](1, 0)[/code] vector.
+ Equivalent to the result of atan2 when called with the vector's x and y as parameters: [code]atan2(x, y)[/code].
</description>
</method>
<method name="angle_to">
@@ -60,7 +60,7 @@
<return type="float">
</return>
<description>
- Returns the ratio of X to Y.
+ Returns the ratio of x to y.
</description>
</method>
<method name="bounce">
@@ -69,7 +69,13 @@
<argument index="0" name="n" type="Vector2">
</argument>
<description>
- Bounce returns the vector "bounced off" from the given plane, specified by its normal vector.
+ Returns the vector "bounced off" from a plane defined by the given normal.
+ </description>
+ </method>
+ <method name="ceil">
+ <return type="Vector2">
+ </return>
+ <description>
</description>
</method>
<method name="clamped">
@@ -87,7 +93,7 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the 2-dimensional analog of the cross product with the given Vector2.
+ Returns the 2 dimensional analog of the cross product with the given vector.
</description>
</method>
<method name="cubic_interpolate">
@@ -102,7 +108,7 @@
<argument index="3" name="t" type="float">
</argument>
<description>
- Cubicly interpolates between this Vector and "b", using "pre_a" and "post_b" as handles, and returning the result at position "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is.
+ Cubicly interpolates between this vector and [code]b[/code] using [code]pre_a[/code] and [code]post_b[/code] as handles, and returns the result at position [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], or a percentage of how far along the interpolation is.
</description>
</method>
<method name="distance_squared_to">
@@ -111,7 +117,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the squared distance to vector "b". Prefer this function over "distance_to" if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance to vector [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -120,7 +126,7 @@
<argument index="0" name="to" type="Vector2">
</argument>
<description>
- Returns the distance to vector "b".
+ Returns the distance to vector [code]b[/code].
</description>
</method>
<method name="dot">
@@ -129,7 +135,7 @@
<argument index="0" name="with" type="Vector2">
</argument>
<description>
- Returns the dot product with vector "b".
+ Returns the dot product with vector [code]b[/code].
</description>
</method>
<method name="floor">
@@ -143,21 +149,21 @@
<return type="bool">
</return>
<description>
- Returns whether the vector is normalized or not.
+ Returns [code]true[/code] if the vector is normalized.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the length of the vector.
+ Returns the vector's length.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the squared length of the vector. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
+ Returns the vector's length squared. Prefer this function over [member length] if you need to sort vectors or need the squared length for some formula.
</description>
</method>
<method name="linear_interpolate">
@@ -168,14 +174,14 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Returns the result of the linear interpolation between this vector and "b", by amount "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is.
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], a percentage of how far along the interpolation is.
</description>
</method>
<method name="normalized">
<return type="Vector2">
</return>
<description>
- Returns a normalized vector to unit length.
+ Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
<method name="reflect">
@@ -184,7 +190,7 @@
<argument index="0" name="n" type="Vector2">
</argument>
<description>
- Reflects the vector along the given plane, specified by its normal vector.
+ Returns the vector reflected from a plane defined by the given normal.
</description>
</method>
<method name="rotated">
@@ -193,7 +199,13 @@
<argument index="0" name="phi" type="float">
</argument>
<description>
- Rotates the vector by "phi" radians.
+ Returns the vector rotated by [code]phi[/code] radians.
+ </description>
+ </method>
+ <method name="round">
+ <return type="Vector2">
+ </return>
+ <description>
</description>
</method>
<method name="slide">
@@ -202,7 +214,7 @@
<argument index="0" name="n" type="Vector2">
</argument>
<description>
- Slide returns the component of the vector along the given plane, specified by its normal vector.
+ Returns the component of the vector along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -211,7 +223,7 @@
<argument index="0" name="by" type="Vector2">
</argument>
<description>
- Snaps the vector to a grid with the given size.
+ Returns the vector snapped to a grid with the given size.
</description>
</method>
<method name="tangent">
@@ -224,10 +236,10 @@
</methods>
<members>
<member name="x" type="float" setter="" getter="">
- X component of the vector.
+ The vector's x component.
</member>
<member name="y" type="float" setter="" getter="">
- Y component of the vector.
+ The vector's y component.
</member>
</members>
<constants>
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 940d4dd6cf..a5fc62b6f0 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -38,7 +38,7 @@
<argument index="0" name="to" type="Vector3">
</argument>
<description>
- Returns the vector's minimum angle to the vector [code]to[/code].
+ Returns the minimum angle to the given vector.
</description>
</method>
<method name="bounce">
@@ -47,7 +47,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Bounce returns the vector "bounced off" from the given plane, specified by its normal vector.
+ Returns the vector "bounced off" from a plane defined by the given normal.
</description>
</method>
<method name="ceil">
@@ -87,7 +87,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the squared distance to [code]b[/code]. Prefer this function over distance_to if you need to sort vectors or need the squared distance for some formula.
+ Returns the squared distance to [code]b[/code]. Prefer this function over [method distance_to] if you need to sort vectors or need the squared distance for some formula.
</description>
</method>
<method name="distance_to">
@@ -96,7 +96,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the distance to b.
+ Returns the distance to [code]b[/code].
</description>
</method>
<method name="dot">
@@ -105,7 +105,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the dot product with b.
+ Returns the dot product with [code]b[/code].
</description>
</method>
<method name="floor">
@@ -119,28 +119,28 @@
<return type="Vector3">
</return>
<description>
- Returns the inverse of the vector. This is the same as Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )
+ Returns the inverse of the vector. This is the same as [code]Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )[/code].
</description>
</method>
<method name="is_normalized">
<return type="bool">
</return>
<description>
- Returns whether the vector is normalized or not.
+ Returns [code]true[/code] if the vector is normalized.
</description>
</method>
<method name="length">
<return type="float">
</return>
<description>
- Returns the length of the vector.
+ Returns the vector's length.
</description>
</method>
<method name="length_squared">
<return type="float">
</return>
<description>
- Returns the length of the vector, squared. Prefer this function over "length" if you need to sort vectors or need the squared length for some formula.
+ Returns the vector's length squared. Prefer this function over [method length] if you need to sort vectors or need the squared length for some formula.
</description>
</method>
<method name="linear_interpolate">
@@ -151,28 +151,28 @@
<argument index="1" name="t" type="float">
</argument>
<description>
- Linearly interpolates the vector to a given one (b), by the given amount (t). (t) should be a float of 0.0-1.0, a percentage of how far along the interpolation is.
+ Returns the result of the linear interpolation between this vector and [code]b[/code] by amount [code]t[/code]. [code]t[/code] is in the range of [code]0.0 - 1.0[/code], a percentage of how far along the interpolation is.
</description>
</method>
<method name="max_axis">
<return type="int">
</return>
<description>
- Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the largest.
+ Returns the axis of the vector's largest value. See [code]AXIS_*[/code] constants.
</description>
</method>
<method name="min_axis">
<return type="int">
</return>
<description>
- Returns AXIS_X, AXIS_Y or AXIS_Z depending on which axis is the smallest.
+ Returns the axis of the vector's smallest value. See [code]AXIS_*[/code] constants.
</description>
</method>
<method name="normalized">
<return type="Vector3">
</return>
<description>
- Returns a copy of the normalized vector to unit length. This is the same as v / v.length().
+ Returns the vector scaled to unit length. Equivalent to [code]v / v.length()[/code].
</description>
</method>
<method name="outer">
@@ -181,7 +181,7 @@
<argument index="0" name="b" type="Vector3">
</argument>
<description>
- Returns the outer product with b.
+ Returns the outer product with [code]b[/code].
</description>
</method>
<method name="reflect">
@@ -190,7 +190,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Reflects the vector along the given plane, specified by its normal vector.
+ Returns the vector reflected from a plane defined by the given normal.
</description>
</method>
<method name="rotated">
@@ -201,7 +201,13 @@
<argument index="1" name="phi" type="float">
</argument>
<description>
- Rotates the vector around some axis by phi radians. The axis must be a normalized vector.
+ Rotates the vector around a given axis by [code]phi[/code] radians. The axis must be a normalized vector.
+ </description>
+ </method>
+ <method name="round">
+ <return type="Vector3">
+ </return>
+ <description>
</description>
</method>
<method name="slide">
@@ -210,7 +216,7 @@
<argument index="0" name="n" type="Vector3">
</argument>
<description>
- Slide returns the component of the vector along the given plane, specified by its normal vector.
+ Returns the component of the vector along a plane defined by the given normal.
</description>
</method>
<method name="snapped">
@@ -232,18 +238,18 @@
</methods>
<members>
<member name="x" type="float" setter="" getter="">
- X component of the vector.
+ The vector's x component.
</member>
<member name="y" type="float" setter="" getter="">
- Y component of the vector.
+ The vector's y component.
</member>
<member name="z" type="float" setter="" getter="">
- Z component of the vector.
+ The vector's z component.
</member>
</members>
<constants>
<constant name="AXIS_X" value="0">
- Enumerated value for the X axis. Returned by functions like max_axis or min_axis.
+ Enumerated value for the X axis. Returned by [method max_axis] and [method min_axis].
</constant>
<constant name="AXIS_Y" value="1">
Enumerated value for the Y axis.
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index a485205736..4878f7d932 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -212,6 +212,9 @@
<member name="hdr" type="bool" setter="set_hdr" getter="get_hdr">
If [code]true[/code] the viewport rendering will receive benefits from High Dynamic Range algorithm. Default value: [code]true[/code].
</member>
+ <member name="keep_3d_linear" type="bool" setter="set_keep_3d_linear" getter="get_keep_3d_linear">
+ If [code]true[/code] the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output.
+ </member>
<member name="msaa" type="int" setter="set_msaa" getter="get_msaa" enum="Viewport.MSAA">
The multisample anti-aliasing mode. Default value: [code]MSAA_DISABLED[/code].
</member>
diff --git a/doc/classes/VisualServer.xml b/doc/classes/VisualServer.xml
index baebddf3e0..893db84640 100644
--- a/doc/classes/VisualServer.xml
+++ b/doc/classes/VisualServer.xml
@@ -388,14 +388,17 @@
</argument>
<argument index="4" name="uvs" type="PoolVector2Array" default="PoolVector2Array( )">
</argument>
- <argument index="5" name="texture" type="RID">
+ <argument index="5" name="bones" type="PoolIntArray" default="PoolIntArray( )">
</argument>
- <argument index="6" name="count" type="int" default="-1">
+ <argument index="6" name="weights" type="PoolRealArray" default="PoolRealArray( )">
</argument>
- <argument index="7" name="normal_map" type="RID">
+ <argument index="7" name="texture" type="RID">
+ </argument>
+ <argument index="8" name="count" type="int" default="-1">
+ </argument>
+ <argument index="9" name="normal_map" type="RID">
</argument>
<description>
- Adds a triangle array to the [CanvasItem]'s draw commands.
</description>
</method>
<method name="canvas_item_clear">
@@ -3330,6 +3333,32 @@
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
</description>
</method>
+ <method name="texture_set_data_partial">
+ <return type="void">
+ </return>
+ <argument index="0" name="texture" type="RID">
+ </argument>
+ <argument index="1" name="image" type="Image">
+ </argument>
+ <argument index="2" name="src_x" type="int">
+ </argument>
+ <argument index="3" name="src_y" type="int">
+ </argument>
+ <argument index="4" name="src_w" type="int">
+ </argument>
+ <argument index="5" name="src_h" type="int">
+ </argument>
+ <argument index="6" name="dst_x" type="int">
+ </argument>
+ <argument index="7" name="dst_y" type="int">
+ </argument>
+ <argument index="8" name="dst_mip" type="int">
+ </argument>
+ <argument index="9" name="cube_side" type="int" enum="VisualServer.CubeMapSide" default="0">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="texture_set_flags">
<return type="void">
</return>
diff --git a/doc/classes/WebSocketClient.xml b/doc/classes/WebSocketClient.xml
deleted file mode 100644
index 496baa5787..0000000000
--- a/doc/classes/WebSocketClient.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="WebSocketClient" inherits="WebSocketMultiplayerPeer" category="Core" version="3.1">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <demos>
- </demos>
- <methods>
- <method name="connect_to_url">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="url" type="String">
- </argument>
- <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
- </argument>
- <argument index="2" name="gd_mp_api" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="disconnect_from_host">
- <return type="void">
- </return>
- <description>
- </description>
- </method>
- </methods>
- <members>
- <member name="verify_ssl" type="bool" setter="set_verify_ssl_enabled" getter="is_verify_ssl_enabled">
- </member>
- </members>
- <signals>
- <signal name="connection_closed">
- <description>
- </description>
- </signal>
- <signal name="connection_error">
- <description>
- </description>
- </signal>
- <signal name="connection_established">
- <argument index="0" name="protocol" type="String">
- </argument>
- <description>
- </description>
- </signal>
- <signal name="data_received">
- <description>
- </description>
- </signal>
- </signals>
- <constants>
- </constants>
-</class>
diff --git a/doc/classes/WebSocketPeer.xml b/doc/classes/WebSocketPeer.xml
deleted file mode 100644
index 276249e65a..0000000000
--- a/doc/classes/WebSocketPeer.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="WebSocketPeer" inherits="PacketPeer" category="Core" version="3.1">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <demos>
- </demos>
- <methods>
- <method name="close">
- <return type="void">
- </return>
- <description>
- </description>
- </method>
- <method name="get_write_mode" qualifiers="const">
- <return type="int" enum="WebSocketPeer.WriteMode">
- </return>
- <description>
- </description>
- </method>
- <method name="is_connected_to_host" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="set_write_mode">
- <return type="void">
- </return>
- <argument index="0" name="mode" type="int" enum="WebSocketPeer.WriteMode">
- </argument>
- <description>
- </description>
- </method>
- <method name="was_string_packet" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- </methods>
- <constants>
- <constant name="WRITE_MODE_TEXT" value="0" enum="WriteMode">
- </constant>
- <constant name="WRITE_MODE_BINARY" value="1" enum="WriteMode">
- </constant>
- </constants>
-</class>
diff --git a/doc/classes/WebSocketServer.xml b/doc/classes/WebSocketServer.xml
deleted file mode 100644
index 9a7108952f..0000000000
--- a/doc/classes/WebSocketServer.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="WebSocketServer" inherits="WebSocketMultiplayerPeer" category="Core" version="3.1">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
- <demos>
- </demos>
- <methods>
- <method name="has_peer" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="is_listening" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
- <method name="listen">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="port" type="int">
- </argument>
- <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
- </argument>
- <argument index="2" name="gd_mp_api" type="bool" default="false">
- </argument>
- <description>
- </description>
- </method>
- <method name="stop">
- <return type="void">
- </return>
- <description>
- </description>
- </method>
- </methods>
- <signals>
- <signal name="client_connected">
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="protocol" type="String">
- </argument>
- <description>
- </description>
- </signal>
- <signal name="client_disconnected">
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- </description>
- </signal>
- <signal name="data_received">
- <argument index="0" name="id" type="int">
- </argument>
- <description>
- </description>
- </signal>
- </signals>
- <constants>
- </constants>
-</class>
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py
index 8074ce45ea..adbd810d11 100644..100755
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -106,6 +106,7 @@ def make_class_list(class_list, columns):
f.close()
+
def rstize_text(text, cclass):
# Linebreak + tabs in the XML should become two line breaks unless in a "codeblock"
pos = 0
@@ -156,7 +157,7 @@ def rstize_text(text, cclass):
# Escape * character to avoid interpreting it as emphasis
pos = 0
- next_brac_pos = text.find('[');
+ next_brac_pos = text.find('[')
while True:
pos = text.find('*', pos, next_brac_pos)
if pos == -1:
@@ -258,15 +259,17 @@ def rstize_text(text, cclass):
elif cmd == 'code':
tag_text = '``'
inside_code = True
+ elif cmd.startswith('enum '):
+ tag_text = make_enum(cmd[5:])
else:
tag_text = make_type(tag_text)
escape_post = True
# Properly escape things like `[Node]s`
- if escape_post and post_text and post_text[0].isalnum(): # not punctuation, escape
+ if escape_post and post_text and post_text[0].isalnum(): # not punctuation, escape
post_text = '\ ' + post_text
- next_brac_pos = post_text.find('[',0)
+ next_brac_pos = post_text.find('[', 0)
iter_pos = 0
while not inside_code:
iter_pos = post_text.find('*', iter_pos, next_brac_pos)
@@ -286,7 +289,6 @@ def rstize_text(text, cclass):
else:
iter_pos += 1
-
text = pre_text + tag_text + post_text
pos = len(pre_text) + len(tag_text)
@@ -299,16 +301,27 @@ def make_type(t):
return ':ref:`' + t + '<class_' + t.lower() + '>`'
return t
+
def make_enum(t):
global class_names
p = t.find(".")
+ # Global enums such as Error are relative to @GlobalScope.
if p >= 0:
c = t[0:p]
- e = t[p+1:]
- if c in class_names:
- return ':ref:`' + e + '<enum_' + c.lower() + '_' + e.lower() + '>`'
+ e = t[p + 1:]
+ # Variant enums live in GlobalScope but still use periods.
+ if c == "Variant":
+ c = "@GlobalScope"
+ e = "Variant." + e
+ else:
+ # Things in GlobalScope don't have a period.
+ c = "@GlobalScope"
+ e = t
+ if c in class_names:
+ return ':ref:`' + e + '<enum_' + c.lower() + '_' + e.lower() + '>`'
return t
+
def make_method(
f,
name,
@@ -340,7 +353,10 @@ def make_method(
if not event:
if -1 in mdata['argidx']:
- t += make_type(mdata[-1].attrib['type'])
+ if 'enum' in mdata[-1].attrib:
+ t += make_enum(mdata[-1].attrib['enum'])
+ else:
+ t += make_type(mdata[-1].attrib['type'])
else:
t += 'void'
t += ' '
@@ -362,7 +378,10 @@ def make_method(
else:
s += ' '
- s += make_type(arg.attrib['type'])
+ if 'enum' in arg.attrib:
+ s += make_enum(arg.attrib['enum'])
+ else:
+ s += make_type(arg.attrib['type'])
if 'name' in arg.attrib:
s += ' ' + arg.attrib['name']
else:
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp
index c84469f26f..6e451eabcd 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.cpp
+++ b/drivers/coreaudio/audio_driver_coreaudio.cpp
@@ -217,13 +217,24 @@ void AudioDriverCoreAudio::start() {
if (!active) {
OSStatus result = AudioOutputUnitStart(audio_unit);
if (result != noErr) {
- ERR_PRINT("AudioOutputUnitStart failed");
+ ERR_PRINT(("AudioOutputUnitStart failed, code: " + itos(result)).utf8().get_data());
} else {
active = true;
}
}
};
+void AudioDriverCoreAudio::stop() {
+ if (active) {
+ OSStatus result = AudioOutputUnitStop(audio_unit);
+ if (result != noErr) {
+ ERR_PRINT(("AudioOutputUnitStop failed, code: " + itos(result)).utf8().get_data());
+ } else {
+ active = false;
+ }
+ }
+}
+
int AudioDriverCoreAudio::get_mix_rate() const {
return mix_rate;
};
diff --git a/drivers/coreaudio/audio_driver_coreaudio.h b/drivers/coreaudio/audio_driver_coreaudio.h
index 9891920263..c44e225521 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.h
+++ b/drivers/coreaudio/audio_driver_coreaudio.h
@@ -90,6 +90,7 @@ public:
virtual void finish();
bool try_lock();
+ void stop();
AudioDriverCoreAudio();
~AudioDriverCoreAudio();
diff --git a/drivers/dummy/rasterizer_dummy.h b/drivers/dummy/rasterizer_dummy.h
index ea0d3ec706..54d803f13c 100644
--- a/drivers/dummy/rasterizer_dummy.h
+++ b/drivers/dummy/rasterizer_dummy.h
@@ -154,6 +154,19 @@ public:
t->image->create(t->width, t->height, false, t->format, p_image->get_data());
}
+ void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side) {
+ DummyTexture *t = texture_owner.get(p_texture);
+
+ ERR_FAIL_COND(!t);
+ ERR_FAIL_COND(t->format != p_image->get_format());
+ ERR_FAIL_COND(p_image.is_null());
+ ERR_FAIL_COND(src_w <= 0 || src_h <= 0);
+ ERR_FAIL_COND(src_x < 0 || src_y < 0 || src_x + src_w > p_image->get_width() || src_y + src_h > p_image->get_height());
+ ERR_FAIL_COND(dst_x < 0 || dst_y < 0 || dst_x + src_w > t->width || dst_y + src_h > t->height);
+
+ t->image->blit_rect(p_image, Rect2(src_x, src_y, src_w, src_h), Vector2(dst_x, dst_y));
+ }
+
Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const {
DummyTexture *t = texture_owner.getornull(p_texture);
ERR_FAIL_COND_V(!t, Ref<Image>());
@@ -333,6 +346,7 @@ public:
RID skeleton_create() { return RID(); }
void skeleton_allocate(RID p_skeleton, int p_bones, bool p_2d_skeleton = false) {}
+ void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) {}
int skeleton_get_bone_count(RID p_skeleton) const { return 0; }
void skeleton_bone_set_transform(RID p_skeleton, int p_bone, const Transform &p_transform) {}
Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const { return Transform(); }
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 9339167c8e..4626a5ed3c 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -316,7 +316,11 @@ void RasterizerGLES2::set_boot_image(const Ref<Image> &p_image, const Color &p_c
glViewport(0, 0, window_w, window_h);
glDisable(GL_BLEND);
glDepthMask(GL_FALSE);
- glClearColor(p_color.r, p_color.g, p_color.b, p_color.a);
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ } else {
+ glClearColor(p_color.r, p_color.g, p_color.b, 1.0);
+ }
glClear(GL_COLOR_BUFFER_BIT);
canvas->canvas_begin();
@@ -340,6 +344,27 @@ void RasterizerGLES2::set_boot_image(const Ref<Image> &p_image, const Color &p_c
storage->free(texture);
+ if (OS::get_singleton()->is_layered_allowed()) {
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+#ifdef WINDOWS_ENABLED
+ Size2 wndsize = OS::get_singleton()->get_layered_buffer_size();
+ uint8_t *data = OS::get_singleton()->get_layered_buffer_data();
+ if (data) {
+ glReadPixels(0, 0, wndsize.x, wndsize.y, GL_BGRA, GL_UNSIGNED_BYTE, data);
+ OS::get_singleton()->swap_layered_buffer();
+
+ return;
+ }
+#endif
+ } else {
+ //clear alpha
+ glColorMask(false, false, false, true);
+ glClearColor(0, 0, 0, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColorMask(true, true, true, true);
+ }
+ }
+
OS::get_singleton()->swap_buffers();
}
@@ -373,6 +398,28 @@ void RasterizerGLES2::blit_render_target_to_screen(RID p_render_target, const Re
}
void RasterizerGLES2::end_frame(bool p_swap_buffers) {
+
+ if (OS::get_singleton()->is_layered_allowed()) {
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+#ifdef WINDOWS_ENABLED
+ Size2 wndsize = OS::get_singleton()->get_layered_buffer_size();
+ uint8_t *data = OS::get_singleton()->get_layered_buffer_data();
+ if (data) {
+ glReadPixels(0, 0, wndsize.x, wndsize.y, GL_BGRA, GL_UNSIGNED_BYTE, data);
+ OS::get_singleton()->swap_layered_buffer();
+
+ return;
+ }
+#endif
+ } else {
+ //clear alpha
+ glColorMask(false, false, false, true);
+ glClearColor(0, 0, 0, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColorMask(true, true, true, true);
+ }
+ }
+
if (p_swap_buffers)
OS::get_singleton()->swap_buffers();
else
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 5bca3ee548..6e7e1793e1 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -452,6 +452,11 @@ void RasterizerStorageGLES2::texture_set_data(RID p_texture, const Ref<Image> &p
texture->mipmaps = mipmaps;
}
+void RasterizerStorageGLES2::texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side) {
+ // TODO
+ ERR_PRINT("Not implemented (ask Karroffel to do it :p)");
+}
+
Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side) const {
Texture *texture = texture_owner.getornull(p_texture);
@@ -1297,6 +1302,10 @@ Transform2D RasterizerStorageGLES2::skeleton_bone_get_transform_2d(RID p_skeleto
return Transform2D();
}
+void RasterizerStorageGLES2::skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) {
+
+}
+
void RasterizerStorageGLES2::update_dirty_skeletons() {
}
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index 9f8d8d100b..b735f2e148 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -237,6 +237,7 @@ public:
virtual RID texture_create();
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
+ virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
virtual uint32_t texture_get_flags(RID p_texture) const;
@@ -555,6 +556,7 @@ public:
virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const;
virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform);
virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const;
+ virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform);
/* Light API */
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index c33fdaa355..ff423bf0d0 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -160,6 +160,7 @@ void RasterizerCanvasGLES3::canvas_begin() {
state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13, false);
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_NINEPATCH, false);
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_SKELETON, false);
state.canvas_shader.set_custom_shader(0);
state.canvas_shader.bind();
@@ -180,6 +181,7 @@ void RasterizerCanvasGLES3::canvas_begin() {
glBindVertexArray(data.canvas_quad_array);
state.using_texture_rect = true;
state.using_ninepatch = false;
+ state.using_skeleton = false;
}
void RasterizerCanvasGLES3::canvas_end() {
@@ -284,6 +286,10 @@ void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable, bool p_ninepat
state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE, state.canvas_item_modulate);
state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform);
state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX, state.extra_matrix);
+ if (state.using_skeleton) {
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM, state.skeleton_transform);
+ state.canvas_shader.set_uniform(CanvasShaderGLES3::SKELETON_TRANSFORM_INVERSE, state.skeleton_transform_inverse);
+ }
if (storage->frame.current_rt) {
state.canvas_shader.set_uniform(CanvasShaderGLES3::SCREEN_PIXEL_SIZE, Vector2(1.0 / storage->frame.current_rt->width, 1.0 / storage->frame.current_rt->height));
} else {
@@ -293,7 +299,7 @@ void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable, bool p_ninepat
state.using_ninepatch = p_ninepatch;
}
-void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor) {
+void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor, const int *p_bones, const float *p_weights) {
glBindVertexArray(data.polygon_buffer_pointer_array);
glBindBuffer(GL_ARRAY_BUFFER, data.polygon_buffer);
@@ -301,11 +307,17 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
uint32_t buffer_ofs = 0;
//vertex
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_vertices);
glEnableVertexAttribArray(VS::ARRAY_VERTEX);
glVertexAttribPointer(VS::ARRAY_VERTEX, 2, GL_FLOAT, false, sizeof(Vector2), ((uint8_t *)0) + buffer_ofs);
buffer_ofs += sizeof(Vector2) * p_vertex_count;
//color
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
if (p_singlecolor) {
glDisableVertexAttribArray(VS::ARRAY_COLOR);
@@ -322,6 +334,10 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
buffer_ofs += sizeof(Color) * p_vertex_count;
}
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
if (p_uvs) {
glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(Vector2) * p_vertex_count, p_uvs);
@@ -333,6 +349,32 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
glDisableVertexAttribArray(VS::ARRAY_TEX_UV);
}
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
+ if (p_bones && p_weights) {
+
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(int) * 4 * p_vertex_count, p_bones);
+ glEnableVertexAttribArray(VS::ARRAY_BONES);
+ //glVertexAttribPointer(VS::ARRAY_BONES, 4, GL_UNSIGNED_INT, false, sizeof(int) * 4, ((uint8_t *)0) + buffer_ofs);
+ glVertexAttribIPointer(VS::ARRAY_BONES, 4, GL_UNSIGNED_INT, sizeof(int) * 4, ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(int) * 4 * p_vertex_count;
+
+ glBufferSubData(GL_ARRAY_BUFFER, buffer_ofs, sizeof(float) * 4 * p_vertex_count, p_weights);
+ glEnableVertexAttribArray(VS::ARRAY_WEIGHTS);
+ glVertexAttribPointer(VS::ARRAY_WEIGHTS, 4, GL_FLOAT, false, sizeof(float) * 4, ((uint8_t *)0) + buffer_ofs);
+ buffer_ofs += sizeof(float) * 4 * p_vertex_count;
+
+ } else if (state.using_skeleton) {
+ glVertexAttribI4ui(VS::ARRAY_BONES, 0, 0, 0, 0);
+ glVertexAttrib4f(VS::ARRAY_WEIGHTS, 0, 0, 0, 0);
+ }
+
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_COND(buffer_ofs > data.polygon_buffer_size);
+#endif
+
//bind the indices buffer.
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
@@ -342,6 +384,12 @@ void RasterizerCanvasGLES3::_draw_polygon(const int *p_indices, int p_index_coun
storage->frame.canvas_draw_commands++;
+ if (p_bones && p_weights) {
+ //not used so often, so disable when used
+ glDisableVertexAttribArray(VS::ARRAY_BONES);
+ glDisableVertexAttribArray(VS::ARRAY_WEIGHTS);
+ }
+
glBindVertexArray(0);
}
@@ -735,7 +783,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size);
}
- _draw_polygon(polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
+
+ _draw_polygon(polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1, polygon->bones.ptr(), polygon->weights.ptr());
#ifdef GLES_OVER_GL
if (polygon->antialiased) {
glEnable(GL_LINE_SMOOTH);
@@ -921,7 +970,7 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
}
_bind_canvas_texture(RID(), RID());
- _draw_polygon(indices, numpoints * 3, numpoints + 1, points, NULL, &circle->color, true);
+ _draw_polygon(indices, numpoints * 3, numpoints + 1, points, NULL, &circle->color, true, NULL, NULL);
//_draw_polygon(numpoints*3,indices,points,NULL,&circle->color,RID(),true);
//canvas_draw_circle(circle->indices.size(),circle->indices.ptr(),circle->points.ptr(),circle->uvs.ptr(),circle->colors.ptr(),circle->texture,circle->colors.size()==1);
@@ -1068,6 +1117,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
RID canvas_last_material;
bool prev_distance_field = false;
+ bool prev_use_skeleton = false;
while (p_item_list) {
@@ -1106,6 +1156,36 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
}
}
+ RasterizerStorageGLES3::Skeleton *skeleton = NULL;
+
+ {
+ //skeleton handling
+ if (ci->skeleton.is_valid()) {
+ skeleton = storage->skeleton_owner.getornull(ci->skeleton);
+ if (!skeleton->use_2d) {
+ skeleton = NULL;
+ } else {
+ state.skeleton_transform = p_transform * skeleton->base_transform_2d;
+ state.skeleton_transform_inverse = state.skeleton_transform.affine_inverse();
+ }
+ }
+
+ bool use_skeleton = skeleton != NULL;
+ if (prev_use_skeleton != use_skeleton) {
+ rebind_shader = true;
+ state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_SKELETON, use_skeleton);
+ prev_use_skeleton = use_skeleton;
+ }
+
+ if (skeleton) {
+ glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 1);
+ glBindTexture(GL_TEXTURE_2D, skeleton->texture);
+ state.using_skeleton = true;
+ } else {
+ state.using_skeleton = false;
+ }
+ }
+
//begin rect
Item *material_owner = ci->material_owner ? ci->material_owner : ci;
@@ -1130,6 +1210,9 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
if (shader_ptr->canvas_item.uses_screen_texture && !state.canvas_texscreen_used) {
//copy if not copied before
_copy_texscreen(Rect2());
+
+ // blend mode will have been enabled so make sure we disable it again later on
+ last_blend_mode = last_blend_mode != RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_DISABLED ? last_blend_mode : -1;
}
if (shader_ptr != shader_cache) {
@@ -1201,14 +1284,30 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
}
int blend_mode = shader_cache ? shader_cache->canvas_item.blend_mode : RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX;
+ if (blend_mode == RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_DISABLED && (!storage->frame.current_rt || !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT])) {
+ blend_mode = RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX;
+ }
bool unshaded = shader_cache && (shader_cache->canvas_item.light_mode == RasterizerStorageGLES3::Shader::CanvasItem::LIGHT_MODE_UNSHADED || blend_mode != RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX);
bool reclip = false;
if (last_blend_mode != blend_mode) {
+ if (last_blend_mode == RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_DISABLED) {
+ // re-enable it
+ glEnable(GL_BLEND);
+ } else if (blend_mode == RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_DISABLED) {
+ // disable it
+ glDisable(GL_BLEND);
+ }
switch (blend_mode) {
+ case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_DISABLED: {
+
+ // nothing to do here
+
+ } break;
case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX: {
+
glBlendEquation(GL_FUNC_ADD);
if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) {
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h
index 1dc17f98d5..bfaf1fdb4b 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.h
+++ b/drivers/gles3/rasterizer_canvas_gles3.h
@@ -84,6 +84,9 @@ public:
Color canvas_item_modulate;
Transform2D extra_matrix;
Transform2D final_transform;
+ bool using_skeleton;
+ Transform2D skeleton_transform;
+ Transform2D skeleton_transform_inverse;
} state;
@@ -123,7 +126,7 @@ public:
_FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map);
_FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs);
- _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
+ _FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor, const int *p_bones, const float *p_weights);
_FORCE_INLINE_ void _draw_generic(GLuint p_primitive, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
_FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip);
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 0fb69494f4..12e29827b0 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -290,7 +290,11 @@ void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_c
glViewport(0, 0, window_w, window_h);
glDisable(GL_BLEND);
glDepthMask(GL_FALSE);
- glClearColor(p_color.r, p_color.g, p_color.b, 1.0);
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ } else {
+ glClearColor(p_color.r, p_color.g, p_color.b, 1.0);
+ }
glClear(GL_COLOR_BUFFER_BIT);
canvas->canvas_begin();
@@ -329,6 +333,27 @@ void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_c
storage->free(texture); // free since it's only one frame that stays there
+ if (OS::get_singleton()->is_layered_allowed()) {
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+#ifdef WINDOWS_ENABLED
+ Size2 wndsize = OS::get_singleton()->get_layered_buffer_size();
+ uint8_t *data = OS::get_singleton()->get_layered_buffer_data();
+ if (data) {
+ glReadPixels(0, 0, wndsize.x, wndsize.y, GL_BGRA, GL_UNSIGNED_BYTE, data);
+ OS::get_singleton()->swap_layered_buffer();
+
+ return;
+ }
+#endif
+ } else {
+ //clear alpha
+ glColorMask(false, false, false, true);
+ glClearColor(0, 0, 0, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColorMask(true, true, true, true);
+ }
+ }
+
OS::get_singleton()->swap_buffers();
}
@@ -365,6 +390,27 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
void RasterizerGLES3::end_frame(bool p_swap_buffers) {
+ if (OS::get_singleton()->is_layered_allowed()) {
+ if (OS::get_singleton()->get_window_per_pixel_transparency_enabled()) {
+#ifdef WINDOWS_ENABLED
+ Size2 wndsize = OS::get_singleton()->get_layered_buffer_size();
+ uint8_t *data = OS::get_singleton()->get_layered_buffer_data();
+ if (data) {
+ glReadPixels(0, 0, wndsize.x, wndsize.y, GL_BGRA, GL_UNSIGNED_BYTE, data);
+ OS::get_singleton()->swap_layered_buffer();
+
+ return;
+ }
+#endif
+ } else {
+ //clear alpha
+ glColorMask(false, false, false, true);
+ glClearColor(0, 0, 0, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glColorMask(true, true, true, true);
+ }
+ }
+
if (p_swap_buffers)
OS::get_singleton()->swap_buffers();
else
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 5b6b3d44f2..8da2c2f9c2 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2362,7 +2362,11 @@ void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const C
ERR_FAIL_COND(!tex);
glActiveTexture(GL_TEXTURE0);
- glBindTexture(tex->target, tex->tex_id);
+
+ if (tex->proxy && tex->proxy->tex_id)
+ glBindTexture(tex->target, tex->proxy->tex_id);
+ else
+ glBindTexture(tex->target, tex->tex_id);
if (storage->config.srgb_decode_supported && tex->srgb && !tex->using_srgb) {
@@ -3906,6 +3910,7 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_FILMIC_TONEMAPPER, env->tone_mapper == VS::ENV_TONE_MAPPER_FILMIC);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_ACES_TONEMAPPER, env->tone_mapper == VS::ENV_TONE_MAPPER_ACES);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_REINDHART_TONEMAPPER, env->tone_mapper == VS::ENV_TONE_MAPPER_REINHARDT);
+ state.tonemap_shader.set_conditional(TonemapShaderGLES3::KEEP_3D_LINEAR, storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_KEEP_3D_LINEAR]);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_AUTO_EXPOSURE, env->auto_exposure);
state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_FILTER_BICUBIC, env->glow_bicubic_upscale);
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index f91ed35331..945df35456 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -828,6 +828,58 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p
//texture_set_flags(p_texture,texture->flags);
}
+// Uploads pixel data to a sub-region of a texture, for the specified mipmap.
+// The texture pixels must have been allocated before, because most features seen in texture_set_data() make no sense in a partial update.
+// TODO If we want this to be usable without pre-filling pixels with a full image, we have to call glTexImage2D() with null data.
+void RasterizerStorageGLES3::texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side) {
+
+ Texture *texture = texture_owner.get(p_texture);
+
+ ERR_FAIL_COND(!texture);
+ ERR_FAIL_COND(!texture->active);
+ ERR_FAIL_COND(texture->render_target);
+ ERR_FAIL_COND(texture->format != p_image->get_format());
+ ERR_FAIL_COND(p_image.is_null());
+ ERR_FAIL_COND(src_w <= 0 || src_h <= 0);
+ ERR_FAIL_COND(src_x < 0 || src_y < 0 || src_x + src_w > p_image->get_width() || src_y + src_h > p_image->get_height());
+ ERR_FAIL_COND(dst_x < 0 || dst_y < 0 || dst_x + src_w > texture->alloc_width || dst_y + src_h > texture->alloc_height);
+ ERR_FAIL_COND(p_dst_mip < 0 || p_dst_mip >= texture->mipmaps);
+
+ GLenum type;
+ GLenum format;
+ GLenum internal_format;
+ bool compressed;
+ bool srgb;
+
+ // Because OpenGL wants data as a dense array, we have to extract the sub-image if the source rect isn't the full image
+ Ref<Image> p_sub_img = p_image;
+ if (src_x > 0 || src_y > 0 || src_w != p_image->get_width() || src_h != p_image->get_height()) {
+ p_sub_img = p_image->get_rect(Rect2(src_x, src_y, src_w, src_h));
+ }
+
+ Ref<Image> img = _get_gl_image_and_format(p_sub_img, p_sub_img->get_format(), texture->flags, format, internal_format, type, compressed, srgb);
+
+ GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP) ? _cube_side_enum[p_cube_side] : GL_TEXTURE_2D;
+
+ PoolVector<uint8_t>::Read read = img->get_data().read();
+
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(texture->target, texture->tex_id);
+
+ int src_data_size = img->get_data().size();
+ int src_ofs = 0;
+
+ if (texture->compressed) {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glCompressedTexSubImage2D(blit_target, p_dst_mip, dst_x, dst_y, src_w, src_h, internal_format, src_data_size, &read[src_ofs]);
+
+ } else {
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ // `format` has to match the internal_format used when the texture was created
+ glTexSubImage2D(blit_target, p_dst_mip, dst_x, dst_y, src_w, src_h, format, type, &read[src_ofs]);
+ }
+}
+
Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side) const {
Texture *texture = texture_owner.get(p_texture);
@@ -1615,6 +1667,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
shaders.actions_canvas.render_mode_values["blend_sub"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_SUB);
shaders.actions_canvas.render_mode_values["blend_mul"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_MUL);
shaders.actions_canvas.render_mode_values["blend_premul_alpha"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_PMALPHA);
+ shaders.actions_canvas.render_mode_values["blend_disabled"] = Pair<int *, int>(&p_shader->canvas_item.blend_mode, Shader::CanvasItem::BLEND_MODE_DISABLED);
shaders.actions_canvas.render_mode_values["unshaded"] = Pair<int *, int>(&p_shader->canvas_item.light_mode, Shader::CanvasItem::LIGHT_MODE_UNSHADED);
shaders.actions_canvas.render_mode_values["light_only"] = Pair<int *, int>(&p_shader->canvas_item.light_mode, Shader::CanvasItem::LIGHT_MODE_LIGHT_ONLY);
@@ -1912,7 +1965,7 @@ void RasterizerStorageGLES3::material_set_param(RID p_material, const StringName
Variant RasterizerStorageGLES3::material_get_param(RID p_material, const StringName &p_param) const {
const Material *material = material_owner.get(p_material);
- ERR_FAIL_COND_V(!material, RID());
+ ERR_FAIL_COND_V(!material, Variant());
if (material->params.has(p_param))
return material->params[p_param];
@@ -4496,6 +4549,15 @@ Transform2D RasterizerStorageGLES3::skeleton_bone_get_transform_2d(RID p_skeleto
return ret;
}
+void RasterizerStorageGLES3::skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) {
+
+ Skeleton *skeleton = skeleton_owner.getornull(p_skeleton);
+
+ ERR_FAIL_COND(!skeleton->use_2d);
+
+ skeleton->base_transform_2d = p_base_transform;
+}
+
void RasterizerStorageGLES3::update_dirty_skeletons() {
glActiveTexture(GL_TEXTURE0);
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index ef2b247266..6b626cbd00 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -340,6 +340,7 @@ public:
virtual RID texture_create();
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT);
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
+ virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT);
virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags);
virtual uint32_t texture_get_flags(RID p_texture) const;
@@ -420,6 +421,7 @@ public:
BLEND_MODE_SUB,
BLEND_MODE_MUL,
BLEND_MODE_PMALPHA,
+ BLEND_MODE_DISABLED,
};
int blend_mode;
@@ -868,6 +870,7 @@ public:
GLuint texture;
SelfList<Skeleton> update_list;
Set<RasterizerScene::InstanceBase *> instances; //instances using skeleton
+ Transform2D base_transform_2d;
Skeleton() :
update_list(this) {
@@ -891,6 +894,7 @@ public:
virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const;
virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform);
virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const;
+ virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform);
/* Light API */
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 1f3b76f5cd..eb8d6c485b 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -911,6 +911,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
actions[VS::SHADER_SPATIAL].render_mode_defines["specular_phong"] = "#define SPECULAR_PHONG\n";
actions[VS::SHADER_SPATIAL].render_mode_defines["specular_toon"] = "#define SPECULAR_TOON\n";
actions[VS::SHADER_SPATIAL].render_mode_defines["specular_disabled"] = "#define SPECULAR_DISABLED\n";
+ actions[VS::SHADER_SPATIAL].render_mode_defines["shadows_disabled"] = "#define SHADOWS_DISABLED\n";
/* PARTICLES SHADER */
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 3bbeb1149d..326aab4c7c 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -4,6 +4,11 @@
layout(location=0) in highp vec2 vertex;
layout(location=3) in vec4 color_attrib;
+#ifdef USE_SKELETON
+layout(location=6) in uvec4 bone_indices; // attrib:6
+layout(location=7) in vec4 bone_weights; // attrib:7
+#endif
+
#ifdef USE_TEXTURE_RECT
uniform vec4 dst_rect;
@@ -51,6 +56,12 @@ out highp vec2 pixel_size_interp;
#endif
+#ifdef USE_SKELETON
+uniform mediump sampler2D skeleton_texture; // texunit:-1
+uniform highp mat4 skeleton_transform;
+uniform highp mat4 skeleton_transform_inverse;
+#endif
+
#ifdef USE_LIGHTING
layout(std140) uniform LightData { //ubo:1
@@ -75,7 +86,6 @@ out vec4 light_uv_interp;
out vec4 local_rot;
-
#ifdef USE_SHADOWS
out highp vec2 pos;
#endif
@@ -101,6 +111,7 @@ MATERIAL_UNIFORMS
#endif
+
VERTEX_SHADER_GLOBALS
void main() {
@@ -146,6 +157,7 @@ void main() {
#endif
+
#define extra_matrix extra_matrix2
{
@@ -175,6 +187,49 @@ VERTEX_SHADER_CODE
#endif
+#ifdef USE_SKELETON
+
+ if (bone_weights!=vec4(0.0)){ //must be a valid bone
+ //skeleton transform
+
+ ivec4 bone_indicesi = ivec4(bone_indices);
+
+ ivec2 tex_ofs = ivec2( bone_indicesi.x%256, (bone_indicesi.x/256)*2 );
+
+ highp mat2x4 m = mat2x4(
+ texelFetch(skeleton_texture,tex_ofs,0),
+ texelFetch(skeleton_texture,tex_ofs+ivec2(0,1),0)
+ ) * bone_weights.x;
+
+ tex_ofs = ivec2( bone_indicesi.y%256, (bone_indicesi.y/256)*2 );
+
+ m+= mat2x4(
+ texelFetch(skeleton_texture,tex_ofs,0),
+ texelFetch(skeleton_texture,tex_ofs+ivec2(0,1),0)
+ ) * bone_weights.y;
+
+ tex_ofs = ivec2( bone_indicesi.z%256, (bone_indicesi.z/256)*2 );
+
+ m+= mat2x4(
+ texelFetch(skeleton_texture,tex_ofs,0),
+ texelFetch(skeleton_texture,tex_ofs+ivec2(0,1),0)
+ ) * bone_weights.z;
+
+
+ tex_ofs = ivec2( bone_indicesi.w%256, (bone_indicesi.w/256)*2 );
+
+ m+= mat2x4(
+ texelFetch(skeleton_texture,tex_ofs,0),
+ texelFetch(skeleton_texture,tex_ofs+ivec2(0,1),0)
+ ) * bone_weights.w;
+
+ mat4 bone_matrix = skeleton_transform * transpose(mat4(m[0],m[1],vec4(0.0,0.0,1.0,0.0),vec4(0.0,0.0,0.0,1.0))) * skeleton_transform_inverse;
+
+ outvec = bone_matrix * outvec;
+ }
+
+#endif
+
gl_Position = projection_matrix * outvec;
#ifdef USE_LIGHTING
@@ -207,6 +262,7 @@ uniform mediump sampler2D color_texture; // texunit:0
uniform highp vec2 color_texpixel_size;
uniform mediump sampler2D normal_texture; // texunit:1
+
in highp vec2 uv_interp;
in mediump vec4 color_interp;
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index d3644bffdd..f5481c597c 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1206,6 +1206,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino
float omni_attenuation = pow( max(1.0 - normalized_distance, 0.0), omni_lights[idx].light_direction_attenuation.w );
vec3 light_attenuation = vec3(omni_attenuation);
+#if !defined(SHADOWS_DISABLED)
if (omni_lights[idx].light_params.w>0.5) {
//there is a shadowmap
@@ -1252,6 +1253,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino
#endif
light_attenuation*=mix(omni_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow);
}
+#endif //SHADOWS_DISABLED
light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb,light_attenuation,albedo,transmission,omni_lights[idx].light_params.z*p_blob_intensity,roughness,metallic,rim * omni_attenuation,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
@@ -1270,6 +1272,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
spot_attenuation*= 1.0 - pow( spot_rim, spot_lights[idx].light_params.x);
vec3 light_attenuation = vec3(spot_attenuation);
+#if !defined(SHADOWS_DISABLED)
if (spot_lights[idx].light_params.w>0.5) {
//there is a shadowmap
highp vec4 splane=(spot_lights[idx].shadow_matrix * vec4(vertex,1.0));
@@ -1287,6 +1290,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
#endif
light_attenuation*=mix(spot_lights[idx].shadow_color_contact.rgb,vec3(1.0),shadow);
}
+#endif //SHADOWS_DISABLED
light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb,light_attenuation,albedo,transmission,spot_lights[idx].light_params.z*p_blob_intensity,roughness,metallic,rim * spot_attenuation,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
@@ -1785,6 +1789,7 @@ FRAGMENT_SHADER_CODE
float depth_z = -vertex.z;
#ifdef LIGHT_DIRECTIONAL_SHADOW
+#if !defined(SHADOWS_DISABLED)
#ifdef LIGHT_USE_PSSM4
if (depth_z < shadow_split_offsets.w) {
@@ -1927,6 +1932,7 @@ FRAGMENT_SHADER_CODE
}
+#endif // !defined(SHADOWS_DISABLED)
#endif //LIGHT_DIRECTIONAL_SHADOW
#ifdef USE_VERTEX_LIGHTING
diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl
index 2f671158b2..a75871f08e 100644
--- a/drivers/gles3/shaders/tonemap.glsl
+++ b/drivers/gles3/shaders/tonemap.glsl
@@ -258,9 +258,13 @@ void main() {
#endif
+#ifdef KEEP_3D_LINEAR
+ // leave color as is...
+#else
//regular Linear -> SRGB conversion
vec3 a = vec3(0.055);
color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308)));
+#endif
#if defined(USING_GLOW)
glow = mix( (vec3(1.0)+a)*pow(glow,vec3(1.0/2.4))-a , 12.92*glow , lessThan(glow,vec3(0.0031308)));
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index eeb3b31fc2..05dfd69f58 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -73,6 +73,23 @@ void OS_Unix::debug_break() {
assert(false);
};
+static void handle_interrupt(int sig) {
+ if (ScriptDebugger::get_singleton() == NULL)
+ return;
+
+ ScriptDebugger::get_singleton()->set_depth(-1);
+ ScriptDebugger::get_singleton()->set_lines_left(1);
+}
+
+void OS_Unix::initialize_debugging() {
+
+ if (ScriptDebugger::get_singleton() != NULL) {
+ struct sigaction action;
+ action.sa_handler = handle_interrupt;
+ sigaction(SIGINT, &action, NULL);
+ }
+}
+
int OS_Unix::unix_initialize_audio(int p_audio_driver) {
return 0;
@@ -227,7 +244,7 @@ OS::TimeZoneInfo OS_Unix::get_time_zone_info() const {
void OS_Unix::delay_usec(uint32_t p_usec) const {
- struct timespec rem = { p_usec / 1000000, (p_usec % 1000000) * 1000 };
+ struct timespec rem = { static_cast<time_t>(p_usec / 1000000), static_cast<long>((p_usec % 1000000) * 1000) };
while (nanosleep(&rem, &rem) == EINTR) {
}
}
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index db0fe1e00b..95b74d23ff 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -101,6 +101,7 @@ public:
virtual int get_processor_count() const;
virtual void debug_break();
+ virtual void initialize_debugging();
virtual String get_executable_path() const;
virtual String get_user_data_dir() const;
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index 88ed8b27b4..aa0fd34e0a 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -162,7 +162,7 @@ void FileAccessWindows::close() {
}
if (rename_error) {
attempts--;
- OS::get_singleton()->delay_usec(1000000); //wait 100msec and try again
+ OS::get_singleton()->delay_usec(100000); // wait 100msec and try again
}
}
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 4c7f2f53cc..93c86d920a 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -650,12 +650,12 @@ void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {
}
void CodeTextEditor::_zoom_in() {
- font_resize_val += EDSCALE;
+ font_resize_val += MAX(EDSCALE, 1.0f);
_zoom_changed();
}
void CodeTextEditor::_zoom_out() {
- font_resize_val -= EDSCALE;
+ font_resize_val -= MAX(EDSCALE, 1.0f);
_zoom_changed();
}
@@ -677,7 +677,20 @@ void CodeTextEditor::_reset_zoom() {
void CodeTextEditor::_line_col_changed() {
line_nb->set_text(itos(text_editor->cursor_get_line() + 1));
- col_nb->set_text(itos(text_editor->cursor_get_column() + 1));
+
+ String line = text_editor->get_line(text_editor->cursor_get_line());
+
+ int positional_column = 0;
+
+ for (int i = 0; i < text_editor->cursor_get_column(); i++) {
+ if (line[i] == '\t') {
+ positional_column += text_editor->get_indent_size(); //tab size
+ } else {
+ positional_column += 1;
+ }
+ }
+
+ col_nb->set_text(itos(positional_column + 1));
}
void CodeTextEditor::_text_changed() {
@@ -766,6 +779,7 @@ void CodeTextEditor::update_editor_settings() {
text_editor->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_breakpoint_gutter"));
text_editor->set_hiding_enabled(EditorSettings::get_singleton()->get("text_editor/line_numbers/code_folding"));
text_editor->set_draw_fold_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/code_folding"));
+ text_editor->set_wrap_enabled(EditorSettings::get_singleton()->get("text_editor/line_numbers/word_wrap"));
text_editor->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret"));
text_editor->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/open_scripts/smooth_scrolling"));
text_editor->set_v_scroll_speed(EditorSettings::get_singleton()->get("text_editor/open_scripts/v_scroll_speed"));
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index ef133e2589..7f93917744 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -35,6 +35,7 @@
#include "plugins/script_editor_plugin.h"
#include "print_string.h"
#include "scene/gui/label.h"
+#include "scene/gui/popup_menu.h"
class ConnectDialogBinds : public Object {
@@ -87,51 +88,12 @@ public:
}
};
-void ConnectDialog::_notification(int p_what) {
-
- if (p_what == NOTIFICATION_ENTER_TREE) {
- bind_editor->edit(cdbinds);
- }
-}
-
-void ConnectDialog::_tree_node_selected() {
-
- //dst_method_list->get_popup()->clear();
- Node *current = tree->get_selected();
-
- if (!current) {
- make_callback->hide();
- return;
- }
-
- if (current->get_script().is_null())
- make_callback->hide();
- else
- make_callback->show();
-
- dst_path->set_text(node->get_path_to(current));
-}
-
-void ConnectDialog::edit(Node *p_node) {
-
- node = p_node;
-
- //dst_method_list->get_popup()->clear();
-
- tree->set_selected(NULL);
- tree->set_marked(node, true);
- dst_path->set_text("");
- dst_method->set_text("");
- deferred->set_pressed(false);
- oneshot->set_pressed(false);
- cdbinds->params.clear();
- cdbinds->notify_changed();
-}
-
+/*
+Signal automatically called by parent dialog.
+*/
void ConnectDialog::ok_pressed() {
if (dst_method->get_text() == "") {
-
error->set_text(TTR("Method in target Node must be specified!"));
error->popup_centered_minsize();
return;
@@ -147,39 +109,35 @@ void ConnectDialog::ok_pressed() {
emit_signal("connected");
hide();
}
+
void ConnectDialog::_cancel_pressed() {
hide();
}
-NodePath ConnectDialog::get_dst_path() const {
-
- return dst_path->get_text();
-}
-
-bool ConnectDialog::get_deferred() const {
-
- return deferred->is_pressed();
-}
-
-bool ConnectDialog::get_oneshot() const {
-
- return oneshot->is_pressed();
-}
+/*
+Called each time a target node is selected within the target node tree.
+*/
+void ConnectDialog::_tree_node_selected() {
-StringName ConnectDialog::get_dst_method() const {
+ Node *current = tree->get_selected();
- String txt = dst_method->get_text();
- if (txt.find("(") != -1)
- txt = txt.left(txt.find("(")).strip_edges();
- return txt;
-}
+ if (!current) {
+ make_callback->hide();
+ return;
+ }
-Vector<Variant> ConnectDialog::get_binds() const {
+ if (current->get_script().is_null())
+ make_callback->hide();
+ else
+ make_callback->show();
- return cdbinds->params;
+ dst_path->set_text(source->get_path_to(current));
}
+/*
+Adds a new parameter bind to connection.
+*/
void ConnectDialog::_add_bind() {
if (cdbinds->params.size() >= VARIANT_ARG_MAX)
@@ -189,7 +147,6 @@ void ConnectDialog::_add_bind() {
Variant value;
switch (vt) {
-
case Variant::BOOL: value = false; break;
case Variant::INT: value = 0; break;
case Variant::REAL: value = 0.0; break;
@@ -203,7 +160,6 @@ void ConnectDialog::_add_bind() {
case Variant::BASIS: value = Basis(); break;
case Variant::TRANSFORM: value = Transform(); break;
case Variant::COLOR: value = Color(); break;
-
default: { ERR_FAIL(); } break;
}
@@ -213,6 +169,9 @@ void ConnectDialog::_add_bind() {
cdbinds->notify_changed();
}
+/*
+Remove parameter bind from connection.
+*/
void ConnectDialog::_remove_bind() {
String st = bind_editor->get_selected_path();
@@ -225,25 +184,106 @@ void ConnectDialog::_remove_bind() {
cdbinds->notify_changed();
}
+void ConnectDialog::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_ENTER_TREE) {
+ bind_editor->edit(cdbinds);
+ }
+}
+
+void ConnectDialog::_bind_methods() {
+
+ ClassDB::bind_method("_cancel", &ConnectDialog::_cancel_pressed);
+ ClassDB::bind_method("_tree_node_selected", &ConnectDialog::_tree_node_selected);
+ ClassDB::bind_method("_add_bind", &ConnectDialog::_add_bind);
+ ClassDB::bind_method("_remove_bind", &ConnectDialog::_remove_bind);
+
+ ADD_SIGNAL(MethodInfo("connected"));
+}
+
+Node *ConnectDialog::get_source() const {
+
+ return source;
+}
+
+StringName ConnectDialog::get_signal_name() const {
+
+ return signal;
+}
+
+NodePath ConnectDialog::get_dst_path() const {
+
+ return dst_path->get_text();
+}
+
void ConnectDialog::set_dst_node(Node *p_node) {
tree->set_selected(p_node);
}
+StringName ConnectDialog::get_dst_method_name() const {
+
+ String txt = dst_method->get_text();
+ if (txt.find("(") != -1)
+ txt = txt.left(txt.find("(")).strip_edges();
+ return txt;
+}
+
void ConnectDialog::set_dst_method(const StringName &p_method) {
dst_method->set_text(p_method);
}
-void ConnectDialog::_bind_methods() {
+Vector<Variant> ConnectDialog::get_binds() const {
- ClassDB::bind_method("_cancel", &ConnectDialog::_cancel_pressed);
- ClassDB::bind_method("_tree_node_selected", &ConnectDialog::_tree_node_selected);
+ return cdbinds->params;
+}
- ClassDB::bind_method("_add_bind", &ConnectDialog::_add_bind);
- ClassDB::bind_method("_remove_bind", &ConnectDialog::_remove_bind);
+bool ConnectDialog::get_deferred() const {
- ADD_SIGNAL(MethodInfo("connected"));
+ return deferred->is_pressed();
+}
+
+bool ConnectDialog::get_oneshot() const {
+
+ return oneshot->is_pressed();
+}
+
+/*
+Returns true if ConnectDialog is being used to edit an existing connection.
+*/
+bool ConnectDialog::is_editing() const {
+
+ return bEditMode;
+}
+
+/*
+Initialize ConnectDialog and populate fields with expected data.
+If creating a connection from scratch, sensible defaults are used.
+If editing an existing connection, previous data is retained.
+*/
+void ConnectDialog::init(Connection c, bool bEdit) {
+
+ source = static_cast<Node *>(c.source);
+ signal = c.signal;
+
+ tree->set_selected(NULL);
+ tree->set_marked(source, true);
+
+ set_dst_node(static_cast<Node *>(c.target));
+ set_dst_method(c.method);
+
+ bool bDeferred = (c.flags & CONNECT_DEFERRED) == CONNECT_DEFERRED;
+ bool bOneshot = (c.flags & CONNECT_ONESHOT) == CONNECT_ONESHOT;
+
+ deferred->set_pressed(bDeferred);
+ oneshot->set_pressed(bOneshot);
+
+ cdbinds->params.clear();
+ cdbinds->params = c.binds;
+ cdbinds->notify_changed();
+
+ bEditMode = bEdit;
}
ConnectDialog::ConnectDialog() {
@@ -261,6 +301,8 @@ ConnectDialog::ConnectDialog() {
tree = memnew(SceneTreeEditor(false));
tree->get_scene_tree()->connect("item_activated", this, "_ok");
+ tree->connect("node_selected", this, "_tree_node_selected");
+
vbc_left->add_margin_child(TTR("Connect To Node:"), tree, true);
VBoxContainer *vbc_right = memnew(VBoxContainer);
@@ -272,12 +314,10 @@ ConnectDialog::ConnectDialog() {
type_list = memnew(OptionButton);
type_list->set_h_size_flags(SIZE_EXPAND_FILL);
add_bind_hb->add_child(type_list);
-
type_list->add_item("bool", Variant::BOOL);
type_list->add_item("int", Variant::INT);
type_list->add_item("real", Variant::REAL);
type_list->add_item("string", Variant::STRING);
- //type_list->add_separator();
type_list->add_item("Vector2", Variant::VECTOR2);
type_list->add_item("Rect2", Variant::RECT2);
type_list->add_item("Vector3", Variant::VECTOR3);
@@ -286,12 +326,10 @@ ConnectDialog::ConnectDialog() {
type_list->add_item("AABB", Variant::AABB);
type_list->add_item("Basis", Variant::BASIS);
type_list->add_item("Transform", Variant::TRANSFORM);
- //type_list->add_separator();
type_list->add_item("Color", Variant::COLOR);
type_list->select(0);
Button *add_bind = memnew(Button);
-
add_bind->set_text(TTR("Add"));
add_bind_hb->add_child(add_bind);
add_bind->connect("pressed", this, "_add_bind");
@@ -318,7 +356,8 @@ ConnectDialog::ConnectDialog() {
dst_method->set_h_size_flags(SIZE_EXPAND_FILL);
dstm_hb->add_child(dst_method);
- /*dst_method_list = memnew( MenuButton );
+ /*
+ dst_method_list = memnew( MenuButton );
dst_method_list->set_text("List...");
dst_method_list->set_anchor( MARGIN_RIGHT, ANCHOR_END );
dst_method_list->set_anchor( MARGIN_LEFT, ANCHOR_END );
@@ -327,7 +366,6 @@ ConnectDialog::ConnectDialog() {
dst_method_list->set_begin( Point2( 70,59) );
dst_method_list->set_end( Point2( 15,39 ) );
*/
- //add_child(dst_method_list);
make_callback = memnew(CheckButton);
make_callback->set_toggle_mode(true);
@@ -343,8 +381,6 @@ ConnectDialog::ConnectDialog() {
oneshot->set_text(TTR("Oneshot"));
dstm_hb->add_child(oneshot);
- tree->connect("node_selected", this, "_tree_node_selected");
-
set_as_toplevel(true);
cdbinds = memnew(ConnectDialogBinds);
@@ -356,134 +392,365 @@ ConnectDialog::ConnectDialog() {
}
ConnectDialog::~ConnectDialog() {
+
memdelete(cdbinds);
}
-void ConnectionsDock::_notification(int p_what) {
-
- if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- update_tree();
- }
-}
+//ConnectionsDock ==========================
-void ConnectionsDock::_close() {
+struct _ConnectionsDockMethodInfoSort {
- hide();
-}
+ _FORCE_INLINE_ bool operator()(const MethodInfo &a, const MethodInfo &b) const {
+ return a.name < b.name;
+ }
+};
-void ConnectionsDock::_connect() {
+/*
+Post-ConnectDialog callback for creating/editing connections.
+Creates or edits connections based on state of the ConnectDialog when "Connect" is pressed.
+*/
+void ConnectionsDock::_make_or_edit_connection() {
TreeItem *it = tree->get_selected();
ERR_FAIL_COND(!it);
- String signal = it->get_metadata(0).operator Dictionary()["name"];
NodePath dst_path = connect_dialog->get_dst_path();
- Node *target = node->get_node(dst_path);
+ Node *target = selectedNode->get_node(dst_path);
ERR_FAIL_COND(!target);
- StringName dst_method = connect_dialog->get_dst_method();
+ Connection cToMake;
+ cToMake.source = connect_dialog->get_source();
+ cToMake.target = target;
+ cToMake.signal = connect_dialog->get_signal_name();
+ cToMake.method = connect_dialog->get_dst_method_name();
+ cToMake.binds = connect_dialog->get_binds();
bool defer = connect_dialog->get_deferred();
bool oshot = connect_dialog->get_oneshot();
- Vector<Variant> binds = connect_dialog->get_binds();
- PoolStringArray args = it->get_metadata(0).operator Dictionary()["args"];
- int flags = CONNECT_PERSIST | (defer ? CONNECT_DEFERRED : 0) | (oshot ? CONNECT_ONESHOT : 0);
+ cToMake.flags = CONNECT_PERSIST | (defer ? CONNECT_DEFERRED : 0) | (oshot ? CONNECT_ONESHOT : 0);
- undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"), signal, String(dst_method)));
- undo_redo->add_do_method(node, "connect", signal, target, dst_method, binds, flags);
- undo_redo->add_undo_method(node, "disconnect", signal, target, dst_method);
+ if (connect_dialog->is_editing()) {
+ _disconnect(*it);
+ _connect(cToMake);
+ } else {
+ _connect(cToMake);
+ }
+
+ if (connect_dialog->get_make_callback()) {
+ PoolStringArray args = it->get_metadata(0).operator Dictionary()["args"];
+ editor->emit_signal("script_add_function_request", target, cToMake.method, args);
+ hide();
+ }
+
+ update_tree();
+}
+
+/*
+Creates single connection w/ undo-redo functionality.
+*/
+void ConnectionsDock::_connect(Connection cToMake) {
+
+ Node *source = static_cast<Node *>(cToMake.source);
+ Node *target = static_cast<Node *>(cToMake.target);
+
+ if (!source || !target)
+ return;
+
+ undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"), String(cToMake.signal), String(cToMake.method)));
+
+ undo_redo->add_do_method(source, "connect", cToMake.signal, target, cToMake.method, cToMake.binds, cToMake.flags);
+ undo_redo->add_undo_method(source, "disconnect", cToMake.signal, target, cToMake.method);
undo_redo->add_do_method(this, "update_tree");
undo_redo->add_undo_method(this, "update_tree");
undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree
- undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
undo_redo->commit_action();
+}
- if (connect_dialog->get_make_callback()) {
+/*
+Break single connection w/ undo-redo functionality.
+*/
+void ConnectionsDock::_disconnect(TreeItem &item) {
- print_line("request connect");
- editor->emit_signal("script_add_function_request", target, dst_method, args);
- hide();
+ Connection c = item.get_metadata(0);
+ ERR_FAIL_COND(c.source != selectedNode); //shouldn't happen but...bugcheck
+
+ undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), c.signal, c.method));
+
+ undo_redo->add_do_method(selectedNode, "disconnect", c.signal, c.target, c.method);
+ undo_redo->add_undo_method(selectedNode, "connect", c.signal, c.target, c.method, c.binds, c.flags);
+ undo_redo->add_do_method(this, "update_tree");
+ undo_redo->add_undo_method(this, "update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
+
+ undo_redo->commit_action();
+}
+
+/*
+Break all conections of currently selected signal.
+Can undo-redo as a single action.
+*/
+void ConnectionsDock::_disconnect_all() {
+
+ TreeItem *item = tree->get_selected();
+
+ if (!_is_item_signal(*item))
+ return;
+
+ TreeItem *child = item->get_children();
+ String signalName = item->get_metadata(0).operator Dictionary()["name"];
+ undo_redo->create_action(vformat(TTR("Disconnect all from signal: '%s'"), signalName));
+
+ while (child) {
+ Connection c = child->get_metadata(0);
+ undo_redo->add_do_method(selectedNode, "disconnect", c.signal, c.target, c.method);
+ undo_redo->add_undo_method(selectedNode, "connect", c.signal, c.target, c.method, c.binds, c.flags);
+ child = child->get_next();
}
- update_tree();
+ undo_redo->add_do_method(this, "update_tree");
+ undo_redo->add_undo_method(this, "update_tree");
+ undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
+ undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree");
+
+ undo_redo->commit_action();
}
-void ConnectionsDock::_connect_pressed() {
+void ConnectionsDock::_tree_item_selected() {
TreeItem *item = tree->get_selected();
- if (!item) {
- //no idea how this happened, but disable
+ if (!item) { //Unlikely. Disable button just in case.
+ connect_button->set_text(TTR("Connect..."));
connect_button->set_disabled(true);
+ } else if (_is_item_signal(*item)) {
+ connect_button->set_text(TTR("Connect..."));
+ connect_button->set_disabled(false);
+ } else {
+ connect_button->set_text(TTR("Disconnect"));
+ connect_button->set_disabled(false);
+ }
+}
+
+void ConnectionsDock::_tree_item_activated() { //"Activation" on double-click.
+
+ TreeItem *item = tree->get_selected();
+
+ if (!item)
return;
+
+ if (_is_item_signal(*item)) {
+ _open_connection_dialog(*item);
+ } else {
+ _go_to_script(*item);
}
- if (item->get_parent() == tree->get_root() || item->get_parent()->get_parent() == tree->get_root()) {
- //a signal - connect
- String signal = item->get_metadata(0).operator Dictionary()["name"];
- String signalname = signal;
- String midname = node->get_name();
- for (int i = 0; i < midname.length(); i++) {
- CharType c = midname[i];
- if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') {
- //all good
- } else if (c == ' ') {
+}
+
+bool ConnectionsDock::_is_item_signal(TreeItem &item) {
+
+ return (item.get_parent() == tree->get_root() || item.get_parent()->get_parent() == tree->get_root());
+}
+
+/*
+Open connection dialog with TreeItem data to CREATE a brand-new connection.
+*/
+void ConnectionsDock::_open_connection_dialog(TreeItem &item) {
+
+ String signal = item.get_metadata(0).operator Dictionary()["name"];
+ String signalname = signal;
+ String midname = selectedNode->get_name();
+ for (int i = 0; i < midname.length(); i++) { //TODO: Regex filter may be cleaner.
+ CharType c = midname[i];
+ if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_')) {
+ if (c == ' ') {
+ //Replace spaces with underlines.
c = '_';
} else {
+ //Remove any other characters.
midname.remove(i);
i--;
continue;
}
-
- midname[i] = c;
}
+ midname[i] = c;
+ }
+
+ Node *dst_node = selectedNode->get_owner() ? selectedNode->get_owner() : selectedNode;
+ StringName dst_method = "_on_" + midname + "_" + signal;
+
+ Connection c;
+ c.source = selectedNode;
+ c.signal = StringName(signalname);
+ c.target = dst_node;
+ c.method = dst_method;
+
+ connect_dialog->init(c);
+ connect_dialog->set_title(TTR("Connect Signal: ") + signalname);
+ connect_dialog->popup_centered_ratio();
+}
+
+/*
+Open connection dialog with Connection data to EDIT an existing connection.
+*/
+void ConnectionsDock::_open_connection_dialog(Connection cToEdit) {
+
+ Node *src = static_cast<Node *>(cToEdit.source);
+ Node *dst = static_cast<Node *>(cToEdit.target);
- connect_dialog->edit(node);
+ if (src && dst) {
+ connect_dialog->init(cToEdit, true);
+ connect_dialog->set_title(TTR("Edit Connection: ") + cToEdit.signal);
connect_dialog->popup_centered_ratio();
- connect_dialog->set_title(TTR("Connecting Signal:") + " " + signalname);
- connect_dialog->set_dst_method("_on_" + midname + "_" + signal);
- connect_dialog->set_dst_node(node->get_owner() ? node->get_owner() : node);
+ }
+}
+
+/*
+Open slot method location in script editor.
+*/
+void ConnectionsDock::_go_to_script(TreeItem &item) {
+
+ if (_is_item_signal(item))
+ return;
+
+ Connection c = item.get_metadata(0);
+ ERR_FAIL_COND(c.source != selectedNode); //shouldn't happen but...bugcheck
+
+ if (!c.target)
+ return;
+
+ Ref<Script> script = c.target->get_script();
+
+ if (script.is_null())
+ return;
+
+ if (script.is_valid() && ScriptEditor::get_singleton()->script_goto_method(script, c.method)) {
+ editor->call("_editor_select", EditorNode::EDITOR_SCRIPT);
+ }
+}
+
+void ConnectionsDock::_handle_signal_menu_option(int option) {
+
+ TreeItem *item = tree->get_selected();
+
+ if (!item)
+ return;
+
+ switch (option) {
+ case CONNECT: {
+ _open_connection_dialog(*item);
+ } break;
+ case DISCONNECT_ALL: {
+ StringName signalName = item->get_metadata(0).operator Dictionary()["name"];
+ disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from the \"") + signalName + "\" signal?");
+ disconnect_all_dialog->popup_centered();
+ } break;
+ }
+}
+
+void ConnectionsDock::_handle_slot_menu_option(int option) {
+
+ TreeItem *item = tree->get_selected();
+
+ if (!item)
+ return;
+
+ switch (option) {
+ case EDIT: {
+ Connection c = item->get_metadata(0);
+ _open_connection_dialog(c);
+ } break;
+ case GO_TO_SCRIPT: {
+ _go_to_script(*item);
+ } break;
+ case DISCONNECT: {
+ _disconnect(*item);
+ update_tree();
+ } break;
+ }
+}
+
+void ConnectionsDock::_rmb_pressed(Vector2 position) {
+ TreeItem *item = tree->get_selected();
+
+ if (!item)
+ return;
+
+ Vector2 global_position = tree->get_global_position() + position;
+
+ if (_is_item_signal(*item)) {
+ signal_menu->set_position(global_position);
+ signal_menu->popup();
} else {
- //a slot- disconnect
- Connection c = item->get_metadata(0);
- ERR_FAIL_COND(c.source != node); //shouldn't happen but...bugcheck
-
- undo_redo->create_action(vformat(TTR("Disconnect '%s' from '%s'"), c.signal, c.method));
- undo_redo->add_do_method(node, "disconnect", c.signal, c.target, c.method);
- undo_redo->add_undo_method(node, "connect", c.signal, c.target, c.method, Vector<Variant>(), c.flags);
- undo_redo->add_do_method(this, "update_tree");
- undo_redo->add_undo_method(this, "update_tree");
- undo_redo->add_do_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree
- undo_redo->add_undo_method(EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor(), "update_tree"); //to force redraw of scene tree
- undo_redo->commit_action();
-
- c.source->disconnect(c.signal, c.target, c.method);
+ slot_menu->set_position(global_position);
+ slot_menu->popup();
+ }
+}
+
+void ConnectionsDock::_close() {
+
+ hide();
+}
+
+void ConnectionsDock::_connect_pressed() {
+
+ TreeItem *item = tree->get_selected();
+ if (!item) {
+ connect_button->set_disabled(true);
+ return;
+ }
+
+ if (_is_item_signal(*item)) {
+ _open_connection_dialog(*item);
+ } else {
+ _disconnect(*item);
update_tree();
}
}
-struct _ConnectionsDockMethodInfoSort {
+void ConnectionsDock::_notification(int p_what) {
- _FORCE_INLINE_ bool operator()(const MethodInfo &a, const MethodInfo &b) const {
- return a.name < b.name;
+ if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+ update_tree();
}
-};
+}
+
+void ConnectionsDock::_bind_methods() {
+
+ ClassDB::bind_method("_make_or_edit_connection", &ConnectionsDock::_make_or_edit_connection);
+ ClassDB::bind_method("_disconnect_all", &ConnectionsDock::_disconnect_all);
+ ClassDB::bind_method("_tree_item_selected", &ConnectionsDock::_tree_item_selected);
+ ClassDB::bind_method("_tree_item_activated", &ConnectionsDock::_tree_item_activated);
+ ClassDB::bind_method("_handle_signal_menu_option", &ConnectionsDock::_handle_signal_menu_option);
+ ClassDB::bind_method("_handle_slot_menu_option", &ConnectionsDock::_handle_slot_menu_option);
+ ClassDB::bind_method("_rmb_pressed", &ConnectionsDock::_rmb_pressed);
+ ClassDB::bind_method("_close", &ConnectionsDock::_close);
+ ClassDB::bind_method("_connect_pressed", &ConnectionsDock::_connect_pressed);
+ ClassDB::bind_method("update_tree", &ConnectionsDock::update_tree);
+}
+
+void ConnectionsDock::set_node(Node *p_node) {
+
+ selectedNode = p_node;
+ update_tree();
+}
void ConnectionsDock::update_tree() {
tree->clear();
- if (!node)
+ if (!selectedNode)
return;
TreeItem *root = tree->create_item();
List<MethodInfo> node_signals;
- node->get_signal_list(&node_signals);
+ selectedNode->get_signal_list(&node_signals);
//node_signals.sort_custom<_ConnectionsDockMethodInfoSort>();
bool did_script = false;
- StringName base = node->get_class();
+ StringName base = selectedNode->get_class();
while (base) {
@@ -493,7 +760,7 @@ void ConnectionsDock::update_tree() {
if (!did_script) {
- Ref<Script> scr = node->get_script();
+ Ref<Script> scr = selectedNode->get_script();
if (scr.is_valid()) {
scr->get_script_signal_list(&node_signals);
if (scr->get_path().is_resource_file())
@@ -563,7 +830,7 @@ void ConnectionsDock::update_tree() {
item->set_icon(0, get_icon("Signal", "EditorIcons"));
List<Object::Connection> connections;
- node->get_signal_connection_list(mi.name, &connections);
+ selectedNode->get_signal_connection_list(mi.name, &connections);
for (List<Object::Connection>::Element *F = connections.front(); F; F = F->next()) {
@@ -575,7 +842,7 @@ void ConnectionsDock::update_tree() {
if (!target)
continue;
- String path = String(node->get_path_to(target)) + " :: " + c.method + "()";
+ String path = String(selectedNode->get_path_to(target)) + " :: " + c.method + "()";
if (c.flags & CONNECT_DEFERRED)
path += " (deferred)";
if (c.flags & CONNECT_ONESHOT)
@@ -610,88 +877,6 @@ void ConnectionsDock::update_tree() {
connect_button->set_disabled(true);
}
-void ConnectionsDock::set_node(Node *p_node) {
-
- node = p_node;
- update_tree();
-}
-
-void ConnectionsDock::_something_selected() {
-
- TreeItem *item = tree->get_selected();
- if (!item) {
- //no idea how this happened, but disable
- connect_button->set_text(TTR("Connect..."));
- connect_button->set_disabled(true);
-
- } else if (item->get_parent() == tree->get_root() || item->get_parent()->get_parent() == tree->get_root()) {
- //a signal - connect
- connect_button->set_text(TTR("Connect..."));
- connect_button->set_disabled(false);
-
- } else {
- //a slot- disconnect
- connect_button->set_text(TTR("Disconnect"));
- connect_button->set_disabled(false);
- }
-}
-
-void ConnectionsDock::_something_activated() {
-
- TreeItem *item = tree->get_selected();
-
- if (!item)
- return;
-
- if (item->get_parent() == tree->get_root() || item->get_parent()->get_parent() == tree->get_root()) {
- // a signal - connect
- String signal = item->get_metadata(0).operator Dictionary()["name"];
- String midname = node->get_name();
- for (int i = 0; i < midname.length(); i++) {
- CharType c = midname[i];
- if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') {
- //all good
- } else if (c == ' ') {
- c = '_';
- } else {
- midname.remove(i);
- i--;
- continue;
- }
-
- midname[i] = c;
- }
-
- connect_dialog->edit(node);
- connect_dialog->popup_centered_ratio();
- connect_dialog->set_dst_method("_on_" + midname + "_" + signal);
- connect_dialog->set_dst_node(node->get_owner() ? node->get_owner() : node);
- } else {
- // a slot - go to target method
- Connection c = item->get_metadata(0);
- ERR_FAIL_COND(c.source != node); //shouldn't happen but...bugcheck
-
- if (!c.target)
- return;
-
- Ref<Script> script = c.target->get_script();
-
- if (script.is_valid() && ScriptEditor::get_singleton()->script_goto_method(script, c.method)) {
- editor->call("_editor_select", EditorNode::EDITOR_SCRIPT);
- }
- }
-}
-
-void ConnectionsDock::_bind_methods() {
-
- ClassDB::bind_method("_connect", &ConnectionsDock::_connect);
- ClassDB::bind_method("_something_selected", &ConnectionsDock::_something_selected);
- ClassDB::bind_method("_something_activated", &ConnectionsDock::_something_activated);
- ClassDB::bind_method("_close", &ConnectionsDock::_close);
- ClassDB::bind_method("_connect_pressed", &ConnectionsDock::_connect_pressed);
- ClassDB::bind_method("update_tree", &ConnectionsDock::update_tree);
-}
-
ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
editor = p_editor;
@@ -705,6 +890,7 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
tree->set_hide_root(true);
vbc->add_child(tree);
tree->set_v_size_flags(SIZE_EXPAND_FILL);
+ tree->set_allow_rmb_select(true);
connect_button = memnew(Button);
connect_button->set_text(TTR("Connect"));
@@ -713,15 +899,29 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
hb->add_spacer();
hb->add_child(connect_button);
connect_button->connect("pressed", this, "_connect_pressed");
- //add_child(tree);
connect_dialog = memnew(ConnectDialog);
connect_dialog->set_as_toplevel(true);
add_child(connect_dialog);
- remove_confirm = memnew(ConfirmationDialog);
- remove_confirm->set_as_toplevel(true);
- add_child(remove_confirm);
+ disconnect_all_dialog = memnew(ConfirmationDialog);
+ disconnect_all_dialog->set_as_toplevel(true);
+ add_child(disconnect_all_dialog);
+ disconnect_all_dialog->connect("confirmed", this, "_disconnect_all");
+ disconnect_all_dialog->set_text(TTR("Are you sure you want to remove all connections from this signal?"));
+
+ signal_menu = memnew(PopupMenu);
+ add_child(signal_menu);
+ signal_menu->connect("id_pressed", this, "_handle_signal_menu_option");
+ signal_menu->add_item(TTR("Connect..."), CONNECT);
+ signal_menu->add_item(TTR("Disconnect All"), DISCONNECT_ALL);
+
+ slot_menu = memnew(PopupMenu);
+ add_child(slot_menu);
+ slot_menu->connect("id_pressed", this, "_handle_slot_menu_option");
+ slot_menu->add_item(TTR("Edit..."), EDIT);
+ slot_menu->add_item(TTR("Go To Method"), GO_TO_SCRIPT);
+ slot_menu->add_item(TTR("Disconnect"), DISCONNECT);
/*
node_only->set_anchor( MARGIN_TOP, ANCHOR_END );
@@ -732,10 +932,10 @@ ConnectionsDock::ConnectionsDock(EditorNode *p_editor) {
node_only->set_end( Point2( 10,44) );
*/
- remove_confirm->connect("confirmed", this, "_remove_confirm");
- connect_dialog->connect("connected", this, "_connect");
- tree->connect("item_selected", this, "_something_selected");
- tree->connect("item_activated", this, "_something_activated");
+ connect_dialog->connect("connected", this, "_make_or_edit_connection");
+ tree->connect("item_selected", this, "_tree_item_selected");
+ tree->connect("item_activated", this, "_tree_item_activated");
+ tree->connect("item_rmb_selected", this, "_rmb_pressed");
add_constant_override("separation", 3 * EDSCALE);
}
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h
index 5e26e00f67..932ff693e4 100644
--- a/editor/connections_dialog.h
+++ b/editor/connections_dialog.h
@@ -28,6 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+/**
+@author Juan Linietsky <reduzio@gmail.com>
+*/
+
#ifndef CONNECTIONS_DIALOG_H
#define CONNECTIONS_DIALOG_H
@@ -42,27 +46,28 @@
#include "scene/gui/tree.h"
#include "undo_redo.h"
-/**
-@author Juan Linietsky <reduzio@gmail.com>
-*/
-
+class PopupMenu;
class ConnectDialogBinds;
class ConnectDialog : public ConfirmationDialog {
GDCLASS(ConnectDialog, ConfirmationDialog);
- ConfirmationDialog *error;
+ Node *source;
+ StringName signal;
LineEdit *dst_path;
LineEdit *dst_method;
+ ConnectDialogBinds *cdbinds;
+ bool bEditMode;
+
SceneTreeEditor *tree;
+ ConfirmationDialog *error;
+ PropertyEditor *bind_editor;
OptionButton *type_list;
CheckButton *deferred;
CheckButton *oneshot;
CheckButton *make_callback;
- PropertyEditor *bind_editor;
- Node *node;
- ConnectDialogBinds *cdbinds;
+
void ok_pressed();
void _cancel_pressed();
void _tree_node_selected();
@@ -74,37 +79,71 @@ protected:
static void _bind_methods();
public:
- bool get_make_callback() { return make_callback->is_visible() && make_callback->is_pressed(); }
+ Node *get_source() const;
+ StringName get_signal_name() const;
NodePath get_dst_path() const;
- StringName get_dst_method() const;
+ void set_dst_node(Node *p_node);
+ StringName get_dst_method_name() const;
+ void set_dst_method(const StringName &p_method);
+ Vector<Variant> get_binds() const;
+
+ bool get_make_callback() { return make_callback->is_visible() && make_callback->is_pressed(); }
bool get_deferred() const;
bool get_oneshot() const;
- Vector<Variant> get_binds() const;
- void set_dst_method(const StringName &p_method);
- void set_dst_node(Node *p_node);
+ bool is_editing() const;
- void edit(Node *p_node);
+ void init(Connection c, bool bEdit = false);
ConnectDialog();
~ConnectDialog();
};
+//========================================
+
class ConnectionsDock : public VBoxContainer {
GDCLASS(ConnectionsDock, VBoxContainer);
- Button *connect_button;
- EditorNode *editor;
- Node *node;
+ //Right-click Pop-up Menu Options.
+ enum SignalMenuOption {
+ CONNECT,
+ DISCONNECT_ALL
+ };
+
+ enum SlotMenuOption {
+ EDIT,
+ GO_TO_SCRIPT,
+ DISCONNECT
+ };
+
+ Node *selectedNode;
Tree *tree;
- ConfirmationDialog *remove_confirm;
+ EditorNode *editor;
+
+ ConfirmationDialog *disconnect_all_dialog;
ConnectDialog *connect_dialog;
+ Button *connect_button;
+ PopupMenu *signal_menu;
+ PopupMenu *slot_menu;
+ UndoRedo *undo_redo;
+
+ void _make_or_edit_connection();
+ void _connect(Connection cToMake);
+ void _disconnect(TreeItem &item);
+ void _disconnect_all();
+ void _tree_item_selected();
+ void _tree_item_activated();
+ bool _is_item_signal(TreeItem &item);
+
+ void _open_connection_dialog(TreeItem &item);
+ void _open_connection_dialog(Connection cToEdit);
+ void _go_to_script(TreeItem &item);
+
+ void _handle_signal_menu_option(int option);
+ void _handle_slot_menu_option(int option);
+ void _rmb_pressed(Vector2 position);
void _close();
- void _connect();
- void _something_selected();
- void _something_activated();
- UndoRedo *undo_redo;
protected:
void _connect_pressed();
@@ -113,9 +152,7 @@ protected:
public:
void set_undoredo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; }
-
void set_node(Node *p_node);
- String get_selected_type();
void update_tree();
ConnectionsDock(EditorNode *p_editor = NULL);
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 78fb35e354..36978e37a5 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -87,7 +87,14 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/create_new_node_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/create_new_node_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
if (p_dont_clear) {
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 953d787322..c4a17d5402 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -504,25 +504,25 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<
void DependencyRemoveDialog::ok_pressed() {
+ for (int i = 0; i < files_to_delete.size(); ++i) {
+ if (ResourceCache::has(files_to_delete[i])) {
+ Resource *res = ResourceCache::get(files_to_delete[i]);
+ res->set_path("");
+ }
+ String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/");
+ print_line("Moving to trash: " + path);
+ Error err = OS::get_singleton()->move_to_trash(path);
+ if (err != OK) {
+ EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + files_to_delete[i] + "\n");
+ }
+ }
+
if (dirs_to_delete.size() == 0) {
//If we only deleted files we should only need to tell the file system about the files we touched.
for (int i = 0; i < files_to_delete.size(); ++i)
EditorFileSystem::get_singleton()->update_file(files_to_delete[i]);
} else {
- for (int i = 0; i < files_to_delete.size(); ++i) {
- if (ResourceCache::has(files_to_delete[i])) {
- Resource *res = ResourceCache::get(files_to_delete[i]);
- res->set_path("");
- }
- String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/");
- print_line("Moving to trash: " + path);
- Error err = OS::get_singleton()->move_to_trash(path);
- if (err != OK) {
- EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + files_to_delete[i] + "\n");
- }
- }
-
for (int i = 0; i < dirs_to_delete.size(); ++i) {
String path = OS::get_singleton()->get_resource_dir() + dirs_to_delete[i].replace_first("res://", "/");
print_line("Moving to trash: " + path);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index a2f5c1aa1a..708bff252a 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -33,6 +33,8 @@
#include "editor_node.h"
#include "global_constants.h"
#include "project_settings.h"
+#include "scene/main/viewport.h"
+#include "scene/resources/packed_scene.h"
#define PREVIEW_LIST_MAX_SIZE 10
@@ -155,8 +157,8 @@ void EditorAutoloadSettings::_autoload_edited() {
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", selected_autoload, order);
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "clear", name);
- undo_redo->add_do_method(this, "update_autoload");
- undo_redo->add_undo_method(this, "update_autoload");
+ undo_redo->add_do_method(this, "call_deferred", "update_autoload");
+ undo_redo->add_undo_method(this, "call_deferred", "update_autoload");
undo_redo->add_do_method(this, "emit_signal", autoload_changed);
undo_redo->add_undo_method(this, "emit_signal", autoload_changed);
@@ -187,8 +189,8 @@ void EditorAutoloadSettings::_autoload_edited() {
undo_redo->add_do_method(ProjectSettings::get_singleton(), "set_order", base, order);
undo_redo->add_undo_method(ProjectSettings::get_singleton(), "set_order", base, order);
- undo_redo->add_do_method(this, "update_autoload");
- undo_redo->add_undo_method(this, "update_autoload");
+ undo_redo->add_do_method(this, "call_deferred", "update_autoload");
+ undo_redo->add_undo_method(this, "call_deferred", "update_autoload");
undo_redo->add_do_method(this, "emit_signal", autoload_changed);
undo_redo->add_undo_method(this, "emit_signal", autoload_changed);
@@ -296,6 +298,18 @@ void EditorAutoloadSettings::update_autoload() {
updating_autoload = true;
+ Map<String, AutoLoadInfo> to_remove;
+ Map<String, AutoLoadInfo> to_remove_singleton;
+ List<AutoLoadInfo> to_add;
+ List<String> to_add_singleton; // Only for when the node is still the same
+
+ for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) {
+ to_remove.insert(E->get().name, E->get());
+ if (E->get().is_singleton) {
+ to_remove_singleton.insert(E->get().name, E->get());
+ }
+ }
+
autoload_cache.clear();
tree->clear();
@@ -317,19 +331,44 @@ void EditorAutoloadSettings::update_autoload() {
if (name.empty())
continue;
+ AutoLoadInfo old_info;
+ if (to_remove.has(name)) {
+ old_info = to_remove[name];
+ }
+
AutoLoadInfo info;
- info.name = pi.name;
- info.order = ProjectSettings::get_singleton()->get_order(pi.name);
+ info.is_singleton = path.begins_with("*");
- autoload_cache.push_back(info);
+ if (info.is_singleton) {
+ path = path.substr(1, path.length());
+ }
- bool global = false;
+ info.name = name;
+ info.path = path;
+ info.order = ProjectSettings::get_singleton()->get_order(pi.name);
- if (path.begins_with("*")) {
- global = true;
- path = path.substr(1, path.length());
+ if (old_info.name == info.name) {
+ if (old_info.path == info.path) {
+ // Still the same resource, check singleton status
+ to_remove.erase(name);
+ if (info.is_singleton) {
+ if (old_info.is_singleton) {
+ to_remove_singleton.erase(name);
+ } else {
+ to_add_singleton.push_back(name);
+ }
+ }
+ } else {
+ // Resource changed
+ to_add.push_back(info);
+ }
+ } else {
+ // New autoload
+ to_add.push_back(info);
}
+ autoload_cache.push_back(info);
+
TreeItem *item = tree->create_item(root);
item->set_text(0, name);
item->set_editable(0, true);
@@ -340,7 +379,7 @@ void EditorAutoloadSettings::update_autoload() {
item->set_cell_mode(2, TreeItem::CELL_MODE_CHECK);
item->set_editable(2, true);
item->set_text(2, TTR("Enable"));
- item->set_checked(2, global);
+ item->set_checked(2, info.is_singleton);
item->add_button(3, get_icon("FileList", "EditorIcons"), BUTTON_OPEN);
item->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP);
item->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN);
@@ -348,6 +387,77 @@ void EditorAutoloadSettings::update_autoload() {
item->set_selectable(3, false);
}
+ // Remove autoload constants
+ for (Map<String, AutoLoadInfo>::Element *E = to_remove_singleton.front(); E; E = E->next()) {
+ for (int i = 0; i < ScriptServer::get_language_count(); i++) {
+ ScriptServer::get_language(i)->remove_named_global_constant(E->get().name);
+ }
+ }
+
+ // Remove obsolete nodes from the tree
+ for (Map<String, AutoLoadInfo>::Element *E = to_remove.front(); E; E = E->next()) {
+ AutoLoadInfo &info = E->get();
+ Node *al = get_node("/root/" + info.name);
+ ERR_CONTINUE(!al);
+ get_tree()->get_root()->remove_child(al);
+ memdelete(al);
+ }
+
+ // Register new singletons already in the tree
+ for (List<String>::Element *E = to_add_singleton.front(); E; E = E->next()) {
+ Node *al = get_node("/root/" + E->get());
+ ERR_CONTINUE(!al);
+ for (int i = 0; i < ScriptServer::get_language_count(); i++) {
+ ScriptServer::get_language(i)->add_named_global_constant(E->get(), al);
+ }
+ }
+
+ // Add new nodes to the tree
+ List<Node *> nodes_to_add;
+ for (List<AutoLoadInfo>::Element *E = to_add.front(); E; E = E->next()) {
+ AutoLoadInfo &info = E->get();
+
+ RES res = ResourceLoader::load(info.path);
+ ERR_EXPLAIN("Can't autoload: " + info.path);
+ ERR_CONTINUE(res.is_null());
+ Node *n = NULL;
+ if (res->is_class("PackedScene")) {
+ Ref<PackedScene> ps = res;
+ n = ps->instance();
+ } else if (res->is_class("Script")) {
+ Ref<Script> s = res;
+ StringName ibt = s->get_instance_base_type();
+ bool valid_type = ClassDB::is_parent_class(ibt, "Node");
+ ERR_EXPLAIN("Script does not inherit a Node: " + info.path);
+ ERR_CONTINUE(!valid_type);
+
+ Object *obj = ClassDB::instance(ibt);
+
+ ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt));
+ ERR_CONTINUE(obj == NULL);
+
+ n = Object::cast_to<Node>(obj);
+ n->set_script(s.get_ref_ptr());
+ }
+
+ ERR_EXPLAIN("Path in autoload not a node or script: " + info.path);
+ ERR_CONTINUE(!n);
+ n->set_name(info.name);
+
+ //defer so references are all valid on _ready()
+ nodes_to_add.push_back(n);
+
+ if (info.is_singleton) {
+ for (int i = 0; i < ScriptServer::get_language_count(); i++) {
+ ScriptServer::get_language(i)->add_named_global_constant(info.name, n);
+ }
+ }
+ }
+
+ for (List<Node *>::Element *E = nodes_to_add.front(); E; E = E->next()) {
+ get_tree()->get_root()->add_child(E->get());
+ }
+
updating_autoload = false;
}
@@ -592,6 +702,36 @@ void EditorAutoloadSettings::_bind_methods() {
EditorAutoloadSettings::EditorAutoloadSettings() {
+ // Make first cache
+ List<PropertyInfo> props;
+ ProjectSettings::get_singleton()->get_property_list(&props);
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
+
+ const PropertyInfo &pi = E->get();
+
+ if (!pi.name.begins_with("autoload/"))
+ continue;
+
+ String name = pi.name.get_slice("/", 1);
+ String path = ProjectSettings::get_singleton()->get(pi.name);
+
+ if (name.empty())
+ continue;
+
+ AutoLoadInfo info;
+ info.is_singleton = path.begins_with("*");
+
+ if (info.is_singleton) {
+ path = path.substr(1, path.length());
+ }
+
+ info.name = name;
+ info.path = path;
+ info.order = ProjectSettings::get_singleton()->get_order(pi.name);
+
+ autoload_cache.push_back(info);
+ }
+
autoload_changed = "autoload_changed";
updating_autoload = false;
diff --git a/editor/editor_autoload_settings.h b/editor/editor_autoload_settings.h
index 6f622de6d5..1797c10e61 100644
--- a/editor/editor_autoload_settings.h
+++ b/editor/editor_autoload_settings.h
@@ -50,6 +50,8 @@ class EditorAutoloadSettings : public VBoxContainer {
struct AutoLoadInfo {
String name;
+ String path;
+ bool is_singleton;
int order;
bool operator==(const AutoLoadInfo &p_info) {
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 37a35b6ebf..4ac3e33cb9 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -364,6 +364,14 @@ void EditorData::notify_edited_scene_changed() {
}
}
+void EditorData::notify_resource_saved(const Ref<Resource> &p_resource) {
+
+ for (int i = 0; i < editor_plugins.size(); i++) {
+
+ editor_plugins[i]->notify_resource_saved(p_resource);
+ }
+}
+
void EditorData::clear_editor_states() {
for (int i = 0; i < editor_plugins.size(); i++) {
@@ -890,7 +898,7 @@ Array EditorSelection::_get_transformable_selected_nodes() {
return ret;
}
-Array EditorSelection::_get_selected_nodes() {
+Array EditorSelection::get_selected_nodes() {
Array ret;
@@ -908,7 +916,7 @@ void EditorSelection::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear"), &EditorSelection::clear);
ClassDB::bind_method(D_METHOD("add_node", "node"), &EditorSelection::add_node);
ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node);
- ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::_get_selected_nodes);
+ ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::get_selected_nodes);
ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"), &EditorSelection::_get_transformable_selected_nodes);
ClassDB::bind_method(D_METHOD("_emit_change"), &EditorSelection::_emit_change);
ADD_SIGNAL(MethodInfo("selection_changed"));
diff --git a/editor/editor_data.h b/editor/editor_data.h
index 1a498a6150..f020d07ea7 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -204,6 +204,7 @@ public:
void save_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history, const Dictionary &p_custom);
Dictionary restore_edited_scene_state(EditorSelection *p_selection, EditorHistory *p_history);
void notify_edited_scene_changed();
+ void notify_resource_saved(const Ref<Resource> &p_resource);
EditorData();
};
@@ -225,7 +226,6 @@ private:
List<Node *> selected_node_list;
void _update_nl();
- Array _get_selected_nodes();
Array _get_transformable_selected_nodes();
void _emit_change();
@@ -233,6 +233,7 @@ protected:
static void _bind_methods();
public:
+ Array get_selected_nodes();
void add_node(Node *p_node);
void remove_node(Node *p_node);
bool is_selected(Node *) const;
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index 2ec3cdb08f..26f16e282e 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -85,6 +85,20 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
m_name->set_spacing(DynamicFont::SPACING_BOTTOM, -EDSCALE); \
MAKE_FALLBACKS(m_name);
+#define MAKE_BOLD_FONT(m_name, m_size) \
+ Ref<DynamicFont> m_name; \
+ m_name.instance(); \
+ m_name->set_size(m_size); \
+ if (CustomFont.is_valid()) { \
+ m_name->set_font_data(CustomFontBold); \
+ m_name->add_fallback(DefaultFontBold); \
+ } else { \
+ m_name->set_font_data(DefaultFontBold); \
+ } \
+ m_name->set_spacing(DynamicFont::SPACING_TOP, -EDSCALE); \
+ m_name->set_spacing(DynamicFont::SPACING_BOTTOM, -EDSCALE); \
+ MAKE_FALLBACKS(m_name);
+
#define MAKE_SOURCE_FONT(m_name, m_size) \
Ref<DynamicFont> m_name; \
m_name.instance(); \
@@ -102,25 +116,37 @@ static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p
void editor_register_fonts(Ref<Theme> p_theme) {
/* Custom font */
- String custom_font = EditorSettings::get_singleton()->get("interface/editor/main_font");
DynamicFontData::Hinting font_hinting = (DynamicFontData::Hinting)(int)EditorSettings::get_singleton()->get("interface/editor/main_font_hinting");
+
+ String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font");
Ref<DynamicFontData> CustomFont;
- if (custom_font.length() > 0) {
+ if (custom_font_path.length() > 0) {
CustomFont.instance();
CustomFont->set_hinting(font_hinting);
- CustomFont->set_font_path(custom_font);
+ CustomFont->set_font_path(custom_font_path);
CustomFont->set_force_autohinter(true); //just looks better..i think?
}
+ /* Custom Bold font */
+
+ String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold");
+ Ref<DynamicFontData> CustomFontBold;
+ if (custom_font_path_bold.length() > 0) {
+ CustomFontBold.instance();
+ CustomFontBold->set_hinting(font_hinting);
+ CustomFontBold->set_font_path(custom_font_path_bold);
+ CustomFontBold->set_force_autohinter(true); //just looks better..i think?
+ }
+
/* Custom source code font */
- String custom_font_source = EditorSettings::get_singleton()->get("interface/editor/code_font");
+ String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font");
DynamicFontData::Hinting font_source_hinting = (DynamicFontData::Hinting)(int)EditorSettings::get_singleton()->get("interface/editor/code_font_hinting");
Ref<DynamicFontData> CustomFontSource;
- if (custom_font_source.length() > 0) {
+ if (custom_font_path_source.length() > 0) {
CustomFontSource.instance();
CustomFontSource->set_hinting(font_source_hinting);
- CustomFontSource->set_font_path(custom_font_source);
+ CustomFontSource->set_font_path(custom_font_path_source);
}
/* Droid Sans */
@@ -131,6 +157,12 @@ void editor_register_fonts(Ref<Theme> p_theme) {
DefaultFont->set_font_ptr(_font_NotoSansUI_Regular, _font_NotoSansUI_Regular_size);
DefaultFont->set_force_autohinter(true); //just looks better..i think?
+ Ref<DynamicFontData> DefaultFontBold;
+ DefaultFontBold.instance();
+ DefaultFont->set_hinting(font_hinting);
+ DefaultFontBold->set_font_ptr(_font_NotoSansUI_Bold, _font_NotoSansUI_Bold_size);
+ DefaultFontBold->set_force_autohinter(true); // just looks better..i think?
+
Ref<DynamicFontData> FontFallback;
FontFallback.instance();
FontFallback->set_hinting(font_hinting);
@@ -170,29 +202,38 @@ void editor_register_fonts(Ref<Theme> p_theme) {
//dfd->set_force_autohinter(true); //just looks better..i think?
int default_font_size = int(EditorSettings::get_singleton()->get("interface/editor/main_font_size")) * EDSCALE;
- MAKE_DEFAULT_FONT(df, default_font_size);
+ // Default font
+ MAKE_DEFAULT_FONT(df, default_font_size);
p_theme->set_default_theme_font(df);
- MAKE_DEFAULT_FONT(df_title, default_font_size + 2 * EDSCALE);
+ // Bold font
+ MAKE_BOLD_FONT(df_bold, default_font_size);
+ p_theme->set_font("bold", "EditorFonts", df_bold);
+
+ // Title font
+ MAKE_BOLD_FONT(df_title, default_font_size + 2 * EDSCALE);
p_theme->set_font("title", "EditorFonts", df_title);
- MAKE_DEFAULT_FONT(df_doc_title, int(EDITOR_DEF("text_editor/help/help_title_font_size", 23)) * EDSCALE);
+ // Doc font
+ MAKE_BOLD_FONT(df_doc_title, int(EDITOR_DEF("text_editor/help/help_title_font_size", 23)) * EDSCALE);
MAKE_DEFAULT_FONT(df_doc, int(EDITOR_DEF("text_editor/help/help_font_size", 15)) * EDSCALE);
p_theme->set_font("doc", "EditorFonts", df_doc);
p_theme->set_font("doc_title", "EditorFonts", df_doc_title);
+ MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_DEF("text_editor/help/help_source_font_size", 14)) * EDSCALE);
+ p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
+
+ // Ruler font
MAKE_DEFAULT_FONT(df_rulers, 8 * EDSCALE);
p_theme->set_font("rulers", "EditorFonts", df_rulers);
+ // Code font
MAKE_SOURCE_FONT(df_code, int(EditorSettings::get_singleton()->get("interface/editor/code_font_size")) * EDSCALE);
p_theme->set_font("source", "EditorFonts", df_code);
- MAKE_SOURCE_FONT(df_doc_code, int(EDITOR_DEF("text_editor/help/help_source_font_size", 14)) * EDSCALE);
- p_theme->set_font("doc_source", "EditorFonts", df_doc_code);
-
MAKE_SOURCE_FONT(df_output_code, int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE);
p_theme->set_font("output_source", "EditorFonts", df_output_code);
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index f3be02a8c7..f9b104cdae 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -526,18 +526,7 @@ void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
void EditorHelp::_search(const String &) {
- if (search->get_text() == "")
- return;
-
- String stext = search->get_text();
- bool keep = prev_search == stext;
-
- bool ret = class_desc->search(stext, keep);
- if (!ret) {
- class_desc->search(stext, false);
- }
-
- prev_search = stext;
+ find_bar->search_next();
}
void EditorHelp::_class_list_select(const String &p_select) {
@@ -598,14 +587,6 @@ void EditorHelp::_class_desc_select(const String &p_select) {
}
void EditorHelp::_class_desc_input(const Ref<InputEvent> &p_input) {
-
- Ref<InputEventMouseButton> mb = p_input;
-
- if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == 1 && !mb->is_doubleclick()) {
- class_desc->set_selection_enabled(false);
- class_desc->set_selection_enabled(true);
- }
- set_focused();
}
void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
@@ -1816,13 +1797,7 @@ void EditorHelp::scroll_to_section(int p_section_index) {
void EditorHelp::popup_search() {
- search_dialog->popup_centered(Size2(250, 80) * EDSCALE);
- search->grab_focus();
-}
-
-void EditorHelp::_search_cbk() {
-
- _search(search->get_text());
+ find_bar->popup_search();
}
String EditorHelp::get_class() {
@@ -1851,7 +1826,6 @@ void EditorHelp::_bind_methods() {
ClassDB::bind_method("_request_help", &EditorHelp::_request_help);
ClassDB::bind_method("_unhandled_key_input", &EditorHelp::_unhandled_key_input);
ClassDB::bind_method("_search", &EditorHelp::_search);
- ClassDB::bind_method("_search_cbk", &EditorHelp::_search_cbk);
ClassDB::bind_method("_help_callback", &EditorHelp::_help_callback);
ADD_SIGNAL(MethodInfo("go_to_help"));
@@ -1863,6 +1837,10 @@ EditorHelp::EditorHelp() {
EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
+ find_bar = memnew(FindBar);
+ add_child(find_bar);
+ find_bar->hide();
+
class_desc = memnew(RichTextLabel);
add_child(class_desc);
class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -1870,24 +1848,14 @@ EditorHelp::EditorHelp() {
class_desc->connect("meta_clicked", this, "_class_desc_select");
class_desc->connect("gui_input", this, "_class_desc_input");
+ find_bar->set_rich_text_label(class_desc);
+
class_desc->set_selection_enabled(true);
scroll_locked = false;
select_locked = false;
- set_process_unhandled_key_input(true);
+ //set_process_unhandled_key_input(true);
class_desc->hide();
-
- search_dialog = memnew(ConfirmationDialog);
- add_child(search_dialog);
- VBoxContainer *search_vb = memnew(VBoxContainer);
- search_dialog->add_child(search_vb);
-
- search = memnew(LineEdit);
- search_dialog->register_text_enter(search);
- search_vb->add_margin_child(TTR("Search Text"), search);
- search_dialog->get_ok()->set_text(TTR("Find"));
- search_dialog->connect("confirmed", this, "_search_cbk");
- search_dialog->set_hide_on_ok(false);
}
EditorHelp::~EditorHelp() {
@@ -1964,3 +1932,177 @@ EditorHelpBit::EditorHelpBit() {
rich_text->set_override_selected_font_color(false);
set_custom_minimum_size(Size2(0, 70 * EDSCALE));
}
+
+FindBar::FindBar() {
+
+ container = memnew(Control);
+ add_child(container);
+
+ container->set_clip_contents(true);
+ container->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ hbc = memnew(HBoxContainer);
+ container->add_child(hbc);
+
+ vbc_search_text = memnew(VBoxContainer);
+ hbc->add_child(vbc_search_text);
+ vbc_search_text->set_h_size_flags(SIZE_EXPAND_FILL);
+ hbc->set_anchor_and_margin(MARGIN_RIGHT, 1, 0);
+
+ search_text = memnew(LineEdit);
+ vbc_search_text->add_child(search_text);
+ search_text->set_custom_minimum_size(Size2(100 * EDSCALE, 0));
+ search_text->connect("text_changed", this, "_search_text_changed");
+ search_text->connect("text_entered", this, "_search_text_entered");
+
+ find_prev = memnew(ToolButton);
+ hbc->add_child(find_prev);
+ find_prev->set_focus_mode(FOCUS_NONE);
+ find_prev->connect("pressed", this, "_search_prev");
+
+ find_next = memnew(ToolButton);
+ hbc->add_child(find_next);
+ find_next->set_focus_mode(FOCUS_NONE);
+ find_next->connect("pressed", this, "_search_next");
+
+ error_label = memnew(Label);
+ hbc->add_child(error_label);
+ error_label->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor"));
+
+ hide_button = memnew(TextureButton);
+ add_child(hide_button);
+ hide_button->set_focus_mode(FOCUS_NONE);
+ hide_button->set_expand(true);
+ hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED);
+ hide_button->connect("pressed", this, "_hide_pressed");
+}
+
+void FindBar::popup_search() {
+ show();
+ search_text->grab_focus();
+ container->set_custom_minimum_size(Size2(0, hbc->get_size().height));
+}
+
+void FindBar::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_READY) {
+
+ find_prev->set_icon(get_icon("MoveUp", "EditorIcons"));
+ find_next->set_icon(get_icon("MoveDown", "EditorIcons"));
+ hide_button->set_normal_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_hover_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_pressed_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
+ } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
+
+ set_process_unhandled_input(is_visible_in_tree());
+ } else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
+
+ find_prev->set_icon(get_icon("MoveUp", "EditorIcons"));
+ find_next->set_icon(get_icon("MoveDown", "EditorIcons"));
+ hide_button->set_normal_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_hover_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_pressed_texture(get_icon("Close", "EditorIcons"));
+ hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
+ }
+}
+
+void FindBar::_bind_methods() {
+
+ ClassDB::bind_method("_unhandled_input", &FindBar::_unhandled_input);
+
+ ClassDB::bind_method("_search_text_changed", &FindBar::_search_text_changed);
+ ClassDB::bind_method("_search_text_entered", &FindBar::_search_text_entered);
+ ClassDB::bind_method("_search_next", &FindBar::search_next);
+ ClassDB::bind_method("_search_prev", &FindBar::search_prev);
+ ClassDB::bind_method("_hide_pressed", &FindBar::_hide_bar);
+
+ ADD_SIGNAL(MethodInfo("search"));
+}
+
+void FindBar::set_rich_text_label(RichTextLabel *p_rich_text_label) {
+
+ rich_text_label = p_rich_text_label;
+}
+
+bool FindBar::search_next() {
+
+ return _search();
+}
+
+bool FindBar::search_prev() {
+
+ return _search(true);
+}
+
+bool FindBar::_search(bool p_search_previous) {
+
+ String stext = search_text->get_text();
+ bool keep = prev_search == stext;
+
+ bool ret = rich_text_label->search(stext, keep, p_search_previous);
+ if (!ret) {
+ ret = rich_text_label->search(stext, false, p_search_previous);
+ }
+
+ prev_search = stext;
+
+ if (ret) {
+ set_error("");
+ } else {
+ set_error(stext.empty() ? "" : TTR("No Matches"));
+ }
+
+ return ret;
+}
+
+void FindBar::set_error(const String &p_label) {
+
+ error_label->set_text(p_label);
+}
+
+void FindBar::_hide_bar() {
+
+ if (search_text->has_focus())
+ rich_text_label->grab_focus();
+
+ hide();
+}
+
+void FindBar::_unhandled_input(const Ref<InputEvent> &p_event) {
+
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid()) {
+
+ if (k->is_pressed() && (rich_text_label->has_focus() || hbc->is_a_parent_of(get_focus_owner()))) {
+
+ bool accepted = true;
+
+ switch (k->get_scancode()) {
+
+ case KEY_ESCAPE: {
+
+ _hide_bar();
+ } break;
+ default: {
+
+ accepted = false;
+ } break;
+ }
+
+ if (accepted) {
+ accept_event();
+ }
+ }
+ }
+}
+
+void FindBar::_search_text_changed(const String &p_text) {
+
+ search_next();
+}
+
+void FindBar::_search_text_entered(const String &p_text) {
+
+ search_next();
+}
diff --git a/editor/editor_help.h b/editor/editor_help.h
index 0f93e1b55b..35d98d274c 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -125,6 +125,50 @@ public:
EditorHelpIndex();
};
+class FindBar : public HBoxContainer {
+
+ GDCLASS(FindBar, HBoxContainer);
+
+ LineEdit *search_text;
+ ToolButton *find_prev;
+ ToolButton *find_next;
+ Label *error_label;
+ TextureButton *hide_button;
+ String prev_search;
+
+ Control *container;
+ HBoxContainer *hbc;
+ VBoxContainer *vbc_search_text;
+
+ RichTextLabel *rich_text_label;
+
+ void _show_search();
+ void _hide_bar();
+
+ void _search_text_changed(const String &p_text);
+ void _search_text_entered(const String &p_text);
+
+protected:
+ void _notification(int p_what);
+ void _unhandled_input(const Ref<InputEvent> &p_event);
+
+ bool _search(bool p_search_previous = false);
+
+ static void _bind_methods();
+
+public:
+ void set_error(const String &p_label);
+
+ void set_rich_text_label(RichTextLabel *p_rich_text_label);
+
+ void popup_search();
+
+ bool search_prev();
+ bool search_next();
+
+ FindBar();
+};
+
class EditorHelp : public VBoxContainer {
GDCLASS(EditorHelp, VBoxContainer);
@@ -161,6 +205,7 @@ class EditorHelp : public VBoxContainer {
ConfirmationDialog *search_dialog;
LineEdit *search;
+ FindBar *find_bar;
String base_path;
@@ -194,7 +239,6 @@ class EditorHelp : public VBoxContainer {
void _request_help(const String &p_string);
void _search(const String &p_str);
- void _search_cbk();
void _unhandled_key_input(const Ref<InputEvent> &p_ev);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index d8c85df83d..3f0a09cfd9 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -93,6 +93,7 @@
#include "editor/plugins/particles_editor_plugin.h"
#include "editor/plugins/path_2d_editor_plugin.h"
#include "editor/plugins/path_editor_plugin.h"
+#include "editor/plugins/physical_bone_plugin.h"
#include "editor/plugins/polygon_2d_editor_plugin.h"
#include "editor/plugins/resource_preloader_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
@@ -100,6 +101,7 @@
#include "editor/plugins/shader_editor_plugin.h"
#include "editor/plugins/shader_graph_editor_plugin.h"
#include "editor/plugins/skeleton_2d_editor_plugin.h"
+#include "editor/plugins/skeleton_editor_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/plugins/sprite_editor_plugin.h"
#include "editor/plugins/sprite_frames_editor_plugin.h"
@@ -481,7 +483,7 @@ void EditorNode::_fs_changed() {
// come during the export
export_defer.preset = "";
Error err = OK;
- if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) {
+ if (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip")) {
if (export_defer.path.ends_with(".zip")) {
err = platform->export_zip(preset, export_defer.debug, export_defer.path);
} else if (export_defer.path.ends_with(".pck")) {
@@ -631,6 +633,7 @@ void EditorNode::save_resource_in_path(const Ref<Resource> &p_resource, const St
((Resource *)p_resource.ptr())->set_path(path);
emit_signal("resource_saved", p_resource);
+ editor_data.notify_resource_saved(p_resource);
}
void EditorNode::save_resource(const Ref<Resource> &p_resource) {
@@ -5880,6 +5883,8 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
add_editor_plugin(memnew(NavigationMeshEditorPlugin(this)));
+ add_editor_plugin(memnew(SkeletonEditorPlugin(this)));
+ add_editor_plugin(memnew(PhysicalBonePlugin(this)));
// FIXME: Disabled as (according to reduz) users were complaining that it gets in the way
// Waiting for PropertyEditor rewrite (planned for 3.1) to be refactored.
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 336eaf719c..2e4e887165 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -473,6 +473,10 @@ void EditorPlugin::notify_scene_closed(const String &scene_filepath) {
emit_signal("scene_closed", scene_filepath);
}
+void EditorPlugin::notify_resource_saved(const Ref<Resource> &p_resource) {
+ emit_signal("resource_saved", p_resource);
+}
+
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
//??
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
@@ -757,6 +761,7 @@ void EditorPlugin::_bind_methods() {
ADD_SIGNAL(MethodInfo("scene_changed", PropertyInfo(Variant::OBJECT, "scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "filepath")));
ADD_SIGNAL(MethodInfo("main_screen_changed", PropertyInfo(Variant::STRING, "screen_name")));
+ ADD_SIGNAL(MethodInfo("resource_saved", PropertyInfo(Variant::OBJECT, "resource", PROPERTY_HINT_RESOURCE_TYPE, "Resource")));
BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR);
BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU);
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 05cc6e07e3..ebc4afdfeb 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -167,6 +167,7 @@ public:
void notify_main_screen_changed(const String &screen_name);
void notify_scene_changed(const Node *scn_root);
void notify_scene_closed(const String &scene_filepath);
+ void notify_resource_saved(const Ref<Resource> &p_resource);
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 15d3b28da8..68705fa29d 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -298,6 +298,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["interface/editor/code_font_hinting"] = PropertyInfo(Variant::INT, "interface/editor/code_font_hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
_initial_set("interface/editor/main_font", "");
hints["interface/editor/main_font"] = PropertyInfo(Variant::STRING, "interface/editor/main_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ _initial_set("interface/editor/main_font_bold", "");
+ hints["interface/editor/main_font_bold"] = PropertyInfo(Variant::STRING, "interface/editor/main_font_bold", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
_initial_set("interface/editor/code_font", "");
hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
_initial_set("interface/editor/dim_editor_on_dialog_popup", true);
@@ -369,6 +371,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/line_numbers/line_numbers_zero_padded", false);
_initial_set("text_editor/line_numbers/show_breakpoint_gutter", true);
_initial_set("text_editor/line_numbers/code_folding", true);
+ _initial_set("text_editor/line_numbers/word_wrap", false);
_initial_set("text_editor/line_numbers/show_line_length_guideline", false);
_initial_set("text_editor/line_numbers/line_length_guideline_column", 80);
hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 1");
@@ -400,8 +403,17 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/grid_map/pick_distance", 5000.0);
- _initial_set("editors/3d/grid_color", Color::html("808080"));
- hints["editors/3d/grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+ _initial_set("editors/3d/primary_grid_color", Color::html("909090"));
+ hints["editors/3d/primary_grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/primary_grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+ _initial_set("editors/3d/secondary_grid_color", Color::html("606060"));
+ hints["editors/3d/secondary_grid_color"] = PropertyInfo(Variant::COLOR, "editors/3d/secondary_grid_color", PROPERTY_HINT_COLOR_NO_ALPHA, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+ _initial_set("editors/3d/grid_size", 50);
+ hints["editors/3d/grid_size"] = PropertyInfo(Variant::INT, "editors/3d/grid_size", PROPERTY_HINT_RANGE, "1,500,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
+
+ _initial_set("editors/3d/primary_grid_steps", 10);
+ hints["editors/3d/primary_grid_steps"] = PropertyInfo(Variant::INT, "editors/3d/primary_grid_steps", PROPERTY_HINT_RANGE, "1,100,1", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
_initial_set("editors/3d/default_fov", 70.0);
_initial_set("editors/3d/default_z_near", 0.05);
@@ -454,9 +466,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8));
_initial_set("editors/2d/bone_width", 5);
_initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9));
- _initial_set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9));
+ _initial_set("editors/2d/bone_color2", Color(0.6, 0.6, 0.6, 0.9));
_initial_set("editors/2d/bone_selected_color", Color(0.9, 0.45, 0.45, 0.9));
_initial_set("editors/2d/bone_ik_color", Color(0.9, 0.9, 0.45, 0.9));
+ _initial_set("editors/2d/bone_outline_color", Color(0.35, 0.35, 0.35));
+ _initial_set("editors/2d/bone_outline_size", 2);
_initial_set("editors/2d/keep_margins_when_changing_anchors", false);
_initial_set("editors/2d/warped_mouse_panning", true);
_initial_set("editors/2d/simple_spacebar_panning", false);
@@ -583,6 +597,10 @@ void EditorSettings::_load_default_text_editor_theme() {
_initial_set("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15));
_initial_set("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1));
_initial_set("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1));
+
+ // GDScript highlighter
+ _initial_set("text_editor/highlighting/gdscript/function_definition_color", Color::html("#01e1ff"));
+ _initial_set("text_editor/highlighting/gdscript/node_path_color", Color::html("#64c15a"));
}
bool EditorSettings::_save_text_editor_theme(String p_file) {
@@ -619,6 +637,10 @@ bool EditorSettings::_save_text_editor_theme(String p_file) {
cf->set_value(theme_section, "search_result_color", ((Color)get("text_editor/highlighting/search_result_color")).to_html());
cf->set_value(theme_section, "search_result_border_color", ((Color)get("text_editor/highlighting/search_result_border_color")).to_html());
+ //GDScript highlighter
+ cf->set_value(theme_section, "gdscript/function_definition_color", ((Color)get("text_editor/highlighting/gdscript/function_definition_color")).to_html());
+ cf->set_value(theme_section, "gdscript/node_path_color", ((Color)get("text_editor/highlighting/gdscript/node_path_color")).to_html());
+
Error err = cf->save(p_file);
if (err == OK) {
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 3582379e34..d0b842f231 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -891,6 +891,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
//RichTextLabel
theme->set_color("default_color", "RichTextLabel", font_color);
+ theme->set_color("font_color_shadow", "RichTextLabel", Color(0, 0, 0, 0));
+ theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE);
+ theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE);
+ theme->set_constant("shadow_as_outline", "RichTextLabel", 0 * EDSCALE);
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
@@ -908,6 +912,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("shadow_as_outline", "Label", 0 * EDSCALE);
theme->set_constant("line_spacing", "Label", 3 * EDSCALE);
+ // LinkButton
+ theme->set_stylebox("focus", "LinkButton", style_empty);
+ theme->set_color("font_color", "LinkButton", font_color);
+
// TooltipPanel
Ref<StyleBoxFlat> style_tooltip = style_popup->duplicate();
style_tooltip->set_bg_color(Color(mono_color.r, mono_color.g, mono_color.b, 0.9));
@@ -1039,6 +1047,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color comment_color = dim_color;
const Color string_color = Color::html(dark_theme ? "#ffd942" : "#ffd118").linear_interpolate(mono_color, dark_theme ? 0.5 : 0.3);
+ const Color function_definition_color = Color::html(dark_theme ? "#01e1ff" : "#00a5ba");
+ const Color node_path_color = Color::html(dark_theme ? "64c15a" : "#518b4b");
+
const Color te_background_color = Color(0, 0, 0, 0);
const Color completion_background_color = base_color;
const Color completion_selected_color = alpha1;
@@ -1097,6 +1108,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
setting->set_initial_value("text_editor/highlighting/code_folding_color", code_folding_color, true);
setting->set_initial_value("text_editor/highlighting/search_result_color", search_result_color, true);
setting->set_initial_value("text_editor/highlighting/search_result_border_color", search_result_border_color, true);
+
+ setting->set_initial_value("text_editor/highlighting/gdscript/function_definition_color", function_definition_color, true);
+ setting->set_initial_value("text_editor/highlighting/gdscript/node_path_color", node_path_color, true);
} else if (text_editor_color_theme == "Default") {
setting->set_initial_value("text_editor/highlighting/symbol_color", Color::html("badfff"), true);
setting->set_initial_value("text_editor/highlighting/keyword_color", Color::html("ffffb3"), true);
@@ -1128,6 +1142,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
setting->set_initial_value("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8), true);
setting->set_initial_value("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1), true);
setting->set_initial_value("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1), true);
+
+ setting->set_initial_value("text_editor/highlighting/gdscript/function_definition_color", Color::html("#01e1ff"), true);
+ setting->set_initial_value("text_editor/highlighting/gdscript/node_path_color", Color::html("#64c15a"), true);
}
return theme;
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index ada35073ec..e7741c7926 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -945,7 +945,7 @@ void FileSystemDock::_make_dir_confirm() {
if (dir_name.length() == 0) {
EditorNode::get_singleton()->show_warning(TTR("No name provided"));
return;
- } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".")) {
+ } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) {
EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters"));
return;
}
@@ -1237,6 +1237,15 @@ void FileSystemDock::_file_option(int p_option) {
make_dir_dialog->popup_centered_minsize(Size2(250, 80) * EDSCALE);
make_dir_dialog_text->grab_focus();
} break;
+ case FILE_NEW_SCRIPT: {
+ String tarDir = path;
+ if (tarDir != "res://" && !tarDir.ends_with("/")) {
+ tarDir += "/";
+ }
+
+ make_script_dialog_text->config("Node", tarDir + "new_script.gd");
+ make_script_dialog_text->popup_centered(Size2(300, 300) * EDSCALE);
+ } break;
case FILE_COPY_PATH: {
int idx = files->get_current();
if (idx < 0 || idx >= files->get_item_count())
@@ -1662,6 +1671,7 @@ void FileSystemDock::_files_list_rmb_select(int p_item, const Vector2 &p_pos) {
}
file_options->add_item(TTR("New Folder..."), FILE_NEW_FOLDER);
+ file_options->add_item(TTR("New Script..."), FILE_NEW_SCRIPT);
file_options->add_item(TTR("Show In File Manager"), FILE_SHOW_IN_EXPLORER);
file_options->set_position(files->get_global_position() + p_pos);
@@ -1673,6 +1683,7 @@ void FileSystemDock::_rmb_pressed(const Vector2 &p_pos) {
file_options->set_size(Size2(1, 1));
file_options->add_item(TTR("New Folder..."), FILE_NEW_FOLDER);
+ file_options->add_item(TTR("New Script..."), FILE_NEW_SCRIPT);
file_options->add_item(TTR("Show In File Manager"), FILE_SHOW_IN_EXPLORER);
file_options->set_position(files->get_global_position() + p_pos);
file_options->popup();
@@ -1988,6 +1999,10 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) {
make_dir_dialog->register_text_enter(make_dir_dialog_text);
make_dir_dialog->connect("confirmed", this, "_make_dir_confirm");
+ make_script_dialog_text = memnew(ScriptCreateDialog);
+ make_script_dialog_text->set_title(TTR("Create Script"));
+ add_child(make_script_dialog_text);
+
updating_tree = false;
initialized = false;
import_dock_needs_update = false;
diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h
index c8448a1022..e59d4c96e1 100644
--- a/editor/filesystem_dock.h
+++ b/editor/filesystem_dock.h
@@ -50,6 +50,7 @@
#include "dependency_editor.h"
#include "editor_dir_dialog.h"
#include "editor_file_system.h"
+#include "script_create_dialog.h"
class EditorNode;
@@ -75,6 +76,7 @@ private:
FILE_REIMPORT,
FILE_INFO,
FILE_NEW_FOLDER,
+ FILE_NEW_SCRIPT,
FILE_SHOW_IN_EXPLORER,
FILE_COPY_PATH
};
@@ -126,6 +128,7 @@ private:
LineEdit *duplicate_dialog_text;
ConfirmationDialog *make_dir_dialog;
LineEdit *make_dir_dialog_text;
+ ScriptCreateDialog *make_script_dialog_text;
class FileOrFolder {
public:
diff --git a/editor/icons/icon_bone_2_d.svg b/editor/icons/icon_bone_2_d.svg
new file mode 100644
index 0000000000..efcbc17e13
--- /dev/null
+++ b/editor/icons/icon_bone_2_d.svg
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ version="1.1"
+ viewBox="0 0 16 16"
+ id="svg6"
+ sodipodi:docname="icon_bone_2d.svg"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)">
+ <metadata
+ id="metadata12">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs10" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="836"
+ inkscape:window-height="480"
+ id="namedview8"
+ showgrid="false"
+ inkscape:zoom="14.75"
+ inkscape:cx="8"
+ inkscape:cy="8"
+ inkscape:window-x="67"
+ inkscape:window-y="27"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg6" />
+ <g
+ transform="translate(0 -1036.4)"
+ id="g4"
+ style="fill:#a5b7f3;fill-opacity:1">
+ <path
+ d="m10.478 1037.4a2.4664 2.4663 0 0 0 -1.7804 0.7205 2.4664 2.4663 0 0 0 -0.31408 3.1041l-3.559 3.5608a2.4664 2.4663 0 0 0 -3.1023 0.3121 2.4664 2.4663 0 0 0 0 3.4876 2.4664 2.4663 0 0 0 1.397 0.6955 2.4664 2.4663 0 0 0 0.69561 1.397 2.4664 2.4663 0 0 0 3.4877 0 2.4664 2.4663 0 0 0 0.31408 -3.1041l3.5609-3.5608a2.4664 2.4663 0 0 0 3.1004 -0.3102 2.4664 2.4663 0 0 0 0 -3.4875 2.4664 2.4663 0 0 0 -1.397 -0.6974 2.4664 2.4663 0 0 0 -0.69561 -1.3971 2.4664 2.4663 0 0 0 -1.7072 -0.7205z"
+ fill="#fc9c9c"
+ id="path2"
+ style="fill:#a5b7f3;fill-opacity:1" />
+ </g>
+</svg>
diff --git a/editor/icons/icon_physical_bone.svg b/editor/icons/icon_physical_bone.svg
new file mode 100644
index 0000000000..2efcab3e20
--- /dev/null
+++ b/editor/icons/icon_physical_bone.svg
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ version="1.1"
+ viewBox="0 0 16 16"
+ id="svg2"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="icon_physical_bone.svg">
+ <metadata
+ id="metadata12">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs10" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1027"
+ id="namedview8"
+ showgrid="false"
+ inkscape:zoom="16"
+ inkscape:cx="14.674088"
+ inkscape:cy="7.3239349"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" />
+ <g
+ id="g4505"
+ transform="translate(-2.5625,-18.4375)">
+ <path
+ inkscape:connector-curvature="0"
+ id="path6-9-8"
+ d="m 13.107422,19.382812 a 2.4664,2.4663 0 0 0 -1.78125,0.720704 2.4664,2.4663 0 0 0 -0.185547,0.21289 L 12.472656,22.75 10.867187,23.353516 7.453125,26.767578 a 2.4664,2.4663 0 0 0 -3.1015625,0.3125 2.4664,2.4663 0 0 0 0,3.488281 2.4664,2.4663 0 0 0 1.3964844,0.695313 2.4664,2.4663 0 0 0 0.6953125,1.396484 2.4664,2.4663 0 0 0 3.4882812,0 2.4664,2.4663 0 0 0 0.3144534,-3.103515 l 3.560547,-3.560547 a 2.4664,2.4663 0 0 0 3.099609,-0.310547 2.4664,2.4663 0 0 0 0,-3.488281 A 2.4664,2.4663 0 0 0 15.509766,21.5 2.4664,2.4663 0 0 0 14.814453,20.103516 2.4664,2.4663 0 0 0 13.107422,19.382812 Z"
+ style="fill:#fc9c9c" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="rect4140-5-1-4-3-7-9-03"
+ d="m 3.7211033,21.208326 0.9608286,4.82644 1.3962404,-0.524494 z"
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.42799997;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="rect4140-5-1-4-3-7-9-5-3"
+ d="m 6.4843278,19.465234 0.9608285,4.82644 1.3962404,-0.524494 z"
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.42799997;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="cccc"
+ id="rect4140-5-1-4-3-7-9-5-3-8"
+ d="m 9.6964655,19.33678 0.7108285,3.51394 1.39624,-0.524494 z"
+ style="opacity:1;fill:#fc9c9c;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.42799997;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/editor/icons/icon_play_overlay.svg b/editor/icons/icon_play_overlay.svg
new file mode 100644
index 0000000000..eff33f1b6b
--- /dev/null
+++ b/editor/icons/icon_play_overlay.svg
@@ -0,0 +1,4 @@
+<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="64" height="64" rx="5" ry="5" fill="#044B94" fill-opacity="0.6"/>
+ <path d="M16 16 L48 32 L16 48" fill="#f2f2f2"/>
+</svg> \ No newline at end of file
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index af79f9946a..f4be6e8d59 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1163,7 +1163,7 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b
continue;
}
- if (mimetype.findn("jpg") != -1) {
+ if (mimetype.findn("jpeg") != -1) {
//is a jpg
Ref<Image> img = Image::_jpg_mem_loader_func(data_ptr, data_size);
diff --git a/editor/output_strings.cpp b/editor/output_strings.cpp
index b0b72510a9..e6cadee3e3 100644
--- a/editor/output_strings.cpp
+++ b/editor/output_strings.cpp
@@ -87,6 +87,7 @@ void OutputStrings::_notification(int p_what) {
float h_ofs = (int)h_scroll->get_value();
Point2 icon_ofs = Point2(0, (font_height - (int)icon_error->get_height()) / 2);
+ FontDrawer drawer(font, Color(1, 1, 1));
while (E && ofs.y < (size_height - (int)margin.y)) {
String str = E->get().text;
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 05833704d1..0ff316a286 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -65,7 +65,7 @@ void EditorAssetLibraryItem::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- icon->set_normal_texture(get_icon("GodotAssetDefault", "EditorIcons"));
+ icon->set_normal_texture(get_icon("DefaultProjectIcon", "EditorIcons"));
category->add_color_override("font_color", Color(0.5, 0.5, 0.5));
author->add_color_override("font_color", Color(0.5, 0.5, 0.5));
}
@@ -110,6 +110,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() {
add_child(hb);
icon = memnew(TextureButton);
+ icon->set_custom_minimum_size(Size2(64, 64));
icon->set_default_cursor_shape(CURSOR_POINTING_HAND);
icon->connect("pressed", this, "_asset_clicked");
@@ -170,7 +171,23 @@ void EditorAssetLibraryItemDescription::set_image(int p_type, int p_index, const
for (int i = 0; i < preview_images.size(); i++) {
if (preview_images[i].id == p_index) {
- preview_images[i].button->set_icon(p_image);
+ if (preview_images[i].is_video) {
+ Ref<Image> overlay = get_icon("PlayOverlay", "EditorIcons")->get_data();
+ Ref<Image> thumbnail = p_image->get_data();
+ Point2 overlay_pos = Point2((thumbnail->get_width() - overlay->get_width()) / 2, (thumbnail->get_height() - overlay->get_height()) / 2);
+
+ thumbnail->lock();
+ thumbnail->blend_rect(overlay, overlay->get_used_rect(), overlay_pos);
+ thumbnail->unlock();
+
+ Ref<ImageTexture> tex;
+ tex.instance();
+ tex->create_from_image(thumbnail);
+
+ preview_images[i].button->set_icon(tex);
+ } else {
+ preview_images[i].button->set_icon(p_image);
+ }
break;
}
}
@@ -383,7 +400,7 @@ void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asse
icon->set_texture(p_preview);
asset_id = p_asset_id;
if (!p_preview.is_valid())
- icon->set_texture(get_icon("GodotAssetDefault", "EditorIcons"));
+ icon->set_texture(get_icon("DefaultProjectIcon", "EditorIcons"));
host = p_download_url;
sha256 = p_sha256_hash;
asset_installer->connect("confirmed", this, "_close");
@@ -694,7 +711,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
switch (image_queue[p_queue_id].image_type) {
case IMAGE_QUEUE_ICON:
- image->resize(80 * EDSCALE, 80 * EDSCALE, Image::INTERPOLATE_CUBIC);
+ image->resize(64 * EDSCALE, 64 * EDSCALE, Image::INTERPOLATE_CUBIC);
break;
case IMAGE_QUEUE_THUMBNAIL: {
@@ -724,7 +741,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt
}
if (!image_set && final) {
- obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("ErrorSign", "EditorIcons"));
+ obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("DefaultProjectIcon", "EditorIcons"));
}
}
}
@@ -767,7 +784,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
WARN_PRINTS("Error getting PNG file from URL: " + image_queue[p_queue_id].image_url);
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
- obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("ErrorSign", "EditorIcons"));
+ obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("DefaultProjectIcon", "EditorIcons"));
}
}
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index ff38e12250..f27796db5e 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -44,6 +44,7 @@
#include "scene/2d/particles_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/2d/screen_button.h"
+#include "scene/2d/skeleton_2d.h"
#include "scene/2d/sprite.h"
#include "scene/gui/grid_container.h"
#include "scene/gui/nine_patch_rect.h"
@@ -466,32 +467,28 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
const real_t grab_distance = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
- bool locked = p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_");
-
- if (!locked) {
- for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
- if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
- } else {
- CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
- }
- if (p_limit != 0 && r_items.size() >= p_limit)
- return;
+ for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
+ if (canvas_item && !canvas_item->is_set_as_toplevel()) {
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ } else {
+ CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
}
+ if (p_limit != 0 && r_items.size() >= p_limit)
+ return;
+ }
- if (canvas_item && canvas_item->is_visible_in_tree()) {
- Transform2D xform = (p_parent_xform * p_canvas_xform * canvas_item->get_transform()).affine_inverse();
- const real_t local_grab_distance = xform.basis_xform(Vector2(grab_distance, 0)).length();
- if (canvas_item->_edit_is_selected_on_click(xform.xform(p_pos), local_grab_distance)) {
- Node2D *node = Object::cast_to<Node2D>(canvas_item);
+ if (canvas_item && canvas_item->is_visible_in_tree()) {
+ Transform2D xform = (p_parent_xform * p_canvas_xform * canvas_item->get_transform()).affine_inverse();
+ const real_t local_grab_distance = xform.basis_xform(Vector2(grab_distance, 0)).length();
+ if (canvas_item->_edit_is_selected_on_click(xform.xform(p_pos), local_grab_distance)) {
+ Node2D *node = Object::cast_to<Node2D>(canvas_item);
- _SelectResult res;
- res.item = canvas_item;
- res.z_index = node ? node->get_z_index() : 0;
- res.has_z = node;
- r_items.push_back(res);
- }
+ _SelectResult res;
+ res.item = canvas_item;
+ res.z_index = node ? node->get_z_index() : 0;
+ res.has_z = node;
+ r_items.push_back(res);
}
}
@@ -508,14 +505,14 @@ void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_Sel
for (int i = 0; i < r_items.size(); i++) {
Node *node = r_items[i].item;
- // Make sure the selected node is in the current scene
- while (node && node != scene && node->get_owner() != scene) {
+ // Make sure the selected node is in the current scene, or editable
+ while (node && node != get_tree()->get_edited_scene_root() && node->get_owner() != scene && !scene->is_editable_instance(node->get_owner())) {
node = node->get_parent();
};
// Replace the node by the group if grouped
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(node);
- while (node && node != scene) {
+ while (node && node != scene->get_parent()) {
CanvasItem *canvas_item_tmp = Object::cast_to<CanvasItem>(node);
if (canvas_item_tmp && node->has_meta("_edit_group_")) {
canvas_item = canvas_item_tmp;
@@ -523,8 +520,17 @@ void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_Sel
node = node->get_parent();
}
+ // Check if the canvas item is already in the list (for groups or scenes)
+ bool duplicate = false;
+ for (int j = 0; j < i; j++) {
+ if (r_items[j].item == canvas_item) {
+ duplicate = true;
+ break;
+ }
+ }
+
//Remove the item if invalid
- if (!canvas_item || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner()))) {
+ if (!canvas_item || duplicate || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner())) || (canvas_item->has_meta("_edit_lock_") && canvas_item->get_meta("_edit_lock_"))) {
r_items.remove(i);
i--;
} else {
@@ -540,13 +546,13 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n
return;
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
+ Node *scene = editor->get_edited_scene();
- bool inherited = p_node != get_tree()->get_edited_scene_root() && p_node->get_filename() != "";
- bool editable = !inherited || EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(p_node);
+ bool editable = p_node == scene || p_node->get_owner() == scene || scene->is_editable_instance(p_node->get_owner());
bool lock_children = p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_");
bool locked = p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_");
- if (!lock_children && !locked && editable) {
+ if (!lock_children || !editable) {
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
if (canvas_item && !canvas_item->is_set_as_toplevel()) {
_find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
@@ -557,7 +563,7 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n
}
}
- if (canvas_item && canvas_item->is_visible_in_tree() && !canvas_item->has_meta("_edit_lock_")) {
+ if (canvas_item && canvas_item->is_visible_in_tree() && !locked && editable) {
Transform2D xform = p_parent_xform * p_canvas_xform * canvas_item->get_transform();
if (canvas_item->_edit_use_rect()) {
@@ -2586,43 +2592,52 @@ void CanvasItemEditor::_draw_bones() {
Color bone_color1 = EditorSettings::get_singleton()->get("editors/2d/bone_color1");
Color bone_color2 = EditorSettings::get_singleton()->get("editors/2d/bone_color2");
Color bone_ik_color = EditorSettings::get_singleton()->get("editors/2d/bone_ik_color");
+ Color bone_outline_color = EditorSettings::get_singleton()->get("editors/2d/bone_outline_color");
Color bone_selected_color = EditorSettings::get_singleton()->get("editors/2d/bone_selected_color");
+ int bone_outline_size = EditorSettings::get_singleton()->get("editors/2d/bone_outline_size");
- for (Map<ObjectID, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
+ for (Map<BoneKey, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
- E->get().from = Vector2();
- E->get().to = Vector2();
+ Node2D *from_node = Object::cast_to<Node2D>(ObjectDB::get_instance(E->key().from));
+ Node2D *to_node = Object::cast_to<Node2D>(ObjectDB::get_instance(E->key().to));
- Node2D *n2d = Object::cast_to<Node2D>(ObjectDB::get_instance(E->key()));
- if (!n2d)
+ if (!from_node->is_inside_tree())
+ continue; //may have been removed
+ if (!from_node)
continue;
- if (!n2d->get_parent())
+ if (!to_node && E->get().length == 0)
continue;
- CanvasItem *pi = n2d->get_parent_item();
-
- Node2D *pn2d = Object::cast_to<Node2D>(n2d->get_parent());
+ Vector2 from = transform.xform(from_node->get_global_position());
+ Vector2 to;
- if (!pn2d)
- continue;
-
- Vector2 from = transform.xform(pn2d->get_global_position());
- Vector2 to = transform.xform(n2d->get_global_position());
-
- E->get().from = from;
- E->get().to = to;
+ if (to_node)
+ to = transform.xform(to_node->get_global_position());
+ else
+ to = transform.xform(from_node->get_global_transform().xform(Vector2(E->get().length, 0)));
Vector2 rel = to - from;
Vector2 relt = rel.tangent().normalized() * bone_width;
+ Vector2 reln = rel.normalized();
+ Vector2 reltn = relt.normalized();
Vector<Vector2> bone_shape;
bone_shape.push_back(from);
bone_shape.push_back(from + rel * 0.2 + relt);
bone_shape.push_back(to);
bone_shape.push_back(from + rel * 0.2 - relt);
+
+ Vector<Vector2> bone_shape_outline;
+ bone_shape_outline.push_back(from + (-reln - reltn) * bone_outline_size);
+ bone_shape_outline.push_back(from + (-reln + reltn) * bone_outline_size);
+ bone_shape_outline.push_back(from + rel * 0.2 + relt + reltn * bone_outline_size);
+ bone_shape_outline.push_back(to + (reln + reltn) * bone_outline_size);
+ bone_shape_outline.push_back(to + (reln - reltn) * bone_outline_size);
+ bone_shape_outline.push_back(from + rel * 0.2 - relt - reltn * bone_outline_size);
+
Vector<Color> colors;
- if (pi->has_meta("_edit_ik_")) {
+ if (from_node->has_meta("_edit_ik_")) {
colors.push_back(bone_ik_color);
colors.push_back(bone_ik_color);
@@ -2635,14 +2650,26 @@ void CanvasItemEditor::_draw_bones() {
colors.push_back(bone_color2);
}
- VisualServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
-
- if (editor_selection->is_selected(pi)) {
- for (int i = 0; i < bone_shape.size(); i++) {
+ Vector<Color> outline_colors;
- VisualServer::get_singleton()->canvas_item_add_line(ci, bone_shape[i], bone_shape[(i + 1) % bone_shape.size()], bone_selected_color, 2);
- }
+ if (editor_selection->is_selected(from_node)) {
+ outline_colors.push_back(bone_selected_color);
+ outline_colors.push_back(bone_selected_color);
+ outline_colors.push_back(bone_selected_color);
+ outline_colors.push_back(bone_selected_color);
+ outline_colors.push_back(bone_selected_color);
+ outline_colors.push_back(bone_selected_color);
+ } else {
+ outline_colors.push_back(bone_outline_color);
+ outline_colors.push_back(bone_outline_color);
+ outline_colors.push_back(bone_outline_color);
+ outline_colors.push_back(bone_outline_color);
+ outline_colors.push_back(bone_outline_color);
+ outline_colors.push_back(bone_outline_color);
}
+
+ VisualServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors);
+ VisualServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
}
}
}
@@ -2651,7 +2678,7 @@ void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Trans
ERR_FAIL_COND(!p_node);
Node *scene = editor->get_edited_scene();
- if (p_node != scene && p_node->get_owner() != scene && !scene->is_editable_instance(p_node))
+ if (p_node != scene && p_node->get_owner() != scene && !scene->is_editable_instance(p_node->get_owner()))
return;
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
if (canvas_item && !canvas_item->is_visible())
@@ -2766,26 +2793,70 @@ void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p
}
}
-void CanvasItemEditor::_build_bones_list(Node *p_node) {
- ERR_FAIL_COND(!p_node);
+bool CanvasItemEditor::_build_bones_list(Node *p_node) {
+ ERR_FAIL_COND_V(!p_node, false);
+
+ bool has_child_bones = false;
for (int i = 0; i < p_node->get_child_count(); i++) {
- _build_bones_list(p_node->get_child(i));
+ if (_build_bones_list(p_node->get_child(i))) {
+ has_child_bones = true;
+ }
+ }
+
+ CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
+ Node *scene = editor->get_edited_scene();
+ if (!canvas_item || !canvas_item->is_visible() || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner()))) {
+ return false;
}
- CanvasItem *c = Object::cast_to<CanvasItem>(p_node);
- if (c && c->is_visible_in_tree()) {
- if (c->has_meta("_edit_bone_")) {
+ Node *parent = canvas_item->get_parent();
- ObjectID id = c->get_instance_id();
- if (!bone_list.has(id)) {
- BoneList bone;
- bone_list[id] = bone;
+ if (Object::cast_to<Bone2D>(canvas_item)) {
+ if (Object::cast_to<Bone2D>(parent)) {
+ // Add as bone->parent relationship
+ BoneKey bk;
+ bk.from = parent->get_instance_id();
+ bk.to = canvas_item->get_instance_id();
+ if (!bone_list.has(bk)) {
+ BoneList b;
+ b.length = 0;
+ bone_list[bk] = b;
}
- bone_list[id].last_pass = bone_last_frame;
+ bone_list[bk].last_pass = bone_last_frame;
+ }
+
+ if (!has_child_bones) {
+ // Add a last bone if the Bone2D has no Bone2D child
+ BoneKey bk;
+ bk.from = canvas_item->get_instance_id();
+ bk.to = 0;
+ if (!bone_list.has(bk)) {
+ BoneList b;
+ b.length = 0;
+ bone_list[bk] = b;
+ }
+ bone_list[bk].last_pass = bone_last_frame;
}
+
+ return true;
}
+
+ if (canvas_item->has_meta("_edit_bone_")) {
+ // Add a "custom bone"
+ BoneKey bk;
+ bk.from = parent->get_instance_id();
+ bk.to = canvas_item->get_instance_id();
+ if (!bone_list.has(bk)) {
+ BoneList b;
+ b.length = 0;
+ bone_list[bk] = b;
+ }
+ bone_list[bk].last_pass = bone_last_frame;
+ }
+
+ return false;
}
void CanvasItemEditor::_draw_viewport() {
@@ -2861,6 +2932,7 @@ void CanvasItemEditor::_notification(int p_what) {
int nb_control = 0;
int nb_having_pivot = 0;
+ // Update the viewport if the canvas_item changes
List<CanvasItem *> selection = _get_edited_canvas_items();
for (List<CanvasItem *>::Element *E = selection.front(); E; E = E->next()) {
CanvasItem *canvas_item = E->get();
@@ -2906,15 +2978,17 @@ void CanvasItemEditor::_notification(int p_what) {
nb_having_pivot++;
}
}
+
// Activate / Deactivate the pivot tool
pivot_button->set_disabled(nb_having_pivot == 0);
// Show / Hide the layout button
presets_menu->set_visible(nb_control > 0 && nb_control == selection.size());
- for (Map<ObjectID, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
+ // Update the viewport if bones changes
+ for (Map<BoneKey, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
- Object *b = ObjectDB::get_instance(E->key());
+ Object *b = ObjectDB::get_instance(E->key().from);
if (!b) {
viewport->update();
@@ -2922,13 +2996,22 @@ void CanvasItemEditor::_notification(int p_what) {
}
Node2D *b2 = Object::cast_to<Node2D>(b);
- if (!b2) {
+ if (!b2 || !b2->is_inside_tree()) {
continue;
}
- if (b2->get_global_transform() != E->get().xform) {
+ Transform2D global_xform = b2->get_global_transform();
+
+ if (global_xform != E->get().xform) {
+
+ E->get().xform = global_xform;
+ viewport->update();
+ }
+
+ Bone2D *bone = Object::cast_to<Bone2D>(b);
+ if (bone && bone->get_default_length() != E->get().length) {
- E->get().xform = b2->get_global_transform();
+ E->get().length = bone->get_default_length();
viewport->update();
}
}
@@ -2944,12 +3027,19 @@ void CanvasItemEditor::_notification(int p_what) {
AnimationPlayerEditor::singleton->get_key_editor()->connect("visibility_changed", this, "_keying_changed");
_keying_changed();
+ get_tree()->connect("node_added", this, "_tree_changed", varray());
+ get_tree()->connect("node_removed", this, "_tree_changed", varray());
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
select_sb->set_texture(get_icon("EditorRect2D", "EditorIcons"));
}
+ if (p_what == NOTIFICATION_EXIT_TREE) {
+ get_tree()->disconnect("node_added", this, "_tree_changed");
+ get_tree()->disconnect("node_removed", this, "_tree_changed");
+ }
+
if (p_what == NOTIFICATION_ENTER_TREE || p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
select_button->set_icon(get_icon("ToolSelect", "EditorIcons"));
list_select_button->set_icon(get_icon("ListSelect", "EditorIcons"));
@@ -3034,6 +3124,47 @@ void CanvasItemEditor::edit(CanvasItem *p_canvas_item) {
editor_selection->add_node(p_canvas_item);
}
+void CanvasItemEditor::_queue_update_bone_list() {
+
+ if (bone_list_dirty)
+ return;
+
+ call_deferred("_update_bone_list");
+ bone_list_dirty = true;
+}
+
+void CanvasItemEditor::_update_bone_list() {
+
+ bone_last_frame++;
+
+ if (editor->get_edited_scene()) {
+ _build_bones_list(editor->get_edited_scene());
+ }
+
+ List<Map<BoneKey, BoneList>::Element *> bone_to_erase;
+ for (Map<BoneKey, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
+ if (E->get().last_pass != bone_last_frame) {
+ bone_to_erase.push_back(E);
+ continue;
+ }
+
+ Node *node = Object::cast_to<Node>(ObjectDB::get_instance(E->key().from));
+ if (!node || !node->is_inside_tree() || (node != get_tree()->get_edited_scene_root() && !get_tree()->get_edited_scene_root()->is_a_parent_of(node))) {
+ bone_to_erase.push_back(E);
+ continue;
+ }
+ }
+ while (bone_to_erase.size()) {
+ bone_list.erase(bone_to_erase.front()->get());
+ bone_to_erase.pop_front();
+ }
+ bone_list_dirty = false;
+}
+
+void CanvasItemEditor::_tree_changed(Node *) {
+ _queue_update_bone_list();
+}
+
void CanvasItemEditor::_update_scrollbars() {
updating_scroll = true;
@@ -3058,22 +3189,7 @@ void CanvasItemEditor::_update_scrollbars() {
Size2 screen_rect = Size2(ProjectSettings::get_singleton()->get("display/window/size/width"), ProjectSettings::get_singleton()->get("display/window/size/height"));
Rect2 local_rect = Rect2(Point2(), viewport->get_size() - Size2(vmin.width, hmin.height));
- bone_last_frame++;
-
- if (editor->get_edited_scene()) {
- _build_bones_list(editor->get_edited_scene());
- }
-
- List<Map<ObjectID, BoneList>::Element *> bone_to_erase;
- for (Map<ObjectID, BoneList>::Element *E = bone_list.front(); E; E = E->next()) {
- if (E->get().last_pass != bone_last_frame) {
- bone_to_erase.push_back(E);
- }
- }
- while (bone_to_erase.size()) {
- bone_list.erase(bone_to_erase.front()->get());
- bone_to_erase.pop_front();
- }
+ _queue_update_bone_list();
// Calculate scrollable area
Rect2 canvas_item_rect = Rect2(Point2(), screen_rect);
@@ -3837,6 +3953,9 @@ void CanvasItemEditor::_bind_methods() {
ClassDB::bind_method("_draw_viewport", &CanvasItemEditor::_draw_viewport);
ClassDB::bind_method("_gui_input_viewport", &CanvasItemEditor::_gui_input_viewport);
ClassDB::bind_method("_snap_changed", &CanvasItemEditor::_snap_changed);
+ ClassDB::bind_method("_update_bone_list", &CanvasItemEditor::_update_bone_list);
+ ClassDB::bind_method("_tree_changed", &CanvasItemEditor::_tree_changed);
+
ClassDB::bind_method(D_METHOD("_selection_result_pressed"), &CanvasItemEditor::_selection_result_pressed);
ClassDB::bind_method(D_METHOD("_selection_menu_hide"), &CanvasItemEditor::_selection_menu_hide);
ClassDB::bind_method(D_METHOD("set_state"), &CanvasItemEditor::set_state);
@@ -4040,6 +4159,7 @@ void CanvasItemEditor::focus_selection() {
CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
+ bone_list_dirty = false;
tool = TOOL_SELECT;
undo_redo = p_editor->get_undo_redo();
editor = p_editor;
@@ -4224,13 +4344,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p = skeleton_menu->get_popup();
p->set_hide_on_checkable_item_selection(false);
- p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Bones"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES);
- p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Bones")), SKELETON_CLEAR_BONES);
- p->add_separator();
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_show_bones", TTR("Show Bones")), SKELETON_SHOW_BONES);
p->add_separator();
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_set_ik_chain", TTR("Make IK Chain")), SKELETON_SET_IK_CHAIN);
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_ik_chain", TTR("Clear IK Chain")), SKELETON_CLEAR_IK_CHAIN);
+ p->add_separator();
+ p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_make_bones", TTR("Make Custom Bone(s) from Node(s)"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_B), SKELETON_MAKE_BONES);
+ p->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_bones", TTR("Clear Custom Bones")), SKELETON_CLEAR_BONES);
p->connect("id_pressed", this, "_popup_callback");
hb->add_child(memnew(VSeparator));
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 373a4b799e..a1957b892e 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -264,12 +264,24 @@ class CanvasItemEditor : public VBoxContainer {
struct BoneList {
Transform2D xform;
- Vector2 from;
- Vector2 to;
+ float length;
uint64_t last_pass;
};
+
uint64_t bone_last_frame;
- Map<ObjectID, BoneList> bone_list;
+
+ struct BoneKey {
+ ObjectID from;
+ ObjectID to;
+ _FORCE_INLINE_ bool operator<(const BoneKey &p_key) const {
+ if (from == p_key.from)
+ return to < p_key.to;
+ else
+ return from < p_key.from;
+ }
+ };
+
+ Map<BoneKey, BoneList> bone_list;
struct PoseClipboard {
Vector2 pos;
@@ -366,7 +378,7 @@ class CanvasItemEditor : public VBoxContainer {
void _selection_menu_hide();
UndoRedo *undo_redo;
- void _build_bones_list(Node *p_node);
+ bool _build_bones_list(Node *p_node);
List<CanvasItem *> _get_edited_canvas_items(bool retreive_locked = false, bool remove_canvas_item_if_parent_in_selection = true);
Rect2 _get_encompassing_rect_from_list(List<CanvasItem *> p_list);
@@ -433,6 +445,11 @@ class CanvasItemEditor : public VBoxContainer {
HSplitContainer *palette_split;
VSplitContainer *bottom_split;
+ bool bone_list_dirty;
+ void _queue_update_bone_list();
+ void _update_bone_list();
+ void _tree_changed(Node *);
+
friend class CanvasItemEditorPlugin;
protected:
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 8542296bde..d76c515c1f 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -467,15 +467,6 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES &p_from) {
Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color");
Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color");
- if (EditorSettings::get_singleton()->get("text_editor/theme/color_theme") == "Adaptive") {
- Ref<Theme> tm = EditorNode::get_singleton()->get_theme_base()->get_theme();
-
- bg_color = tm->get_color("text_editor/highlighting/background_color", "Editor");
- keyword_color = tm->get_color("text_editor/highlighting/keyword_color", "Editor");
- text_color = tm->get_color("text_editor/highlighting/text_color", "Editor");
- symbol_color = tm->get_color("text_editor/highlighting/symbol_color", "Editor");
- }
-
img->lock();
if (bg_color.a == 0)
diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_plugin.cpp
new file mode 100644
index 0000000000..42f1adcadf
--- /dev/null
+++ b/editor/plugins/physical_bone_plugin.cpp
@@ -0,0 +1,123 @@
+/*************************************************************************/
+/* physical_bone_plugin.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "physical_bone_plugin.h"
+#include "editor/plugins/spatial_editor_plugin.h"
+#include "scene/3d/physics_body.h"
+
+void PhysicalBoneEditor::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_on_toggle_button_transform_joint", "is_pressed"), &PhysicalBoneEditor::_on_toggle_button_transform_joint);
+}
+
+void PhysicalBoneEditor::_on_toggle_button_transform_joint(bool p_is_pressed) {
+
+ _set_move_joint();
+}
+
+void PhysicalBoneEditor::_set_move_joint() {
+ if (selected) {
+ selected->_set_gizmo_move_joint(button_transform_joint->is_pressed());
+ }
+}
+
+PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) :
+ editor(p_editor),
+ selected(NULL) {
+
+ spatial_editor_hb = memnew(HBoxContainer);
+ spatial_editor_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN);
+ SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
+
+ spatial_editor_hb->add_child(memnew(VSeparator));
+
+ button_transform_joint = memnew(ToolButton);
+ spatial_editor_hb->add_child(button_transform_joint);
+
+ button_transform_joint->set_text(TTR("Move joint"));
+ button_transform_joint->set_icon(SpatialEditor::get_singleton()->get_icon("PhysicalBone", "EditorIcons"));
+ button_transform_joint->set_toggle_mode(true);
+ button_transform_joint->connect("toggled", this, "_on_toggle_button_transform_joint");
+
+ hide();
+}
+
+PhysicalBoneEditor::~PhysicalBoneEditor() {
+ // TODO the spatial_editor_hb should be removed from SpatialEditor, but in this moment it's not possible
+ for (int i = spatial_editor_hb->get_child_count() - 1; 0 <= i; --i) {
+ Node *n = spatial_editor_hb->get_child(i);
+ spatial_editor_hb->remove_child(n);
+ memdelete(n);
+ }
+ memdelete(spatial_editor_hb);
+}
+
+void PhysicalBoneEditor::set_selected(PhysicalBone *p_pb) {
+
+ button_transform_joint->set_pressed(false);
+
+ _set_move_joint();
+ selected = p_pb;
+ _set_move_joint();
+}
+
+void PhysicalBoneEditor::hide() {
+ spatial_editor_hb->hide();
+}
+
+void PhysicalBoneEditor::show() {
+ spatial_editor_hb->show();
+}
+
+PhysicalBonePlugin::PhysicalBonePlugin(EditorNode *p_editor) :
+ editor(p_editor),
+ selected(NULL) {
+
+ physical_bone_editor = memnew(PhysicalBoneEditor(editor));
+}
+
+void PhysicalBonePlugin::make_visible(bool p_visible) {
+ if (p_visible) {
+
+ physical_bone_editor->show();
+ } else {
+
+ physical_bone_editor->hide();
+ physical_bone_editor->set_selected(NULL);
+ selected = NULL;
+ }
+}
+
+void PhysicalBonePlugin::edit(Object *p_node) {
+ selected = static_cast<PhysicalBone *>(p_node); // Trust it
+ ERR_FAIL_COND(!selected);
+
+ physical_bone_editor->set_selected(selected);
+}
diff --git a/editor/plugins/physical_bone_plugin.h b/editor/plugins/physical_bone_plugin.h
new file mode 100644
index 0000000000..9e7a50307a
--- /dev/null
+++ b/editor/plugins/physical_bone_plugin.h
@@ -0,0 +1,78 @@
+/*************************************************************************/
+/* physical_bone_plugin.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef PHYSICAL_BONE_PLUGIN_H
+#define PHYSICAL_BONE_PLUGIN_H
+
+#include "editor/editor_node.h"
+
+class PhysicalBoneEditor : public Object {
+ GDCLASS(PhysicalBoneEditor, Object);
+
+ EditorNode *editor;
+ HBoxContainer *spatial_editor_hb;
+ ToolButton *button_transform_joint;
+
+ PhysicalBone *selected;
+
+protected:
+ static void _bind_methods();
+
+private:
+ void _on_toggle_button_transform_joint(bool p_is_pressed);
+ void _set_move_joint();
+
+public:
+ PhysicalBoneEditor(EditorNode *p_editor);
+ ~PhysicalBoneEditor();
+
+ void set_selected(PhysicalBone *p_pb);
+
+ void hide();
+ void show();
+};
+
+class PhysicalBonePlugin : public EditorPlugin {
+ GDCLASS(PhysicalBonePlugin, EditorPlugin);
+
+ EditorNode *editor;
+ PhysicalBone *selected;
+ PhysicalBoneEditor *physical_bone_editor;
+
+public:
+ virtual String get_name() const { return "PhysicalBone"; }
+ virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone"); }
+ virtual void make_visible(bool p_visible);
+ virtual void edit(Object *p_node);
+
+ PhysicalBonePlugin(EditorNode *p_editor);
+};
+
+#endif
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 2815fa6406..f04e0a801c 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -314,6 +314,9 @@ void Polygon2DEditor::_menu_option(int p_option) {
undo_redo->commit_action();
} break;
+ case UVEDIT_GRID_SETTINGS: {
+ grid_settings->popup_centered_minsize();
+ } break;
default: {
AbstractPolygon2DEditor::_menu_option(p_option);
} break;
@@ -377,23 +380,23 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_drag_from = Vector2(mb->get_position().x, mb->get_position().y);
uv_drag = true;
- uv_prev = node->get_uv();
+ points_prev = node->get_uv();
if (uv_edit_mode[0]->is_pressed()) { //edit uv
- uv_prev = node->get_uv();
+ points_prev = node->get_uv();
} else { //edit polygon
- uv_prev = node->get_polygon();
+ points_prev = node->get_polygon();
}
uv_move_current = uv_mode;
if (uv_move_current == UV_MODE_CREATE) {
if (!uv_create) {
- uv_prev.resize(0);
+ points_prev.resize(0);
Vector2 tuv = mtx.affine_inverse().xform(Vector2(mb->get_position().x, mb->get_position().y));
- uv_prev.push_back(tuv);
+ points_prev.push_back(tuv);
uv_create_to = tuv;
- uv_drag_index = 0;
+ point_drag_index = 0;
uv_drag_from = tuv;
uv_drag = true;
uv_create = true;
@@ -401,18 +404,18 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_create_poly_prev = node->get_polygon();
uv_create_bones_prev = node->call("_get_bones");
splits_prev = node->get_splits();
- node->set_polygon(uv_prev);
- node->set_uv(uv_prev);
+ node->set_polygon(points_prev);
+ node->set_uv(points_prev);
} else {
Vector2 tuv = mtx.affine_inverse().xform(Vector2(mb->get_position().x, mb->get_position().y));
- if (uv_prev.size() > 3 && tuv.distance_to(uv_prev[0]) < 8) {
+ if (points_prev.size() > 3 && tuv.distance_to(points_prev[0]) < 8) {
undo_redo->create_action(TTR("Create Polygon & UV"));
undo_redo->add_do_method(node, "set_uv", node->get_uv());
- undo_redo->add_undo_method(node, "set_uv", uv_prev);
+ undo_redo->add_undo_method(node, "set_uv", points_prev);
undo_redo->add_do_method(node, "set_polygon", node->get_polygon());
- undo_redo->add_undo_method(node, "set_polygon", uv_prev);
+ undo_redo->add_undo_method(node, "set_polygon", points_prev);
undo_redo->add_do_method(node, "clear_bones");
undo_redo->add_undo_method(node, "_set_bones", node->call("_get_bones"));
undo_redo->add_do_method(uv_edit_draw, "update");
@@ -422,12 +425,12 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_create = false;
_uv_mode(UV_MODE_EDIT_POINT);
} else {
- uv_prev.push_back(tuv);
- uv_drag_index = uv_prev.size() - 1;
+ points_prev.push_back(tuv);
+ point_drag_index = points_prev.size() - 1;
uv_drag_from = tuv;
}
- node->set_polygon(uv_prev);
- node->set_uv(uv_prev);
+ node->set_polygon(points_prev);
+ node->set_uv(points_prev);
}
}
@@ -443,34 +446,34 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (uv_move_current == UV_MODE_EDIT_POINT) {
- uv_drag_index = -1;
- for (int i = 0; i < uv_prev.size(); i++) {
+ point_drag_index = -1;
+ for (int i = 0; i < points_prev.size(); i++) {
- Vector2 tuv = mtx.xform(uv_prev[i]);
+ Vector2 tuv = mtx.xform(points_prev[i]);
if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
uv_drag_from = tuv;
- uv_drag_index = i;
+ point_drag_index = i;
}
}
- if (uv_drag_index == -1) {
+ if (point_drag_index == -1) {
uv_drag = false;
}
}
if (uv_move_current == UV_MODE_ADD_SPLIT) {
- int drag_index = -1;
- drag_index = -1;
- for (int i = 0; i < uv_prev.size(); i++) {
+ int split_to_index = -1;
+ split_to_index = -1;
+ for (int i = 0; i < points_prev.size(); i++) {
- Vector2 tuv = mtx.xform(uv_prev[i]);
+ Vector2 tuv = mtx.xform(points_prev[i]);
if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
- drag_index = i;
+ split_to_index = i;
}
}
- if (drag_index == -1) {
+ if (split_to_index == -1) {
split_create = false;
return;
}
@@ -478,41 +481,65 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (split_create) {
split_create = false;
- if (drag_index < uv_drag_index) {
- SWAP(drag_index, uv_drag_index);
+ if (split_to_index < point_drag_index) {
+ SWAP(split_to_index, point_drag_index);
}
bool valid = true;
- if (drag_index == uv_drag_index) {
+ String split_error;
+ if (split_to_index == point_drag_index) {
+ split_error = TTR("Split point with itself.");
valid = false;
}
- if (drag_index + 1 == uv_drag_index) {
+ if (split_to_index + 1 == point_drag_index) {
//not a split,goes along the edge
+ split_error = TTR("Split can't form an existing edge.");
valid = false;
}
- if (drag_index == uv_prev.size() - 1 && uv_drag_index == 0) {
+ if (split_to_index == points_prev.size() - 1 && point_drag_index == 0) {
//not a split,goes along the edge
+ split_error = TTR("Split can't form an existing edge.");
valid = false;
}
+
for (int i = 0; i < splits_prev.size(); i += 2) {
- if (splits_prev[i] == uv_drag_index && splits_prev[i + 1] == drag_index) {
+
+ if (splits_prev[i] == point_drag_index && splits_prev[i + 1] == split_to_index) {
//already exists
+ split_error = TTR("Split already exists.");
valid = false;
+ break;
}
- if (splits_prev[i] > uv_drag_index && splits_prev[i + 1] > drag_index) {
- //crossing
- valid = false;
+
+ int a_state; //-1, outside split, 0 split point, +1, inside split
+ if (point_drag_index == splits_prev[i] || point_drag_index == splits_prev[i + 1]) {
+ a_state = 0;
+ } else if (point_drag_index < splits_prev[i] || point_drag_index > splits_prev[i + 1]) {
+ a_state = -1;
+ } else {
+ a_state = 1;
+ }
+
+ int b_state; //-1, outside split, 0 split point, +1, inside split
+ if (split_to_index == splits_prev[i] || split_to_index == splits_prev[i + 1]) {
+ b_state = 0;
+ } else if (split_to_index < splits_prev[i] || split_to_index > splits_prev[i + 1]) {
+ b_state = -1;
+ } else {
+ b_state = 1;
}
- if (splits_prev[i] < uv_drag_index && splits_prev[i + 1] < drag_index) {
- //crossing opposite direction
+ if (b_state * a_state < 0) {
+ //crossing
+ split_error = "Split crosses another split.";
valid = false;
+ break;
}
}
if (valid) {
- splits_prev.push_back(uv_drag_index);
- splits_prev.push_back(drag_index);
+ splits_prev.push_back(point_drag_index);
+ splits_prev.push_back(split_to_index);
undo_redo->create_action(TTR("Add Split"));
@@ -522,13 +549,14 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->add_undo_method(uv_edit_draw, "update");
undo_redo->commit_action();
} else {
- error->set_text(TTR("Invalid Split"));
+ error->set_text(TTR("Invalid Split: ") + split_error);
error->popup_centered_minsize();
}
} else {
- uv_drag_index = drag_index;
+ point_drag_index = split_to_index;
split_create = true;
+ splits_prev = node->get_splits();
uv_create_to = mtx.affine_inverse().xform(Vector2(mb->get_position().x, mb->get_position().y));
}
}
@@ -536,11 +564,11 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (uv_move_current == UV_MODE_REMOVE_SPLIT) {
for (int i = 0; i < splits_prev.size(); i += 2) {
- if (splits_prev[i] < 0 || splits_prev[i] >= uv_prev.size())
+ if (splits_prev[i] < 0 || splits_prev[i] >= points_prev.size())
continue;
- if (splits_prev[i + 1] < 0 || splits_prev[i] >= uv_prev.size())
+ if (splits_prev[i + 1] < 0 || splits_prev[i] >= points_prev.size())
continue;
- Vector2 e[2] = { mtx.xform(uv_prev[splits_prev[i]]), mtx.xform(uv_prev[splits_prev[i + 1]]) };
+ Vector2 e[2] = { mtx.xform(points_prev[splits_prev[i]]), mtx.xform(points_prev[splits_prev[i + 1]]) };
Vector2 mp = Vector2(mb->get_position().x, mb->get_position().y);
Vector2 cp = Geometry::get_closest_point_to_segment_2d(mp, e);
if (cp.distance_to(mp) < 8) {
@@ -571,7 +599,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
}
}
- if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uv_prev.size()) {
+ if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == points_prev.size()) {
prev_weights = node->get_bone_weights(bone_selected);
bone_painting = true;
@@ -585,10 +613,10 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (uv_edit_mode[0]->is_pressed()) { //edit uv
undo_redo->add_do_method(node, "set_uv", node->get_uv());
- undo_redo->add_undo_method(node, "set_uv", uv_prev);
+ undo_redo->add_undo_method(node, "set_uv", points_prev);
} else if (uv_edit_mode[1]->is_pressed()) { //edit polygon
undo_redo->add_do_method(node, "set_polygon", node->get_polygon());
- undo_redo->add_undo_method(node, "set_polygon", uv_prev);
+ undo_redo->add_undo_method(node, "set_polygon", points_prev);
}
undo_redo->add_do_method(uv_edit_draw, "update");
undo_redo->add_undo_method(uv_edit_draw, "update");
@@ -621,9 +649,9 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_drag = false;
if (uv_edit_mode[0]->is_pressed()) { //edit uv
- node->set_uv(uv_prev);
+ node->set_uv(points_prev);
} else if (uv_edit_mode[1]->is_pressed()) { //edit polygon
- node->set_polygon(uv_prev);
+ node->set_polygon(points_prev);
}
uv_edit_draw->update();
} else if (split_create) {
@@ -666,8 +694,8 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} break;
case UV_MODE_EDIT_POINT: {
- PoolVector<Vector2> uv_new = uv_prev;
- uv_new.set(uv_drag_index, uv_new[uv_drag_index] + drag);
+ PoolVector<Vector2> uv_new = points_prev;
+ uv_new.set(point_drag_index, uv_new[point_drag_index] + drag);
if (uv_edit_mode[0]->is_pressed()) { //edit uv
node->set_uv(uv_new);
@@ -677,7 +705,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} break;
case UV_MODE_MOVE: {
- PoolVector<Vector2> uv_new = uv_prev;
+ PoolVector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
uv_new.set(i, uv_new[i] + drag);
@@ -691,16 +719,16 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
case UV_MODE_ROTATE: {
Vector2 center;
- PoolVector<Vector2> uv_new = uv_prev;
+ PoolVector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
- center += uv_prev[i];
+ center += points_prev[i];
center /= uv_new.size();
float angle = (uv_drag_from - mtx.xform(center)).normalized().angle_to((uv_drag_to - mtx.xform(center)).normalized());
for (int i = 0; i < uv_new.size(); i++) {
- Vector2 rel = uv_prev[i] - center;
+ Vector2 rel = points_prev[i] - center;
rel = rel.rotated(angle);
uv_new.set(i, center + rel);
}
@@ -715,10 +743,10 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
case UV_MODE_SCALE: {
Vector2 center;
- PoolVector<Vector2> uv_new = uv_prev;
+ PoolVector<Vector2> uv_new = points_prev;
for (int i = 0; i < uv_new.size(); i++)
- center += uv_prev[i];
+ center += points_prev[i];
center /= uv_new.size();
float from_dist = uv_drag_from.distance_to(mtx.xform(center));
@@ -729,7 +757,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
float scale = to_dist / from_dist;
for (int i = 0; i < uv_new.size(); i++) {
- Vector2 rel = uv_prev[i] - center;
+ Vector2 rel = points_prev[i] - center;
rel = rel * scale;
uv_new.set(i, center + rel);
}
@@ -757,7 +785,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
PoolVector<float>::Write w = painted_weights.write();
PoolVector<float>::Read r = prev_weights.read();
- PoolVector<Vector2>::Read rv = uv_prev.read();
+ PoolVector<Vector2>::Read rv = points_prev.read();
for (int i = 0; i < pc; i++) {
if (mtx.xform(rv[i]).distance_to(bone_paint_pos) < radius) {
@@ -809,6 +837,8 @@ void Polygon2DEditor::_uv_draw() {
if (base_tex.is_null())
return;
+ String warning;
+
Transform2D mtx;
mtx.elements[2] = -uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom));
@@ -894,7 +924,7 @@ void Polygon2DEditor::_uv_draw() {
}
if (split_create) {
- Vector2 from = uvs[uv_drag_index];
+ Vector2 from = uvs[point_drag_index];
Vector2 to = uv_create_to;
uv_edit_draw->draw_line(mtx.xform(from), mtx.xform(to), Color(0.9, 0.5, 0.5), 2);
}
@@ -911,6 +941,50 @@ void Polygon2DEditor::_uv_draw() {
if (uv_mode == UV_MODE_PAINT_WEIGHT || uv_mode == UV_MODE_CLEAR_WEIGHT) {
+ NodePath bone_path;
+ for (int i = 0; i < bone_scroll_vb->get_child_count(); i++) {
+ CheckBox *c = Object::cast_to<CheckBox>(bone_scroll_vb->get_child(i));
+ if (c && c->is_pressed()) {
+ bone_path = node->get_bone_path(i);
+ break;
+ }
+ }
+
+ //draw skeleton
+ NodePath skeleton_path = node->get_skeleton();
+ if (node->has_node(skeleton_path)) {
+ Skeleton2D *skeleton = Object::cast_to<Skeleton2D>(node->get_node(skeleton_path));
+ if (skeleton) {
+ for (int i = 0; i < skeleton->get_bone_count(); i++) {
+
+ Bone2D *bone = skeleton->get_bone(i);
+ if (bone->get_rest() == Transform2D(0, 0, 0, 0, 0, 0))
+ continue; //not set
+
+ bool current = bone_path == skeleton->get_path_to(bone);
+
+ for (int j = 0; j < bone->get_child_count(); j++) {
+
+ Node2D *n = Object::cast_to<Node2D>(bone->get_child(j));
+ if (!n)
+ continue;
+
+ bool edit_bone = n->has_meta("_edit_bone_") && n->get_meta("_edit_bone_");
+ if (edit_bone) {
+
+ Transform2D bone_xform = node->get_global_transform().affine_inverse() * (skeleton->get_global_transform() * bone->get_skeleton_rest());
+ Transform2D endpoint_xform = bone_xform * n->get_transform();
+
+ Color color = current ? Color(1, 1, 1) : Color(0.5, 0.5, 0.5);
+ uv_edit_draw->draw_line(mtx.xform(bone_xform.get_origin()), mtx.xform(endpoint_xform.get_origin()), Color(0, 0, 0), current ? 5 : 4);
+ uv_edit_draw->draw_line(mtx.xform(bone_xform.get_origin()), mtx.xform(endpoint_xform.get_origin()), color, current ? 3 : 2);
+ }
+ }
+ }
+ }
+ }
+
+ //draw paint circle
uv_edit_draw->draw_circle(bone_paint_pos, bone_paint_radius->get_value() * EDSCALE, Color(1, 1, 1, 0.1));
}
@@ -1075,6 +1149,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_menu->get_popup()->add_item(TTR("UV->Polygon"), UVEDIT_UV_TO_POLYGON);
uv_menu->get_popup()->add_separator();
uv_menu->get_popup()->add_item(TTR("Clear UV"), UVEDIT_UV_CLEAR);
+ uv_menu->get_popup()->add_separator();
+ uv_menu->get_popup()->add_item(TTR("Grid Settings"), UVEDIT_GRID_SETTINGS);
uv_menu->get_popup()->connect("id_pressed", this, "_menu_option");
uv_mode_hb->add_child(memnew(VSeparator));
@@ -1097,8 +1173,11 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
b_snap_grid->set_tooltip(TTR("Show Grid"));
b_snap_grid->connect("toggled", this, "_set_show_grid");
- uv_mode_hb->add_child(memnew(VSeparator));
- uv_mode_hb->add_child(memnew(Label(TTR("Grid Offset:"))));
+ grid_settings = memnew(AcceptDialog);
+ grid_settings->set_title(TTR("Configure Grid:"));
+ add_child(grid_settings);
+ VBoxContainer *grid_settings_vb = memnew(VBoxContainer);
+ grid_settings->add_child(grid_settings_vb);
SpinBox *sb_off_x = memnew(SpinBox);
sb_off_x->set_min(-256);
@@ -1107,7 +1186,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
sb_off_x->set_value(snap_offset.x);
sb_off_x->set_suffix("px");
sb_off_x->connect("value_changed", this, "_set_snap_off_x");
- uv_mode_hb->add_child(sb_off_x);
+ grid_settings_vb->add_margin_child(TTR("Grid Offset X:"), sb_off_x);
SpinBox *sb_off_y = memnew(SpinBox);
sb_off_y->set_min(-256);
@@ -1116,10 +1195,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
sb_off_y->set_value(snap_offset.y);
sb_off_y->set_suffix("px");
sb_off_y->connect("value_changed", this, "_set_snap_off_y");
- uv_mode_hb->add_child(sb_off_y);
-
- uv_mode_hb->add_child(memnew(VSeparator));
- uv_mode_hb->add_child(memnew(Label(TTR("Grid Step:"))));
+ grid_settings_vb->add_margin_child(TTR("Grid Offset Y:"), sb_off_y);
SpinBox *sb_step_x = memnew(SpinBox);
sb_step_x->set_min(-256);
@@ -1128,7 +1204,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
sb_step_x->set_value(snap_step.x);
sb_step_x->set_suffix("px");
sb_step_x->connect("value_changed", this, "_set_snap_step_x");
- uv_mode_hb->add_child(sb_step_x);
+ grid_settings_vb->add_margin_child(TTR("Grid Step X:"), sb_step_x);
SpinBox *sb_step_y = memnew(SpinBox);
sb_step_y->set_min(-256);
@@ -1137,7 +1213,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
sb_step_y->set_value(snap_step.y);
sb_step_y->set_suffix("px");
sb_step_y->connect("value_changed", this, "_set_snap_step_y");
- uv_mode_hb->add_child(sb_step_y);
+ grid_settings_vb->add_margin_child(TTR("Grid Step Y:"), sb_step_y);
uv_mode_hb->add_child(memnew(VSeparator));
uv_icon_zoom = memnew(TextureRect);
@@ -1150,7 +1226,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_zoom->set_v_size_flags(SIZE_SHRINK_CENTER);
uv_mode_hb->add_child(uv_zoom);
- uv_zoom->set_custom_minimum_size(Size2(200, 0));
+ uv_zoom->set_custom_minimum_size(Size2(80 * EDSCALE, 0));
uv_zoom_value = memnew(SpinBox);
uv_zoom->share(uv_zoom_value);
uv_zoom_value->set_custom_minimum_size(Size2(50, 0));
@@ -1166,7 +1242,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
bone_scroll_main_vb = memnew(VBoxContainer);
bone_scroll_main_vb->hide();
- sync_bones = memnew(Button(TTR("Sync Bones")));
+ sync_bones = memnew(Button(TTR("Sync Bones to Polygon")));
bone_scroll_main_vb->add_child(sync_bones);
uv_main_hb->add_child(bone_scroll_main_vb);
bone_scroll = memnew(ScrollContainer);
@@ -1181,7 +1257,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_edit_draw->connect("draw", this, "_uv_draw");
uv_edit_draw->connect("gui_input", this, "_uv_input");
uv_draw_zoom = 1.0;
- uv_drag_index = -1;
+ point_drag_index = -1;
uv_drag = false;
uv_create = false;
updating_uv_scroll = false;
diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h
index b18ead4d98..f9b42a21c2 100644
--- a/editor/plugins/polygon_2d_editor_plugin.h
+++ b/editor/plugins/polygon_2d_editor_plugin.h
@@ -45,7 +45,8 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
MODE_EDIT_UV = MODE_CONT,
UVEDIT_POLYGON_TO_UV,
UVEDIT_UV_TO_POLYGON,
- UVEDIT_UV_CLEAR
+ UVEDIT_UV_CLEAR,
+ UVEDIT_GRID_SETTINGS
};
@@ -91,20 +92,21 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
int bone_painting_bone;
PoolVector<float> prev_weights;
Vector2 bone_paint_pos;
+ AcceptDialog *grid_settings;
void _sync_bones();
void _update_bone_list();
Vector2 uv_draw_ofs;
float uv_draw_zoom;
- PoolVector<Vector2> uv_prev;
+ PoolVector<Vector2> points_prev;
PoolVector<Vector2> uv_create_uv_prev;
PoolVector<Vector2> uv_create_poly_prev;
Array uv_create_bones_prev;
PoolVector<int> splits_prev;
Vector2 uv_create_to;
- int uv_drag_index;
+ int point_drag_index;
bool uv_drag;
bool uv_create;
bool split_create;
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index c872a6f28b..45f5e667fa 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -746,6 +746,8 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c
_goto_line(p_row);
+ result.class_name = result.class_name.trim_prefix("_");
+
switch (result.type) {
case ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION: {
@@ -1007,6 +1009,10 @@ void ScriptTextEditor::_edit_option(int p_op) {
}
int next_line = to_line + 1;
+ if (to_line >= tx->get_line_count() - 1) {
+ tx->set_line(to_line, tx->get_line(to_line) + "\n");
+ }
+
tx->begin_complex_operation();
for (int i = from_line; i <= to_line; i++) {
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp
new file mode 100644
index 0000000000..40a696119e
--- /dev/null
+++ b/editor/plugins/skeleton_editor_plugin.cpp
@@ -0,0 +1,183 @@
+/*************************************************************************/
+/* skeleton_editor_plugin.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "skeleton_editor_plugin.h"
+#include "scene/3d/collision_shape.h"
+#include "scene/3d/physics_body.h"
+#include "scene/3d/physics_joint.h";
+#include "scene/resources/capsule_shape.h"
+#include "scene/resources/sphere_shape.h"
+#include "spatial_editor_plugin.h"
+
+void SkeletonEditor::_on_click_option(int p_option) {
+ if (!skeleton) {
+ return;
+ }
+
+ switch (p_option) {
+ case MENU_OPTION_CREATE_PHYSICAL_SKELETON: {
+ create_physical_skeleton();
+ } break;
+ }
+}
+
+void SkeletonEditor::create_physical_skeleton() {
+ UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ Node *owner = skeleton == get_tree()->get_edited_scene_root() ? skeleton : skeleton->get_owner();
+
+ const int bc = skeleton->get_bone_count();
+
+ if (!bc) {
+ return;
+ }
+
+ Vector<BoneInfo> bones_infos;
+ bones_infos.resize(bc);
+
+ for (int bone_id = 0; bc > bone_id; ++bone_id) {
+
+ const int parent = skeleton->get_bone_parent(bone_id);
+ const int parent_parent = skeleton->get_bone_parent(parent);
+
+ if (parent < 0) {
+
+ bones_infos[bone_id].relative_rest = skeleton->get_bone_rest(bone_id);
+
+ } else {
+
+ bones_infos[bone_id].relative_rest = bones_infos[parent].relative_rest * skeleton->get_bone_rest(bone_id);
+
+ /// create physical bone on parent
+ if (!bones_infos[parent].physical_bone) {
+
+ bones_infos[parent].physical_bone = create_physical_bone(parent, bone_id, bones_infos);
+
+ ur->create_action(TTR("Create physical bones"));
+ ur->add_do_method(skeleton, "add_child", bones_infos[parent].physical_bone);
+ ur->add_do_reference(bones_infos[parent].physical_bone);
+ ur->add_undo_method(skeleton, "remove_child", bones_infos[parent].physical_bone);
+ ur->commit_action();
+
+ bones_infos[parent].physical_bone->set_bone_name(skeleton->get_bone_name(parent));
+ bones_infos[parent].physical_bone->set_owner(owner);
+ bones_infos[parent].physical_bone->get_child(0)->set_owner(owner); // set shape owner
+
+ /// Create joint between parent of parent
+ if (-1 != parent_parent) {
+
+ bones_infos[parent].physical_bone->set_joint_type(PhysicalBone::JOINT_TYPE_PIN);
+ }
+ }
+ }
+ }
+}
+
+PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) {
+
+ real_t half_height(skeleton->get_bone_rest(bone_child_id).origin.length() * 0.5);
+ real_t radius(half_height * 0.2);
+
+ CapsuleShape *bone_shape_capsule = memnew(CapsuleShape);
+ bone_shape_capsule->set_height((half_height - radius) * 2);
+ bone_shape_capsule->set_radius(radius);
+
+ CollisionShape *bone_shape = memnew(CollisionShape);
+ bone_shape->set_shape(bone_shape_capsule);
+
+ Transform body_transform;
+ body_transform.origin = Vector3(0, 0, -half_height);
+
+ Transform joint_transform;
+ joint_transform.origin = Vector3(0, 0, half_height);
+
+ PhysicalBone *physical_bone = memnew(PhysicalBone);
+ physical_bone->add_child(bone_shape);
+ physical_bone->set_name("Physical Bone " + skeleton->get_bone_name(bone_id));
+ physical_bone->set_body_offset(body_transform);
+ physical_bone->set_joint_offset(joint_transform);
+ return physical_bone;
+}
+
+void SkeletonEditor::edit(Skeleton *p_node) {
+ skeleton = p_node;
+}
+
+void SkeletonEditor::_node_removed(Node *p_node) {
+
+ if (p_node == skeleton) {
+ skeleton = NULL;
+ options->hide();
+ }
+}
+
+void SkeletonEditor::_bind_methods() {
+ ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option);
+}
+
+SkeletonEditor::SkeletonEditor() {
+ options = memnew(MenuButton);
+ SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
+
+ options->set_text(TTR("Skeleton"));
+ options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("Skeleton", "EditorIcons"));
+
+ options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON);
+
+ options->get_popup()->connect("id_pressed", this, "_on_click_option");
+ options->hide();
+}
+
+SkeletonEditor::~SkeletonEditor() {}
+
+void SkeletonEditorPlugin::edit(Object *p_object) {
+ skeleton_editor->edit(Object::cast_to<Skeleton>(p_object));
+}
+
+bool SkeletonEditorPlugin::handles(Object *p_object) const {
+ return p_object->is_class("Skeleton");
+}
+
+void SkeletonEditorPlugin::make_visible(bool p_visible) {
+ if (p_visible) {
+ skeleton_editor->options->show();
+ } else {
+
+ skeleton_editor->options->hide();
+ skeleton_editor->edit(NULL);
+ }
+}
+
+SkeletonEditorPlugin::SkeletonEditorPlugin(EditorNode *p_node) {
+ editor = p_node;
+ skeleton_editor = memnew(SkeletonEditor);
+ editor->get_viewport()->add_child(skeleton_editor);
+}
+
+SkeletonEditorPlugin::~SkeletonEditorPlugin() {}
diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_editor_plugin.h
new file mode 100644
index 0000000000..b9bdf91902
--- /dev/null
+++ b/editor/plugins/skeleton_editor_plugin.h
@@ -0,0 +1,95 @@
+/*************************************************************************/
+/* skeleton_editor_plugin.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef SKELETON_EDITOR_PLUGIN_H
+#define SKELETON_EDITOR_PLUGIN_H
+
+#include "editor/editor_node.h"
+#include "editor/editor_plugin.h"
+#include "scene/3d/skeleton.h"
+
+class PhysicalBone;
+class Joint;
+
+class SkeletonEditor : public Node {
+ GDCLASS(SkeletonEditor, Node);
+
+ enum Menu {
+ MENU_OPTION_CREATE_PHYSICAL_SKELETON
+ };
+
+ struct BoneInfo {
+ PhysicalBone *physical_bone;
+ Transform relative_rest; // Relative to skeleton node
+ BoneInfo() :
+ physical_bone(NULL) {}
+ };
+
+ Skeleton *skeleton;
+
+ MenuButton *options;
+
+ void _on_click_option(int p_option);
+
+ friend class SkeletonEditorPlugin;
+
+protected:
+ void _node_removed(Node *p_node);
+ static void _bind_methods();
+
+ void create_physical_skeleton();
+ PhysicalBone *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos);
+
+public:
+ void edit(Skeleton *p_mesh);
+
+ SkeletonEditor();
+ ~SkeletonEditor();
+};
+
+class SkeletonEditorPlugin : public EditorPlugin {
+
+ GDCLASS(SkeletonEditorPlugin, EditorPlugin);
+
+ EditorNode *editor;
+ SkeletonEditor *skeleton_editor;
+
+public:
+ virtual String get_name() const { return "Skeleton"; }
+ virtual bool has_main_screen() const { return false; }
+ virtual void edit(Object *p_object);
+ virtual bool handles(Object *p_object) const;
+ virtual void make_visible(bool p_visible);
+
+ SkeletonEditorPlugin(EditorNode *p_node);
+ ~SkeletonEditorPlugin();
+};
+
+#endif // SKELETON_EDITOR_PLUGIN_H
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index bda83929fd..5b713ef3c4 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -72,6 +72,14 @@
#define MIN_FOV 0.01
#define MAX_FOV 179
+#ifdef TOOLS_ENABLED
+#define get_global_gizmo_transform get_global_gizmo_transform
+#define get_local_gizmo_transform get_local_gizmo_transform
+#else
+#define get_global_gizmo_transform get_global_transform
+#define get_local_gizmo_transform get_transform
+#endif
+
void SpatialEditorViewport::_update_camera(float p_interp_delta) {
bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL;
@@ -584,8 +592,8 @@ void SpatialEditorViewport::_compute_edit(const Point2 &p_point) {
if (!se)
continue;
- se->original = se->sp->get_global_transform();
- se->original_local = se->sp->get_transform();
+ se->original = se->sp->get_global_gizmo_transform();
+ se->original_local = se->sp->get_local_gizmo_transform();
}
}
@@ -1184,7 +1192,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (!se)
continue;
- undo_redo->add_do_method(sp, "set_global_transform", sp->get_global_transform());
+ undo_redo->add_do_method(sp, "set_global_transform", sp->get_global_gizmo_transform());
undo_redo->add_undo_method(sp, "set_global_transform", se->original);
}
undo_redo->commit_action();
@@ -2150,7 +2158,7 @@ void SpatialEditorViewport::_notification(int p_what) {
se->aabb = vi ? vi->get_aabb() : AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4));
}
- Transform t = sp->get_global_transform();
+ Transform t = sp->get_global_gizmo_transform();
t.translate(se->aabb.position);
// apply AABB scaling before item's global transform
@@ -2503,7 +2511,7 @@ void SpatialEditorViewport::_menu_option(int p_option) {
xform.scale_basis(sp->get_scale());
undo_redo->add_do_method(sp, "set_global_transform", xform);
- undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_transform());
+ undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_gizmo_transform());
}
undo_redo->commit_action();
} break;
@@ -2961,7 +2969,7 @@ void SpatialEditorViewport::focus_selection() {
if (!se)
continue;
- center += sp->get_global_transform().origin;
+ center += sp->get_global_gizmo_transform().origin;
count++;
}
@@ -3043,7 +3051,7 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, c
MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(child);
if (mesh_instance) {
AABB mesh_instance_bounds = mesh_instance->get_aabb();
- mesh_instance_bounds.position += mesh_instance->get_global_transform().origin - p_parent->get_global_transform().origin;
+ mesh_instance_bounds.position += mesh_instance->get_global_gizmo_transform().origin - p_parent->get_global_gizmo_transform().origin;
bounds.merge_with(mesh_instance_bounds);
}
bounds = _calculate_spatial_bounds(child, bounds);
@@ -3121,7 +3129,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
if (!scene.is_valid()) { // invalid scene
return false;
} else {
- instanced_scene = scene->instance();
+ instanced_scene = scene->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
}
}
}
@@ -3154,7 +3162,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
Transform global_transform;
Spatial *parent_spatial = Object::cast_to<Spatial>(parent);
if (parent_spatial)
- global_transform = parent_spatial->get_global_transform();
+ global_transform = parent_spatial->get_global_gizmo_transform();
global_transform.origin = spatial_editor->snap_point(_get_instance_position(p_point));
@@ -3787,7 +3795,8 @@ void SpatialEditor::update_transform_gizmo() {
if (!se)
continue;
- Transform xf = se->sp->get_global_transform();
+ Transform xf = se->sp->get_global_gizmo_transform();
+
if (first) {
center.position = xf.origin;
first = false;
@@ -4054,7 +4063,7 @@ void SpatialEditor::_xform_dialog_action() {
bool post = xform_type->get_selected() > 0;
- Transform tr = sp->get_global_transform();
+ Transform tr = sp->get_global_gizmo_transform();
if (post)
tr = tr * t;
else {
@@ -4064,7 +4073,7 @@ void SpatialEditor::_xform_dialog_action() {
}
undo_redo->add_do_method(sp, "set_global_transform", tr);
- undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_transform());
+ undo_redo->add_undo_method(sp, "set_global_transform", sp->get_global_gizmo_transform());
}
undo_redo->commit_action();
}
@@ -4598,7 +4607,10 @@ void SpatialEditor::_init_grid() {
PoolVector<Color> grid_colors[3];
PoolVector<Vector3> grid_points[3];
- Color grid_color = EditorSettings::get_singleton()->get("editors/3d/grid_color");
+ Color primary_grid_color = EditorSettings::get_singleton()->get("editors/3d/primary_grid_color");
+ Color secondary_grid_color = EditorSettings::get_singleton()->get("editors/3d/secondary_grid_color");
+ int grid_size = EditorSettings::get_singleton()->get("editors/3d/grid_size");
+ int primary_grid_steps = EditorSettings::get_singleton()->get("editors/3d/primary_grid_steps");
for (int i = 0; i < 3; i++) {
Vector3 axis;
@@ -4608,19 +4620,17 @@ void SpatialEditor::_init_grid() {
Vector3 axis_n2;
axis_n2[(i + 2) % 3] = 1;
-#define ORIGIN_GRID_SIZE 50
-
- for (int j = -ORIGIN_GRID_SIZE; j <= ORIGIN_GRID_SIZE; j++) {
- Vector3 p1 = axis_n1 * j + axis_n2 * -ORIGIN_GRID_SIZE;
+ for (int j = -grid_size; j <= grid_size; j++) {
+ Vector3 p1 = axis_n1 * j + axis_n2 * -grid_size;
Vector3 p1_dest = p1 * (-axis_n2 + axis_n1);
- Vector3 p2 = axis_n2 * j + axis_n1 * -ORIGIN_GRID_SIZE;
+ Vector3 p2 = axis_n2 * j + axis_n1 * -grid_size;
Vector3 p2_dest = p2 * (-axis_n1 + axis_n2);
- Color line_color = grid_color;
+ Color line_color = secondary_grid_color;
if (j == 0) {
continue;
- } else if (j % 10 == 0) {
- line_color *= 1.5;
+ } else if (j % primary_grid_steps == 0) {
+ line_color = primary_grid_color;
}
grid_points[i].push_back(p1);
@@ -5082,8 +5092,6 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Tool Rotate"), KEY_E);
ED_SHORTCUT("spatial_editor/tool_scale", TTR("Tool Scale"), KEY_R);
- ED_SHORTCUT("spatial_editor/display_wireframe", TTR("Display Wireframe"), KEY_Z);
-
ED_SHORTCUT("spatial_editor/freelook_toggle", TTR("Toggle Freelook"), KEY_MASK_SHIFT + KEY_F);
PopupMenu *p;
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index 2427cd966b..92b95963f9 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -744,7 +744,7 @@ ThemeEditor::ThemeEditor() {
item = test_tree->create_item(test_tree->get_root());
item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
item->set_editable(0, true);
- item->set_text(0, "check");
+ item->set_text(0, "Check");
item = test_tree->create_item(test_tree->get_root());
item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE);
item->set_editable(0, true);
@@ -753,7 +753,7 @@ ThemeEditor::ThemeEditor() {
item = test_tree->create_item(test_tree->get_root());
item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE);
item->set_editable(0, true);
- item->set_text(0, TTR("Have,Many,Several,Options!"));
+ item->set_text(0, TTR("Has,Many,Options"));
item->set_range(0, 2);
VBoxContainer *third_vb = memnew(VBoxContainer);
@@ -784,58 +784,6 @@ ThemeEditor::ThemeEditor() {
main_hb->add_constant_override("separation", 20 * EDSCALE);
- /*
- test_h_scroll = memnew( HScrollBar );
- test_h_scroll->set_position( Point2( 25, 225 ) );
- test_h_scroll->set_size( Point2( 150, 5 ) );
- panel->add_child(test_h_scroll);
-
- line_edit = memnew( LineEdit );
- line_edit->set_position( Point2( 25, 275 ) );
- line_edit->set_size( Point2( 150, 5 ) );
- line_edit->set_text("Line Edit");
- panel->add_child(line_edit);
-
- test_v_scroll = memnew( VScrollBar );
- test_v_scroll->set_position( Point2( 200, 25 ) );
- test_v_scroll->set_size( Point2( 5, 150 ) );
- panel->add_child(test_v_scroll);
-
- test_tree = memnew(Tree);
- test_tree->set_position( Point2( 300, 25 ) );
- test_tree->set_size( Point2( 200, 200 ) );
- panel->add_child(test_tree);
-
-
- TreeItem *item = test_tree->create_item();
- item->set_editable(0,true);
- item->set_text(0,"root");
- item = test_tree->create_item( test_tree->get_root() );
- item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
- item->set_editable(0,true);
- item->set_text(0,"check");
- item = test_tree->create_item( test_tree->get_root() );
- item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE);
- item->set_editable(0,true);
- item->set_range_config(0,0,20,0.1);
- item->set_range(0,2);
- item = test_tree->create_item( test_tree->get_root() );
- item->set_cell_mode(0, TreeItem::CELL_MODE_RANGE);
- item->set_editable(0,true);
- item->set_text(0,"Have,Many,Several,Options!"));
- item->set_range(0,2);
-
- Button *fd_button= memnew( Button );
- fd_button->set_position(Point2(300,275));
- fd_button->set_text("Open File Dialog");
- panel->add_child(fd_button);
-
- test_file_dialog = memnew( EditorFileDialog );
- panel->add_child(test_file_dialog);
-
- fd_button->connect("pressed", this,"_open_file_dialog");
-*/
-
add_del_dialog = memnew(ConfirmationDialog);
add_del_dialog->hide();
add_child(add_del_dialog);
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 8b8c756219..9f87fc82b5 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -81,7 +81,14 @@ void ProjectExportDialog::popup_export() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/export_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/export_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
}
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index de98c89db5..97d3a070ab 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -250,8 +250,10 @@ private:
void _create_folder() {
- if (project_name->get_text() == "" || created_folder_path != "")
+ if (project_name->get_text() == "" || created_folder_path != "" || project_name->get_text().ends_with(".") || project_name->get_text().ends_with(" ")) {
+ set_message(TTR("Invalid Project Name."), MESSAGE_WARNING);
return;
+ }
DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (d->change_dir(project_path->get_text()) == OK) {
@@ -723,9 +725,11 @@ void ProjectManager::_update_project_buttons() {
}
}
- erase_btn->set_disabled(selected_list.size() < 1);
- open_btn->set_disabled(selected_list.size() < 1);
- rename_btn->set_disabled(selected_list.size() < 1);
+ bool empty_selection = selected_list.empty();
+ erase_btn->set_disabled(empty_selection);
+ open_btn->set_disabled(empty_selection);
+ rename_btn->set_disabled(empty_selection);
+ run_btn->set_disabled(empty_selection);
}
void ProjectManager::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) {
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 05c3d7529b..a4265b4e32 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -160,7 +160,7 @@ void ProjectSettingsEditor::_action_edited() {
ti->set_text(0, old_name);
add_at = "input/" + old_name;
- message->set_text(TTR("Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or '\"'"));
+ message->set_text(TTR("Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\', or '\"'."));
message->popup_centered(Size2(300, 100) * EDSCALE);
return;
}
@@ -768,7 +768,14 @@ void ProjectSettingsEditor::popup_project_settings() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/project_settings_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/project_settings_bounds"));
} else {
- popup_centered_ratio();
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
globals_editor->update_category_list();
_update_translations();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index ac478c11e3..e0063925b1 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -3273,22 +3273,34 @@ void PropertyEditor::update_tree() {
while (hint.begins_with(itos(Variant::ARRAY) + ":")) {
type_name += "<Array";
type_name_suffix += ">";
- hint = hint.substr(2, hint.size() - 2);
+ hint = hint.right(2);
}
if (hint.find(":") >= 0) {
- hint = hint.substr(0, hint.find(":"));
+ int colon_pos = hint.find(":");
+ String hint_string = hint.right(colon_pos + 1);
+ hint = hint.left(colon_pos);
+
+ PropertyHint property_hint = PROPERTY_HINT_NONE;
+
if (hint.find("/") >= 0) {
- hint = hint.substr(0, hint.find("/"));
+ int slash_pos = hint.find("/");
+ property_hint = PropertyHint(hint.right(slash_pos + 1).to_int());
+ hint = hint.left(slash_pos);
+ }
+
+ if (property_hint == PROPERTY_HINT_RESOURCE_TYPE) {
+ type_name += "<" + hint_string;
+ } else {
+ type_name += "<" + Variant::get_type_name(Variant::Type(hint.to_int()));
}
- type_name += "<" + Variant::get_type_name(Variant::Type(hint.to_int()));
type_name_suffix += ">";
}
type_name += type_name_suffix;
if (v.is_array())
- item->set_text(1, type_name + "[" + itos(v.call("size")) + "]");
+ item->set_text(1, type_name + "(" + itos(v.call("size")) + ")");
else
- item->set_text(1, type_name + "[]");
+ item->set_text(1, type_name + "()");
if (show_type_icons)
item->set_icon(0, get_icon("PoolByteArray", "EditorIcons"));
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
new file mode 100644
index 0000000000..d617089142
--- /dev/null
+++ b/editor/rename_dialog.cpp
@@ -0,0 +1,691 @@
+/*************************************************************************/
+/* rename_dialog.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "rename_dialog.h"
+
+#include "editor_node.h"
+#include "editor_settings.h"
+#include "editor_themes.h"
+#include "modules/regex/regex.h"
+#include "plugins/script_editor_plugin.h"
+#include "print_string.h"
+#include "scene/gui/control.h"
+#include "scene/gui/label.h"
+#include "scene/gui/tab_container.h"
+
+RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo) {
+
+ scene_tree_editor = p_scene_tree_editor;
+ undo_redo = p_undo_redo;
+ preview_node = NULL;
+
+ set_title(TTR("Batch Rename"));
+
+ VBoxContainer *vbc = memnew(VBoxContainer);
+ add_child(vbc);
+
+ // -- Search/Replace Area
+
+ GridContainer *grd_main = memnew(GridContainer);
+ grd_main->set_columns(2);
+ grd_main->set_v_size_flags(SIZE_EXPAND_FILL);
+ vbc->add_child(grd_main);
+
+ // ---- 1st & 2nd row
+
+ Label *lbl_search = memnew(Label);
+ lbl_search->set_text(TTR("Search"));
+
+ lne_search = memnew(LineEdit);
+ lne_search->set_placeholder(TTR("Search"));
+ lne_search->set_name("lne_search");
+ lne_search->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Label *lbl_replace = memnew(Label);
+ lbl_replace->set_text(TTR("Replace"));
+
+ lne_replace = memnew(LineEdit);
+ lne_replace->set_placeholder(TTR("Replace"));
+ lne_replace->set_name("lne_replace");
+ lne_replace->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ grd_main->add_child(lbl_search);
+ grd_main->add_child(lbl_replace);
+ grd_main->add_child(lne_search);
+ grd_main->add_child(lne_replace);
+
+ // ---- 3rd & 4th row
+
+ Label *lbl_prefix = memnew(Label);
+ lbl_prefix->set_text(TTR("Prefix"));
+
+ lne_prefix = memnew(LineEdit);
+ lne_prefix->set_placeholder(TTR("Prefix"));
+ lne_prefix->set_name("lne_prefix");
+ lne_prefix->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Label *lbl_suffix = memnew(Label);
+ lbl_suffix->set_text(TTR("Suffix"));
+
+ lne_suffix = memnew(LineEdit);
+ lne_suffix->set_placeholder(TTR("Suffix"));
+ lne_suffix->set_name("lne_suffix");
+ lne_suffix->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ grd_main->add_child(lbl_prefix);
+ grd_main->add_child(lbl_suffix);
+ grd_main->add_child(lne_prefix);
+ grd_main->add_child(lne_suffix);
+
+ // -- Feature Tabs
+
+ const int feature_min_height = 160;
+
+ Ref<Theme> collapse_theme = create_editor_theme();
+ collapse_theme->set_icon("checked", "CheckBox", collapse_theme->get_icon("GuiTreeArrowDown", "EditorIcons"));
+ collapse_theme->set_icon("unchecked", "CheckBox", collapse_theme->get_icon("GuiTreeArrowRight", "EditorIcons"));
+
+ CheckBox *chk_collapse_features = memnew(CheckBox);
+ chk_collapse_features->set_text(TTR("Advanced options"));
+ chk_collapse_features->set_theme(collapse_theme);
+ chk_collapse_features->set_focus_mode(FOCUS_NONE);
+ vbc->add_child(chk_collapse_features);
+
+ tabc_features = memnew(TabContainer);
+ tabc_features->set_tab_align(TabContainer::ALIGN_LEFT);
+ vbc->add_child(tabc_features);
+
+ // ---- Tab Substitute
+
+ VBoxContainer *vbc_substitute = memnew(VBoxContainer);
+ vbc_substitute->set_h_size_flags(SIZE_EXPAND_FILL);
+ vbc_substitute->set_custom_minimum_size(Size2(0, feature_min_height));
+
+ vbc_substitute->set_name(TTR("Substitute"));
+ tabc_features->add_child(vbc_substitute);
+
+ cbut_substitute = memnew(CheckButton);
+ cbut_substitute->set_text(TTR("Substitute"));
+ vbc_substitute->add_child(cbut_substitute);
+
+ GridContainer *grd_substitute = memnew(GridContainer);
+ grd_substitute->set_columns(3);
+ vbc_substitute->add_child(grd_substitute);
+
+ // Name
+
+ but_insert_name = memnew(Button);
+ but_insert_name->set_text("NAME");
+ but_insert_name->set_tooltip(String("${NAME}\n") + TTR("Node name"));
+ but_insert_name->set_focus_mode(FOCUS_NONE);
+ but_insert_name->connect("pressed", this, "_insert_text", make_binds("${NAME}"));
+ but_insert_name->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_name);
+
+ // Parent
+
+ but_insert_parent = memnew(Button);
+ but_insert_parent->set_text("PARENT");
+ but_insert_parent->set_tooltip(String("${PARENT}\n") + TTR("Node's parent name, if available"));
+ but_insert_parent->set_focus_mode(FOCUS_NONE);
+ but_insert_parent->connect("pressed", this, "_insert_text", make_binds("${PARENT}"));
+ but_insert_parent->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_parent);
+
+ // Type
+
+ but_insert_type = memnew(Button);
+ but_insert_type->set_text("TYPE");
+ but_insert_type->set_tooltip(String("${TYPE}\n") + TTR("Node type"));
+ but_insert_type->set_focus_mode(FOCUS_NONE);
+ but_insert_type->connect("pressed", this, "_insert_text", make_binds("${TYPE}"));
+ but_insert_type->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_type);
+
+ // Scene
+
+ but_insert_scene = memnew(Button);
+ but_insert_scene->set_text("SCENE");
+ but_insert_scene->set_tooltip(String("${SCENE}\n") + TTR("Current scene name"));
+ but_insert_scene->set_focus_mode(FOCUS_NONE);
+ but_insert_scene->connect("pressed", this, "_insert_text", make_binds("${SCENE}"));
+ but_insert_scene->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_scene);
+
+ // Root
+
+ but_insert_root = memnew(Button);
+ but_insert_root->set_text("ROOT");
+ but_insert_root->set_tooltip(String("${ROOT}\n") + TTR("Root node name"));
+ but_insert_root->set_focus_mode(FOCUS_NONE);
+ but_insert_root->connect("pressed", this, "_insert_text", make_binds("${ROOT}"));
+ but_insert_root->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_root);
+
+ // Count
+
+ but_insert_count = memnew(Button);
+ but_insert_count->set_text("COUNTER");
+ but_insert_count->set_tooltip(String("${COUNTER}\n") + TTR("Sequential integer counter.\nCompare counter options."));
+ but_insert_count->set_focus_mode(FOCUS_NONE);
+ but_insert_count->connect("pressed", this, "_insert_text", make_binds("${COUNTER}"));
+ but_insert_count->set_h_size_flags(SIZE_EXPAND_FILL);
+ grd_substitute->add_child(but_insert_count);
+
+ chk_per_level_counter = memnew(CheckBox);
+ chk_per_level_counter->set_text(TTR("Per Level counter"));
+ chk_per_level_counter->set_tooltip(TTR("If set the counter restarts for each group of child nodes"));
+ vbc_substitute->add_child(chk_per_level_counter);
+
+ HBoxContainer *hbc_count_options = memnew(HBoxContainer);
+ vbc_substitute->add_child(hbc_count_options);
+
+ Label *lbl_count_start = memnew(Label);
+ lbl_count_start->set_text(TTR("Start"));
+ lbl_count_start->set_tooltip(TTR("Initial value for the counter"));
+ hbc_count_options->add_child(lbl_count_start);
+
+ spn_count_start = memnew(SpinBox);
+ spn_count_start->set_tooltip(TTR("Initial value for the counter"));
+ spn_count_start->set_step(1);
+ spn_count_start->set_min(0);
+ hbc_count_options->add_child(spn_count_start);
+
+ Label *lbl_count_step = memnew(Label);
+ lbl_count_step->set_text(TTR("Step"));
+ lbl_count_step->set_tooltip(TTR("Ammount by which counter is incremented for each node"));
+ hbc_count_options->add_child(lbl_count_step);
+
+ spn_count_step = memnew(SpinBox);
+ spn_count_step->set_tooltip(TTR("Ammount by which counter is incremented for each node"));
+ spn_count_step->set_step(1);
+ hbc_count_options->add_child(spn_count_step);
+
+ Label *lbl_count_padding = memnew(Label);
+ lbl_count_padding->set_text(TTR("Padding"));
+ lbl_count_padding->set_tooltip(TTR("Minium number of digits for the counter.\nMissing digits are padded with leading zeros."));
+ hbc_count_options->add_child(lbl_count_padding);
+
+ spn_count_padding = memnew(SpinBox);
+ spn_count_padding->set_tooltip(TTR("Minium number of digits for the counter.\nMissing digits are padded with leading zeros."));
+ spn_count_padding->set_step(1);
+ hbc_count_options->add_child(spn_count_padding);
+
+ // ---- Tab RegEx
+
+ VBoxContainer *vbc_regex = memnew(VBoxContainer);
+ vbc_regex->set_h_size_flags(SIZE_EXPAND_FILL);
+ vbc_regex->set_name(TTR("Regular Expressions"));
+ vbc_regex->set_custom_minimum_size(Size2(0, feature_min_height));
+ tabc_features->add_child(vbc_regex);
+
+ cbut_regex = memnew(CheckButton);
+ cbut_regex->set_text(TTR("Regular Expressions"));
+ vbc_regex->add_child(cbut_regex);
+
+ // ---- Tab Process
+
+ VBoxContainer *vbc_process = memnew(VBoxContainer);
+ vbc_process->set_h_size_flags(SIZE_EXPAND_FILL);
+ vbc_process->set_name(TTR("Post-Process"));
+ vbc_process->set_custom_minimum_size(Size2(0, feature_min_height));
+ tabc_features->add_child(vbc_process);
+
+ cbut_process = memnew(CheckButton);
+ cbut_process->set_text(TTR("Post-Process"));
+ vbc_process->add_child(cbut_process);
+
+ // ------ Style
+
+ HBoxContainer *hbc_style = memnew(HBoxContainer);
+ vbc_process->add_child(hbc_style);
+
+ Label *lbl_style = memnew(Label);
+ lbl_style->set_text(TTR("Style"));
+ hbc_style->add_child(lbl_style);
+
+ opt_style = memnew(OptionButton);
+ opt_style->add_item(TTR("Keep"));
+ opt_style->add_item(TTR("CamelCase to under_scored"));
+ opt_style->add_item(TTR("under_scored to CamelCase"));
+ hbc_style->add_child(opt_style);
+
+ // ------ Case
+
+ HBoxContainer *hbc_case = memnew(HBoxContainer);
+ vbc_process->add_child(hbc_case);
+
+ Label *lbl_case = memnew(Label);
+ lbl_case->set_text(TTR("Case"));
+ hbc_case->add_child(lbl_case);
+
+ opt_case = memnew(OptionButton);
+ opt_case->add_item(TTR("Keep"));
+ opt_case->add_item(TTR("To Lowercase"));
+ opt_case->add_item(TTR("To Uppercase"));
+ hbc_case->add_child(opt_case);
+
+ // -- Preview
+
+ HSeparator *sep_preview = memnew(HSeparator);
+ sep_preview->set_custom_minimum_size(Size2(10, 20));
+ vbc->add_child(sep_preview);
+
+ lbl_preview_title = memnew(Label);
+ lbl_preview_title->set_text(TTR("Preview"));
+ vbc->add_child(lbl_preview_title);
+
+ lbl_preview = memnew(Label);
+ lbl_preview->set_text("");
+ lbl_preview->add_color_override("font_color", Color(1, 0.5f, 0, 1));
+ vbc->add_child(lbl_preview);
+
+ // ---- Dialog related
+
+ set_custom_minimum_size(Size2(383, 0));
+ set_as_toplevel(true);
+ get_ok()->set_text(TTR("Rename"));
+ Button *but_reset = add_button(TTR("Reset"));
+
+ eh.errfunc = _error_handler;
+ eh.userdata = this;
+
+ // ---- Connections
+
+ chk_collapse_features->connect("toggled", this, "_features_toggled");
+
+ // Substitite Buttons
+
+ lne_search->connect("focus_entered", this, "_update_substitute");
+ lne_search->connect("focus_exited", this, "_update_substitute");
+ lne_replace->connect("focus_entered", this, "_update_substitute");
+ lne_replace->connect("focus_exited", this, "_update_substitute");
+ lne_prefix->connect("focus_entered", this, "_update_substitute");
+ lne_prefix->connect("focus_exited", this, "_update_substitute");
+ lne_suffix->connect("focus_entered", this, "_update_substitute");
+ lne_suffix->connect("focus_exited", this, "_update_substitute");
+
+ // Preview
+
+ lne_prefix->connect("text_changed", this, "_update_preview");
+ lne_suffix->connect("text_changed", this, "_update_preview");
+ lne_search->connect("text_changed", this, "_update_preview");
+ lne_replace->connect("text_changed", this, "_update_preview");
+ spn_count_start->connect("value_changed", this, "_update_preview_int");
+ spn_count_step->connect("value_changed", this, "_update_preview_int");
+ spn_count_padding->connect("value_changed", this, "_update_preview_int");
+ opt_style->connect("item_selected", this, "_update_preview_int");
+ opt_case->connect("item_selected", this, "_update_preview_int");
+ cbut_substitute->connect("pressed", this, "_update_preview", varray(""));
+ cbut_regex->connect("pressed", this, "_update_preview", varray(""));
+ cbut_process->connect("pressed", this, "_update_preview", varray(""));
+
+ but_reset->connect("pressed", this, "reset");
+
+ reset();
+ _features_toggled(false);
+}
+
+void RenameDialog::_bind_methods() {
+
+ ClassDB::bind_method("_features_toggled", &RenameDialog::_features_toggled);
+ ClassDB::bind_method("_update_preview", &RenameDialog::_update_preview);
+ ClassDB::bind_method("_update_preview_int", &RenameDialog::_update_preview_int);
+ ClassDB::bind_method("_insert_text", &RenameDialog::_insert_text);
+ ClassDB::bind_method("_update_substitute", &RenameDialog::_update_substitute);
+ ClassDB::bind_method("reset", &RenameDialog::reset);
+ ClassDB::bind_method("rename", &RenameDialog::rename);
+}
+
+void RenameDialog::_update_substitute() {
+
+ LineEdit *focus_owner_line_edit = Object::cast_to<LineEdit>(get_focus_owner());
+ bool is_main_field = _is_main_field(focus_owner_line_edit);
+
+ but_insert_name->set_disabled(!is_main_field);
+ but_insert_parent->set_disabled(!is_main_field);
+ but_insert_type->set_disabled(!is_main_field);
+ but_insert_scene->set_disabled(!is_main_field);
+ but_insert_root->set_disabled(!is_main_field);
+ but_insert_count->set_disabled(!is_main_field);
+
+ // The focus mode seems to be reset when disabling/re-enabling
+ but_insert_name->set_focus_mode(FOCUS_NONE);
+ but_insert_parent->set_focus_mode(FOCUS_NONE);
+ but_insert_type->set_focus_mode(FOCUS_NONE);
+ but_insert_scene->set_focus_mode(FOCUS_NONE);
+ but_insert_root->set_focus_mode(FOCUS_NONE);
+ but_insert_count->set_focus_mode(FOCUS_NONE);
+}
+
+void RenameDialog::_post_popup() {
+
+ EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
+ preview_node = NULL;
+
+ Array selected_node_list = editor_selection->get_selected_nodes();
+ ERR_FAIL_COND(selected_node_list.size() == 0);
+
+ preview_node = selected_node_list[0];
+
+ _update_preview();
+ _update_substitute();
+}
+
+void RenameDialog::_update_preview_int(int new_value) {
+ _update_preview();
+}
+
+void RenameDialog::_update_preview(String new_text) {
+
+ if (lock_preview_update || preview_node == NULL)
+ return;
+
+ has_errors = false;
+ add_error_handler(&eh);
+
+ String new_name = _apply_rename(preview_node, spn_count_start->get_value());
+
+ if (!has_errors) {
+
+ lbl_preview_title->set_text(TTR("Preview"));
+ lbl_preview->set_text(new_name);
+
+ if (new_name == preview_node->get_name()) {
+ lbl_preview->add_color_override("font_color", Color(0, 0.5f, 0.25f, 1));
+ } else {
+ lbl_preview->add_color_override("font_color", Color(0, 1, 0.5f, 1));
+ }
+ }
+
+ remove_error_handler(&eh);
+}
+
+String RenameDialog::_apply_rename(const Node *node, int count) {
+
+ String search = lne_search->get_text();
+ String replace = lne_replace->get_text();
+ String prefix = lne_prefix->get_text();
+ String suffix = lne_suffix->get_text();
+ String new_name = node->get_name();
+
+ if (cbut_substitute->is_pressed()) {
+ search = _substitute(search, node, count);
+ replace = _substitute(replace, node, count);
+ prefix = _substitute(prefix, node, count);
+ suffix = _substitute(suffix, node, count);
+ }
+
+ if (cbut_regex->is_pressed()) {
+
+ new_name = _regex(search, new_name, replace);
+ } else {
+ new_name = new_name.replace(search, replace);
+ }
+
+ new_name = prefix + new_name + suffix;
+
+ if (cbut_process->is_pressed()) {
+ new_name = _postprocess(new_name);
+ }
+
+ return new_name;
+}
+
+String RenameDialog::_substitute(const String &subject, const Node *node, int count) {
+
+ String result = subject.replace("${COUNTER}", vformat("%0" + itos(spn_count_padding->get_value()) + "d", count));
+
+ if (node) {
+ result = result.replace("${NAME}", node->get_name());
+ result = result.replace("${TYPE}", node->get_class());
+ }
+
+ int current = EditorNode::get_singleton()->get_editor_data().get_edited_scene();
+ result = result.replace("${SCENE}", EditorNode::get_singleton()->get_editor_data().get_scene_title(current));
+
+ Node *root_node = SceneTree::get_singleton()->get_edited_scene_root();
+ if (root_node) {
+ result = result.replace("${ROOT}", root_node->get_name());
+ }
+
+ Node *parent_node = node->get_parent();
+ if (parent_node) {
+ if (node == root_node) {
+ // Can not substitute parent of root.
+ result = result.replace("${PARENT}", "");
+ } else {
+ result = result.replace("${PARENT}", parent_node->get_name());
+ }
+ }
+
+ return result;
+}
+
+void RenameDialog::_error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type) {
+
+ RenameDialog *self = (RenameDialog *)p_self;
+ String source_file(p_file);
+
+ // Only show first error that is related to "regex"
+ if (self->has_errors || source_file.find("regex") < 0)
+ return;
+
+ String err_str;
+ if (p_errorexp && p_errorexp[0]) {
+ err_str = p_errorexp;
+ } else {
+ err_str = p_error;
+ }
+
+ self->has_errors = true;
+ self->lbl_preview_title->set_text(TTR("Error"));
+ self->lbl_preview->add_color_override("font_color", Color(1, 0.25f, 0, 1));
+ self->lbl_preview->set_text(err_str);
+}
+
+String RenameDialog::_regex(const String &pattern, const String &subject, const String &replacement) {
+
+ RegEx regex(pattern);
+
+ return regex.sub(subject, replacement, true);
+}
+
+String RenameDialog::_postprocess(const String &subject) {
+
+ int style_id = opt_style->get_selected();
+
+ String result = subject;
+
+ if (style_id == 1) {
+
+ // CamelCase to Under_Line
+ result = result.camelcase_to_underscore(true);
+ result = _regex("_+", result, "_");
+
+ } else if (style_id == 2) {
+
+ // Under_Line to CamelCase
+ RegEx pattern("_+(.?)");
+ Array matches = pattern.search_all(result);
+
+ // _ name would become empty. Ignore
+ if (matches.size() && result != "_") {
+ String buffer;
+ int start = 0;
+ int end = 0;
+ for (int i = 0; i < matches.size(); ++i) {
+ start = ((Ref<RegExMatch>)matches[i])->get_start(1);
+ buffer += result.substr(end, start - end - 1);
+ buffer += result.substr(start, 1).to_upper();
+ end = start + 1;
+ }
+ buffer += result.substr(end, result.size() - (end + 1));
+ result = buffer.replace("_", "").capitalize();
+ }
+ }
+
+ int case_id = opt_case->get_selected();
+
+ if (case_id == 1) {
+ // To Lowercase
+ result = result.to_lower();
+ } else if (case_id == 2) {
+ // To Upercase
+ result = result.to_upper();
+ }
+
+ return result;
+}
+
+void RenameDialog::_iterate_scene(const Node *node, const Array &selection, int *counter) {
+
+ if (!node)
+ return;
+
+ if (selection.has(node)) {
+
+ String new_name = _apply_rename(node, *counter);
+
+ if (node->get_name() != new_name) {
+ Pair<NodePath, String> rename_item;
+ rename_item.first = node->get_path();
+ rename_item.second = new_name;
+ to_rename.push_back(rename_item);
+ }
+
+ *counter += spn_count_step->get_value();
+ }
+
+ int *cur_counter = counter;
+ int level_counter = spn_count_start->get_value();
+
+ if (chk_per_level_counter->is_pressed()) {
+ cur_counter = &level_counter;
+ }
+
+ for (int i = 0; i < node->get_child_count(); ++i) {
+ _iterate_scene(node->get_child(i), selection, cur_counter);
+ }
+}
+
+void RenameDialog::rename() {
+
+ // Editor selection is not ordered via scene tree. Instead iterate
+ // over scene tree until all selected nodes are found in order.
+
+ EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
+ Array selected_node_list = editor_selection->get_selected_nodes();
+ Node *root_node = SceneTree::get_singleton()->get_edited_scene_root();
+
+ global_count = spn_count_start->get_value();
+ to_rename.clear();
+
+ // Forward recursive as opposed to the actual renaming.
+ _iterate_scene(root_node, selected_node_list, &global_count);
+
+ if (undo_redo && !to_rename.empty()) {
+
+ undo_redo->create_action(TTR("Batch Rename"));
+
+ // Make sure to iterate reversed so that child nodes will find parents.
+ for (int i = to_rename.size() - 1; i >= 0; --i) {
+
+ Node *n = root_node->get_node(to_rename[i].first);
+ const String &new_name = to_rename[i].second;
+
+ if (!n) {
+ ERR_PRINTS("Skipping missing node: " + to_rename[i].first.get_concatenated_subnames());
+ continue;
+ }
+
+ scene_tree_editor->emit_signal("node_prerename", n, new_name);
+ undo_redo->add_do_method(scene_tree_editor, "_rename_node", n->get_instance_id(), new_name);
+ undo_redo->add_undo_method(scene_tree_editor, "_rename_node", n->get_instance_id(), n->get_name());
+ }
+
+ undo_redo->commit_action();
+ }
+}
+
+void RenameDialog::reset() {
+
+ lock_preview_update = true;
+
+ lne_prefix->clear();
+ lne_suffix->clear();
+ lne_search->clear();
+ lne_replace->clear();
+
+ cbut_substitute->set_pressed(false);
+ cbut_regex->set_pressed(false);
+ cbut_process->set_pressed(false);
+
+ chk_per_level_counter->set_pressed(true);
+
+ spn_count_start->set_value(1);
+ spn_count_step->set_value(1);
+ spn_count_padding->set_value(1);
+
+ opt_style->select(0);
+ opt_case->select(0);
+
+ lock_preview_update = false;
+ _update_preview();
+}
+
+bool RenameDialog::_is_main_field(LineEdit *line_edit) {
+ return line_edit &&
+ (line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix);
+}
+
+void RenameDialog::_insert_text(String text) {
+
+ LineEdit *focus_owner = Object::cast_to<LineEdit>(get_focus_owner());
+
+ if (_is_main_field(focus_owner)) {
+ focus_owner->selection_delete();
+ focus_owner->append_at_cursor(text);
+ _update_preview();
+ }
+}
+
+void RenameDialog::_features_toggled(bool pressed) {
+ if (pressed) {
+ tabc_features->show();
+ } else {
+ tabc_features->hide();
+ }
+
+ // Adjust to minimum size in y
+ Size2i size = get_size();
+ size.y = 0;
+ set_size(size);
+}
diff --git a/editor/rename_dialog.h b/editor/rename_dialog.h
new file mode 100644
index 0000000000..c5ebc30c0c
--- /dev/null
+++ b/editor/rename_dialog.h
@@ -0,0 +1,119 @@
+/*************************************************************************/
+/* rename_dialog.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef RENAME_DIALOG_H
+#define RENAME_DIALOG_H
+
+#include "scene/gui/check_box.h"
+#include "scene/gui/check_button.h"
+#include "scene/gui/dialogs.h"
+#include "scene/gui/option_button.h"
+#include "scene/gui/spin_box.h"
+
+#include "editor/scene_tree_editor.h"
+#include "undo_redo.h"
+
+/**
+@author Blazej Floch
+*/
+
+class RenameDialog : public ConfirmationDialog {
+
+ GDCLASS(RenameDialog, ConfirmationDialog);
+
+ virtual void ok_pressed() { rename(); };
+ void _cancel_pressed(){};
+ void _features_toggled(bool pressed);
+ void _insert_text(String text);
+ void _update_substitute();
+ bool _is_main_field(LineEdit *line_edit);
+
+ void _iterate_scene(const Node *node, const Array &selection, int *count);
+ String _apply_rename(const Node *node, int count);
+ String _substitute(const String &subject, const Node *node, int count);
+ String _regex(const String &pattern, const String &subject, const String &replacement);
+ String _postprocess(const String &subject);
+ void _update_preview(String new_text = "");
+ void _update_preview_int(int new_value = 0);
+ static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type);
+
+ SceneTreeEditor *scene_tree_editor;
+ UndoRedo *undo_redo;
+ int global_count;
+
+ LineEdit *lne_search;
+ LineEdit *lne_replace;
+ LineEdit *lne_prefix;
+ LineEdit *lne_suffix;
+
+ TabContainer *tabc_features;
+
+ CheckButton *cbut_substitute;
+ CheckButton *cbut_regex;
+ CheckButton *cbut_process;
+ CheckBox *chk_per_level_counter;
+
+ Button *but_insert_name;
+ Button *but_insert_parent;
+ Button *but_insert_type;
+ Button *but_insert_scene;
+ Button *but_insert_root;
+ Button *but_insert_count;
+
+ SpinBox *spn_count_start;
+ SpinBox *spn_count_step;
+ SpinBox *spn_count_padding;
+
+ OptionButton *opt_style;
+ OptionButton *opt_case;
+
+ Label *lbl_preview_title;
+ Label *lbl_preview;
+
+ List<Pair<NodePath, String> > to_rename;
+ Node *preview_node;
+ bool lock_preview_update;
+ ErrorHandlerList eh;
+ bool has_errors;
+
+protected:
+ void _notification(int p_what){};
+ static void _bind_methods();
+ virtual void _post_popup();
+
+public:
+ void reset();
+ void rename();
+
+ RenameDialog(SceneTreeEditor *p_scene_tree_editor, UndoRedo *p_undo_redo = NULL);
+ ~RenameDialog(){};
+};
+
+#endif
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 38027a34a7..8b99a3d503 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -73,7 +73,9 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
if (!p_event->is_pressed() || p_event->is_echo())
return;
- if (ED_IS_SHORTCUT("scene_tree/add_child_node", p_event)) {
+ if (ED_IS_SHORTCUT("scene_tree/batch_rename", p_event)) {
+ _tool_selected(TOOL_BATCH_RENAME);
+ } else if (ED_IS_SHORTCUT("scene_tree/add_child_node", p_event)) {
_tool_selected(TOOL_NEW);
} else if (ED_IS_SHORTCUT("scene_tree/instance_scene", p_event)) {
_tool_selected(TOOL_INSTANCE);
@@ -107,7 +109,12 @@ void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
void SceneTreeDock::instance(const String &p_file) {
Node *parent = scene_tree->get_selected();
- if (!parent || !edited_scene) {
+
+ if (!parent) {
+ Node *parent = edited_scene;
+ };
+
+ if (!edited_scene) {
current_option = -1;
accept->get_ok()->set_text(TTR("OK :("));
@@ -280,6 +287,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
switch (p_tool) {
+ case TOOL_BATCH_RENAME: {
+ Tree *tree = scene_tree->get_scene_tree();
+ if (tree->is_anything_selected()) {
+ rename_dialog->popup_centered();
+ }
+ } break;
case TOOL_NEW: {
String preferred = "";
@@ -1857,6 +1870,7 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) {
menu->clear();
+ menu->add_icon_shortcut(get_icon("Rename", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/batch_rename"), TOOL_BATCH_RENAME);
if (selection.size() == 1) {
subresources.clear();
@@ -2050,6 +2064,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
filter_hbc->add_constant_override("separate", 0);
ToolButton *tb;
+ ED_SHORTCUT("scene_tree/batch_rename", TTR("Batch Rename"), KEY_MASK_CMD | KEY_F2);
ED_SHORTCUT("scene_tree/add_child_node", TTR("Add Child Node"), KEY_MASK_CMD | KEY_A);
ED_SHORTCUT("scene_tree/instance_scene", TTR("Instance Child Scene"));
ED_SHORTCUT("scene_tree/change_node_type", TTR("Change Type"));
@@ -2148,6 +2163,9 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
add_child(create_dialog);
create_dialog->connect("create", this, "_create");
+ rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo()));
+ add_child(rename_dialog);
+
script_create_dialog = memnew(ScriptCreateDialog);
add_child(script_create_dialog);
script_create_dialog->connect("script_created", this, "_script_created");
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index a4f36e31ee..fd7d616a80 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -36,6 +36,7 @@
#include "editor/editor_data.h"
#include "editor/editor_sub_scene.h"
#include "editor/groups_editor.h"
+#include "editor/rename_dialog.h"
#include "editor/reparent_dialog.h"
#include "editor/script_create_dialog.h"
#include "scene/animation/animation_player.h"
@@ -58,6 +59,7 @@ class SceneTreeDock : public VBoxContainer {
TOOL_NEW,
TOOL_INSTANCE,
+ TOOL_BATCH_RENAME,
TOOL_REPLACE,
TOOL_ATTACH_SCRIPT,
TOOL_CLEAR_SCRIPT,
@@ -90,6 +92,7 @@ class SceneTreeDock : public VBoxContainer {
int current_option;
CreateDialog *create_dialog;
+ RenameDialog *rename_dialog;
ToolButton *button_add;
ToolButton *button_instance;
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 50519e2c6e..a83de1627d 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -46,6 +46,7 @@
#include "scene/gui/tab_container.h"
#include "scene/gui/texture_button.h"
#include "scene/gui/tree.h"
+#include "scene/resources/packed_scene.h"
#include "ustring.h"
class ScriptEditorDebuggerVariables : public Object {
@@ -286,6 +287,30 @@ void ScriptEditorDebugger::_scene_tree_selected() {
ppeer->put_var(msg);
}
+void ScriptEditorDebugger::_scene_tree_rmb_selected(const Vector2 &p_position) {
+
+ TreeItem *item = inspect_scene_tree->get_item_at_position(p_position);
+ if (!item)
+ return;
+
+ item->select(0);
+
+ item_menu->clear();
+ item_menu->add_icon_item(get_icon("CreateNewSceneFrom", "EditorIcons"), TTR("Save Branch as Scene"), ITEM_MENU_SAVE_REMOTE_NODE);
+ item_menu->set_global_position(get_global_mouse_position());
+ item_menu->popup();
+}
+
+void ScriptEditorDebugger::_file_selected(const String &p_file) {
+ if (file_dialog->get_mode() == EditorFileDialog::MODE_SAVE_FILE) {
+ Array msg;
+ msg.push_back("save_node");
+ msg.push_back(inspected_object_id);
+ msg.push_back(p_file);
+ ppeer->put_var(msg);
+ }
+}
+
void ScriptEditorDebugger::_scene_tree_property_value_edited(const String &p_prop, const Variant &p_value) {
Array msg;
@@ -1754,6 +1779,21 @@ void ScriptEditorDebugger::_item_menu_id_pressed(int p_option) {
OS::get_singleton()->set_clipboard(title + "\n----------\n" + desc);
} break;
+ case ITEM_MENU_SAVE_REMOTE_NODE: {
+
+ file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES);
+ file_dialog->set_mode(EditorFileDialog::MODE_SAVE_FILE);
+
+ List<String> extensions;
+ Ref<PackedScene> sd = memnew(PackedScene);
+ ResourceSaver::get_recognized_extensions(sd, &extensions);
+ file_dialog->clear_filters();
+ for (int i = 0; i < extensions.size(); i++) {
+ file_dialog->add_filter("*." + extensions[i] + " ; " + extensions[i].to_upper());
+ }
+
+ file_dialog->popup_centered_ratio();
+ } break;
}
}
@@ -1788,6 +1828,8 @@ void ScriptEditorDebugger::_bind_methods() {
ClassDB::bind_method(D_METHOD("_scene_tree_selected"), &ScriptEditorDebugger::_scene_tree_selected);
ClassDB::bind_method(D_METHOD("_scene_tree_folded"), &ScriptEditorDebugger::_scene_tree_folded);
+ ClassDB::bind_method(D_METHOD("_scene_tree_rmb_selected"), &ScriptEditorDebugger::_scene_tree_rmb_selected);
+ ClassDB::bind_method(D_METHOD("_file_selected"), &ScriptEditorDebugger::_file_selected);
ClassDB::bind_method(D_METHOD("live_debug_create_node"), &ScriptEditorDebugger::live_debug_create_node);
ClassDB::bind_method(D_METHOD("live_debug_instance_node"), &ScriptEditorDebugger::live_debug_instance_node);
@@ -1960,7 +2002,8 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
inspect_scene_tree->set_v_size_flags(SIZE_EXPAND_FILL);
inspect_scene_tree->connect("cell_selected", this, "_scene_tree_selected");
inspect_scene_tree->connect("item_collapsed", this, "_scene_tree_folded");
-
+ inspect_scene_tree->set_allow_rmb_select(true);
+ inspect_scene_tree->connect("item_rmb_selected", this, "_scene_tree_rmb_selected");
auto_switch_remote_scene_tree = EDITOR_DEF("debugger/auto_switch_to_remote_scene_tree", false);
inspect_scene_tree_timeout = EDITOR_DEF("debugger/remote_scene_tree_refresh_interval", 1.0);
inspect_edited_object_timeout = EDITOR_DEF("debugger/remote_inspect_refresh_interval", 0.2);
@@ -1968,6 +2011,12 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
updating_scene_tree = false;
}
+ { // File dialog
+ file_dialog = memnew(EditorFileDialog);
+ file_dialog->connect("file_selected", this, "_file_selected");
+ add_child(file_dialog);
+ }
+
{ //profiler
profiler = memnew(EditorProfiler);
profiler->set_name(TTR("Profiler"));
diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h
index 669d8737fe..f7fe348b65 100644
--- a/editor/script_editor_debugger.h
+++ b/editor/script_editor_debugger.h
@@ -65,6 +65,7 @@ class ScriptEditorDebugger : public Control {
enum ItemMenu {
ITEM_MENU_COPY_ERROR,
+ ITEM_MENU_SAVE_REMOTE_NODE,
};
AcceptDialog *msgdialog;
@@ -92,6 +93,7 @@ class ScriptEditorDebugger : public Control {
Tree *inspect_scene_tree;
Button *clearbutton;
PopupMenu *item_menu;
+ EditorFileDialog *file_dialog;
int error_count;
int last_error_count;
@@ -155,6 +157,8 @@ class ScriptEditorDebugger : public Control {
void _scene_tree_folded(Object *obj);
void _scene_tree_selected();
+ void _scene_tree_rmb_selected(const Vector2 &p_position);
+ void _file_selected(const String &p_file);
void _scene_tree_request();
void _parse_message(const String &p_msg, const Array &p_data);
void _set_reason_text(const String &p_reason, MessageType p_type);
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index f50f9f6f5f..c3e9e4ab62 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -101,7 +101,14 @@ void EditorSettingsDialog::popup_edit_settings() {
if (EditorSettings::get_singleton()->has_setting("interface/dialogs/editor_settings_bounds")) {
popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds"));
} else {
- popup_centered_ratio(0.7);
+
+ Size2 popup_size = Size2(900, 700) * editor_get_scale();
+ Size2 window_size = get_viewport_rect().size;
+
+ popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
+ popup_size.y = MIN(window_size.y * 0.8, popup_size.y);
+
+ popup_centered(popup_size);
}
_focus_current_search_box();
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index a3c4b73ae4..2652b09763 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -299,13 +299,24 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
}
}
-void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size) {
+void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position) {
ERR_FAIL_COND(!spatial_node);
CubeMesh cubem;
cubem.set_size(p_size);
+
+ Array arrays = cubem.surface_get_arrays(0);
+ PoolVector3Array vertex = arrays[VS::ARRAY_VERTEX];
+ PoolVector3Array::Write w = vertex.write();
+
+ for (int i = 0; i < vertex.size(); ++i) {
+ w[i] += p_position;
+ }
+
+ arrays[VS::ARRAY_VERTEX] = vertex;
+
Ref<ArrayMesh> m = memnew(ArrayMesh);
- m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), cubem.surface_get_arrays(0));
+ m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), arrays);
m->surface_set_material(0, p_material);
add_mesh(m);
}
@@ -1523,6 +1534,120 @@ SkeletonSpatialGizmo::SkeletonSpatialGizmo(Skeleton *p_skel) {
set_spatial_node(p_skel);
}
+PhysicalBoneSpatialGizmo::PhysicalBoneSpatialGizmo(PhysicalBone *p_pb) :
+ EditorSpatialGizmo(),
+ physical_bone(p_pb) {
+ set_spatial_node(p_pb);
+}
+
+void PhysicalBoneSpatialGizmo::redraw() {
+
+ clear();
+
+ if (!physical_bone)
+ return;
+
+ Skeleton *sk(physical_bone->find_skeleton_parent());
+ PhysicalBone *pb(sk->get_physical_bone(physical_bone->get_bone_id()));
+ PhysicalBone *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id()));
+
+ Vector<Vector3> points;
+
+ switch (physical_bone->get_joint_type()) {
+ case PhysicalBone::JOINT_TYPE_PIN: {
+
+ PinJointSpatialGizmo::CreateGizmo(physical_bone->get_joint_offset(), points);
+ } break;
+ case PhysicalBone::JOINT_TYPE_CONE: {
+
+ const PhysicalBone::ConeJointData *cjd(static_cast<const PhysicalBone::ConeJointData *>(physical_bone->get_joint_data()));
+ ConeTwistJointSpatialGizmo::CreateGizmo(
+ physical_bone->get_joint_offset(),
+ physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
+ pb ? pb->get_global_transform() : Transform(),
+ pbp ? pbp->get_global_transform() : Transform(),
+ cjd->swing_span,
+ cjd->twist_span,
+ points,
+ pb ? &points : NULL,
+ pbp ? &points : NULL);
+ } break;
+ case PhysicalBone::JOINT_TYPE_HINGE: {
+
+ const PhysicalBone::HingeJointData *hjd(static_cast<const PhysicalBone::HingeJointData *>(physical_bone->get_joint_data()));
+ HingeJointSpatialGizmo::CreateGizmo(
+ physical_bone->get_joint_offset(),
+ physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
+ pb ? pb->get_global_transform() : Transform(),
+ pbp ? pbp->get_global_transform() : Transform(),
+ hjd->angular_limit_lower,
+ hjd->angular_limit_upper,
+ hjd->angular_limit_enabled,
+ points,
+ pb ? &points : NULL,
+ pbp ? &points : NULL);
+ } break;
+ case PhysicalBone::JOINT_TYPE_SLIDER: {
+
+ const PhysicalBone::SliderJointData *sjd(static_cast<const PhysicalBone::SliderJointData *>(physical_bone->get_joint_data()));
+ SliderJointSpatialGizmo::CreateGizmo(
+ physical_bone->get_joint_offset(),
+ physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
+ pb ? pb->get_global_transform() : Transform(),
+ pbp ? pbp->get_global_transform() : Transform(),
+ sjd->angular_limit_lower,
+ sjd->angular_limit_upper,
+ sjd->linear_limit_lower,
+ sjd->linear_limit_upper,
+ points,
+ pb ? &points : NULL,
+ pbp ? &points : NULL);
+ } break;
+ case PhysicalBone::JOINT_TYPE_6DOF: {
+
+ const PhysicalBone::SixDOFJointData *sdofjd(static_cast<const PhysicalBone::SixDOFJointData *>(physical_bone->get_joint_data()));
+ Generic6DOFJointSpatialGizmo::CreateGizmo(
+ physical_bone->get_joint_offset(),
+
+ physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
+ pb ? pb->get_global_transform() : Transform(),
+ pbp ? pbp->get_global_transform() : Transform(),
+
+ sdofjd->axis_data[0].angular_limit_lower,
+ sdofjd->axis_data[0].angular_limit_upper,
+ sdofjd->axis_data[0].linear_limit_lower,
+ sdofjd->axis_data[0].linear_limit_upper,
+ sdofjd->axis_data[0].angular_limit_enabled,
+ sdofjd->axis_data[0].linear_limit_enabled,
+
+ sdofjd->axis_data[1].angular_limit_lower,
+ sdofjd->axis_data[1].angular_limit_upper,
+ sdofjd->axis_data[1].linear_limit_lower,
+ sdofjd->axis_data[1].linear_limit_upper,
+ sdofjd->axis_data[1].angular_limit_enabled,
+ sdofjd->axis_data[1].linear_limit_enabled,
+
+ sdofjd->axis_data[2].angular_limit_lower,
+ sdofjd->axis_data[2].angular_limit_upper,
+ sdofjd->axis_data[2].linear_limit_lower,
+ sdofjd->axis_data[2].linear_limit_upper,
+ sdofjd->axis_data[2].angular_limit_enabled,
+ sdofjd->axis_data[2].linear_limit_enabled,
+
+ points,
+ pb ? &points : NULL,
+ pbp ? &points : NULL);
+ } break;
+ default:
+ return;
+ }
+
+ Ref<Material> material = create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint"));
+
+ add_collision_segments(points);
+ add_lines(points, material);
+}
+
// FIXME: Kept as reference for reimplementation in 3.1+
#if 0
void RoomSpatialGizmo::redraw() {
@@ -2411,7 +2536,7 @@ void ParticlesGizmo::redraw() {
gizmo_color.a = 0.1;
Ref<Material> solid_material = create_material("particles_solid_material", gizmo_color);
- add_solid_box(solid_material, aabb.get_size());
+ add_solid_box(solid_material, aabb.get_size(), aabb.get_position() + aabb.get_size() / 2.0);
}
//add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05);
@@ -3724,6 +3849,12 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) {
return lsg;
}
+ if (Object::cast_to<PhysicalBone>(p_spatial)) {
+
+ Ref<PhysicalBoneSpatialGizmo> pbsg = memnew(PhysicalBoneSpatialGizmo(Object::cast_to<PhysicalBone>(p_spatial)));
+ return pbsg;
+ }
+
if (Object::cast_to<Position3D>(p_spatial)) {
Ref<Position3DSpatialGizmo> lsg = memnew(Position3DSpatialGizmo(Object::cast_to<Position3D>(p_spatial)));
diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h
index eedab7fdef..c5dc36cb22 100644
--- a/editor/spatial_editor_gizmos.h
+++ b/editor/spatial_editor_gizmos.h
@@ -105,7 +105,7 @@ protected:
void add_collision_triangles(const Ref<TriangleMesh> &p_tmesh, const AABB &p_bounds = AABB());
void add_unscaled_billboard(const Ref<Material> &p_material, float p_scale = 1);
void add_handles(const Vector<Vector3> &p_handles, bool p_billboard = false, bool p_secondary = false);
- void add_solid_box(Ref<Material> &p_material, Vector3 p_size);
+ void add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position = Vector3());
void set_spatial_node(Spatial *p_node);
const Spatial *get_spatial_node() const { return spatial_node; }
@@ -214,6 +214,17 @@ public:
SkeletonSpatialGizmo(Skeleton *p_skel = NULL);
};
+class PhysicalBoneSpatialGizmo : public EditorSpatialGizmo {
+ GDCLASS(PhysicalBoneSpatialGizmo, EditorSpatialGizmo);
+
+ PhysicalBone *physical_bone;
+
+public:
+ //virtual Transform get_global_gizmo_transform();
+ virtual void redraw();
+ PhysicalBoneSpatialGizmo(PhysicalBone *p_pb = NULL);
+};
+
#if 0
class PortalSpatialGizmo : public EditorSpatialGizmo {
diff --git a/editor/translations/af.po b/editor/translations/af.po
index 0f5a2b890f..8644e20317 100644
--- a/editor/translations/af.po
+++ b/editor/translations/af.po
@@ -1407,6 +1407,10 @@ msgstr "Vee uit"
msgid "Clear Output"
msgstr "Afvoer:"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Fout tydens storing van hulpbron!"
@@ -3636,6 +3640,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3921,6 +3933,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5583,6 +5599,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6062,7 +6086,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6206,10 +6232,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7250,6 +7272,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7891,10 +7917,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/ar.po b/editor/translations/ar.po
index 7e9f894292..a57dc0f0cc 100644
--- a/editor/translations/ar.po
+++ b/editor/translations/ar.po
@@ -1401,6 +1401,10 @@ msgstr "خالي"
msgid "Clear Output"
msgstr "أخلاء الخرج"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "خطأ ÙÙŠ Ø­Ùظ المورد!"
@@ -3687,6 +3691,16 @@ msgid "Show Guides"
msgstr "أظهر الموجهات"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "إظهار الشبكة"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "أظهر المساعدات"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "نص٠المÙحدد"
@@ -3976,6 +3990,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "الميش ليس لديه سطح لكي ينشئ حدود منه!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "لا يمكن إنشاء الحد!"
@@ -5637,6 +5655,15 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "إضاÙØ© عنصر"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6112,7 +6139,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6256,10 +6285,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "لا يمكن أن يحتوي علي '/' أو ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7305,6 +7330,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "إنشاء الحل..."
@@ -7945,10 +7974,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8029,6 +8068,9 @@ msgstr ""
msgid "Invalid font size."
msgstr ""
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "لا يمكن أن يحتوي علي '/' أو ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/bg.po b/editor/translations/bg.po
index 24b9345051..741f6ab209 100644
--- a/editor/translations/bg.po
+++ b/editor/translations/bg.po
@@ -1375,6 +1375,10 @@ msgstr "ИзчиÑтване"
msgid "Clear Output"
msgstr "Ðова Ñцена"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3630,6 +3634,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3916,6 +3928,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5590,6 +5606,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6079,7 +6103,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6223,10 +6249,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7305,6 +7327,10 @@ msgstr "ÐаÑтройки"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7979,10 +8005,20 @@ msgstr ""
"работи."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/bn.po b/editor/translations/bn.po
index ff5533e22e..b8cd30b562 100644
--- a/editor/translations/bn.po
+++ b/editor/translations/bn.po
@@ -1428,6 +1428,10 @@ msgstr "পরিসà§à¦•à¦¾à¦° করà§à¦¨/কà§à¦²à§€à§Ÿà¦¾à¦°"
msgid "Clear Output"
msgstr "আউটপà§à¦Ÿ/ফলাফল"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "রিসোরà§à¦¸ সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে!"
@@ -3841,6 +3845,16 @@ msgid "Show Guides"
msgstr "বোনà§â€Œ/হাড় দেখান"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "অরিজিন দেখà§à¦¨"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "১ টি Viewport"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "নিরà§à¦¬à¦¾à¦šà¦¨à¦•à§‡ কেনà§à¦¦à§à¦°à§€à¦­à§‚ত করà§à¦¨"
@@ -4143,6 +4157,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "পà§à¦°à¦¾à¦¨à§à¦¤à¦°à§‡à¦–া তৈরি করার জনà§à¦¯ পà§à¦°à§Ÿà§‹à¦œà¦¨à§€à§Ÿ Mesh à¦à¦° কোনো পৃষà§à¦ à¦¤à¦² নেই!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "পà§à¦°à¦¾à¦¨à§à¦¤à¦°à§‡à¦–া তৈরি করা সমà§à¦­à¦¬ হয়নি!"
@@ -5885,6 +5903,16 @@ msgid "Checked Item"
msgstr "চিহà§à¦¨à¦¿à¦¤ আইটেম"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "বসà§à¦¤à§ যোগ করà§à¦¨"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "চিহà§à¦¨à¦¿à¦¤ আইটেম"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "আছে"
@@ -6415,8 +6443,10 @@ msgid "Mouse Button"
msgstr "মাউসের বোতাম"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "অকারà§à¦¯à¦•à¦° অà§à¦¯à¦¾à¦•à¦¶à¦¨ ('/' বা ':' ছাড়া কিছà§à¦‡ যাবে না)।"
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6567,11 +6597,6 @@ msgstr "ইনপà§à¦Ÿ অপসারণ করà§à¦¨"
#: editor/project_settings_editor.cpp
#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "নোডের সাথে সংযà§à¦•à§à¦¤ করà§à¦¨:"
-
-#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Already existing"
msgstr "সà§à¦¥à¦¾à§Ÿà§€à§Ÿà¦¤à¦¾ টগল করà§à¦¨"
@@ -7685,6 +7710,10 @@ msgstr "সà§à¦¨à§à¦¯à¦¾à¦ª সেটিংস"
msgid "Pick Distance:"
msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -8408,12 +8437,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Path à¦à¦° দিক অবশà§à¦¯à¦‡ à¦à¦•à¦Ÿà¦¿ কারà§à¦¯à¦•à¦° Spatial নোডের à¦à¦° দিকে নিরà§à¦¦à§‡à¦¶ করাতে হবে।"
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"পà§à¦°à¦¤à¦¿ দৃশà§à¦¯à§‡ (অথবা ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸à¦¡ দৃশà§à¦¯à§‡à¦° সমà§à¦®à§‡à¦²à¦¨à§‡) সরà§à¦¬à§‹à¦šà§à¦š à¦à¦•à¦Ÿà¦¿ দৃশà§à¦¯à¦®à¦¾à¦¨ WorldEnvironment "
"সমà§à¦­à¦¬à¥¤"
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8505,6 +8544,13 @@ msgstr "ফনà§à¦Ÿ তà§à¦²à¦¤à§‡/লোডে সমসà§à¦¯à¦¾ হয়েà¦
msgid "Invalid font size."
msgstr "ফনà§à¦Ÿà§‡à¦° আকার অগà§à¦°à¦¹à¦¨à¦¯à§‹à¦—à§à¦¯à¥¤"
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "অকারà§à¦¯à¦•à¦° অà§à¦¯à¦¾à¦•à¦¶à¦¨ ('/' বা ':' ছাড়া কিছà§à¦‡ যাবে না)।"
+
+#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "নোডের সাথে সংযà§à¦•à§à¦¤ করà§à¦¨:"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/ca.po b/editor/translations/ca.po
index 5af9d98ec6..a1f92b5316 100644
--- a/editor/translations/ca.po
+++ b/editor/translations/ca.po
@@ -9,7 +9,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-27 02:34+0000\n"
+"PO-Revision-Date: 2018-03-10 03:34+0000\n"
"Last-Translator: Roger Blanco Ribera <roger.blancoribera@gmail.com>\n"
"Language-Team: Catalan <https://hosted.weblate.org/projects/godot-engine/"
"godot/ca/>\n"
@@ -1398,6 +1398,10 @@ msgstr "Neteja"
msgid "Clear Output"
msgstr "Buida la Sortida"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Error en desar recurs!"
@@ -3702,6 +3706,16 @@ msgid "Show Guides"
msgstr "Mostra les guies"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Mostra l'Origen"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Vista"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centra la Selecció"
@@ -3991,6 +4005,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "La Malla manca d'una superfície on delinear-hi els contorns!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "No es pot crear el contorn!"
@@ -5659,6 +5677,16 @@ msgid "Checked Item"
msgstr "Element validat"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Afegeix un Element"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Element validat"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Té"
@@ -6137,7 +6165,7 @@ msgid ""
"Would you like to explore the official example projects in the Asset Library?"
msgstr ""
"Encara no teniu cap projecte.\n"
-"Voleu explorar els projectes oficials d'exemple a la llibreria activa?"
+"Voleu explorar els projectes d'exemple oficials a la Biblioteca d'Actius?"
#: editor/project_settings_editor.cpp
msgid "Key "
@@ -6156,8 +6184,10 @@ msgid "Mouse Button"
msgstr "Botó del ratolí"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "L'Acció no és vàlida (no es pot utilitzar ' / ' o ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6300,10 +6330,6 @@ msgid "Delete Item"
msgstr "Esborra l'Element"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "No pot contenir '/' o ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Ja existeix"
@@ -7362,6 +7388,10 @@ msgstr "Configuració del GridMap"
msgid "Pick Distance:"
msgstr "Trieu la distància:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "S'està generant la solució..."
@@ -7412,7 +7442,7 @@ msgstr "Avisos"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Final de la traça de la pila d'excepció interna"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -8070,12 +8100,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Cal que la propietat Camí assenyali cap a un node Spatial vàlid."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Només es permet un sol WorldEnvironment per escena ( o conjunt d'escenes "
"instanciades)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8173,6 +8213,12 @@ msgstr "Error carregant lletra."
msgid "Invalid font size."
msgstr "La mida de la lletra no és vàlida."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "L'Acció no és vàlida (no es pot utilitzar ' / ' o ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "No pot contenir '/' o ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/cs.po b/editor/translations/cs.po
index aa29f16038..ce26418cbf 100644
--- a/editor/translations/cs.po
+++ b/editor/translations/cs.po
@@ -1401,6 +1401,10 @@ msgstr "VyÄistit"
msgid "Clear Output"
msgstr "Vymazat výstup"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3672,6 +3676,16 @@ msgstr "Zobrazit vodítka"
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
+msgid "Show Origin"
+msgstr "Zobrazit mřížku"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "Zobrazit pomocné"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
msgid "Center Selection"
msgstr "Vycentrovat výběr"
@@ -3962,6 +3976,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Mesh némá povrch z jakého vytvořit obrysy!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Nelze vytvořit obrys!"
@@ -5643,6 +5661,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6125,7 +6151,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6270,10 +6298,6 @@ msgid "Delete Item"
msgstr "Odstranit položku"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Nesmí obsaovat '/' nebo ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7333,6 +7357,10 @@ msgstr "Nastavení GridMap"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8032,12 +8060,22 @@ msgstr ""
"uzel Particles2D."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Na každou scénu (nebo skupinu instancovaných scén) je povolen pouze jeden "
"WorldEnvironment."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8130,6 +8168,9 @@ msgstr "Chyba nahrávání fontu."
msgid "Invalid font size."
msgstr "Neplatná velikost fontu."
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Nesmí obsaovat '/' nebo ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/da.po b/editor/translations/da.po
index ca47dc00e1..349706f6e0 100644
--- a/editor/translations/da.po
+++ b/editor/translations/da.po
@@ -3,22 +3,24 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
+# Dankse Memes <purplelops@gmail.com>, 2018.
# David Lamhauge <davidlamhauge@gmail.com>, 2016.
+# Esben Damkjær Sørensen <esben@damkjaergaard.com>, 2018.
# Kim Nielsen <kimmowich@stofanet.dk>, 2017.
# Michael Madsen <mim@michael-madsen.dk>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-12-20 15:42+0000\n"
-"Last-Translator: Kim Nielsen <kimmowich@stofanet.dk>\n"
+"PO-Revision-Date: 2018-04-22 07:35+0000\n"
+"Last-Translator: Dankse Memes <purplelops@gmail.com>\n"
"Language-Team: Danish <https://hosted.weblate.org/projects/godot-engine/"
"godot/da/>\n"
"Language: da\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -29,9 +31,8 @@ msgid "All Selection"
msgstr "All selection"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Keyframe Time"
-msgstr "Anim Skift Værdi"
+msgstr "Anim Skift Keyframetid"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
@@ -42,9 +43,8 @@ msgid "Anim Change Transform"
msgstr "Anim Skift Transformering"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Keyframe Value"
-msgstr "Anim Skift Værdi"
+msgstr "Anim Skift Keyframeværdi"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
@@ -497,9 +497,8 @@ msgid "Connecting Signal:"
msgstr "Forbindelses Signal:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Disconnect '%s' from '%s'"
-msgstr "Forbind '%s' til '%s'"
+msgstr "Afbryd '%s' fra '%s'"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -515,9 +514,8 @@ msgid "Signals"
msgstr "Signaler"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Change %s Type"
-msgstr "Skift Base Type"
+msgstr "Skift %s Type"
#: editor/create_dialog.cpp editor/project_settings_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -525,9 +523,8 @@ msgid "Change"
msgstr "Skift"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Create New %s"
-msgstr "Opret Nyt"
+msgstr "Opret Ny %s"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
@@ -639,7 +636,7 @@ msgstr ""
#: editor/dependency_editor.cpp
#, fuzzy
msgid "Cannot remove:"
-msgstr "Kan ikke fjerne:\n"
+msgstr "Kan ikke fjerne:"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -722,9 +719,8 @@ msgid "Lead Developer"
msgstr "Ledende Udvikler"
#: editor/editor_about.cpp
-#, fuzzy
msgid "Project Manager "
-msgstr "Projektleder"
+msgstr "Projektleder "
#: editor/editor_about.cpp
msgid "Developers"
@@ -817,9 +813,8 @@ msgid "Install"
msgstr "Installér"
#: editor/editor_asset_installer.cpp
-#, fuzzy
msgid "Package Installer"
-msgstr "Pakke Installatør"
+msgstr "Pakkeinstallatør"
#: editor/editor_audio_buses.cpp
msgid "Speakers"
@@ -901,7 +896,7 @@ msgstr "Slet Effect"
#: editor/editor_audio_buses.cpp
msgid "Audio"
-msgstr ""
+msgstr "Lyd"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
@@ -1083,11 +1078,11 @@ msgstr "Opdatere scene.."
#: editor/editor_data.cpp
msgid "[empty]"
-msgstr ""
+msgstr "[tom]"
#: editor/editor_data.cpp
msgid "[unsaved]"
-msgstr ""
+msgstr "[ikke gemt]"
#: editor/editor_dir_dialog.cpp
msgid "Please select a base directory first"
@@ -1127,18 +1122,16 @@ msgid "Packing"
msgstr "Pakker"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
-#, fuzzy
msgid "Template file not found:"
-msgstr "Skabelon fil ikke fundet:\n"
+msgstr "Skabelonfil ikke fundet:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "File Exists, Overwrite?"
msgstr "Filen Eksisterer, Overskrives?"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Select Current Folder"
-msgstr "Opret mappe"
+msgstr "Vælg nurværende mappe"
#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
msgid "Copy Path"
@@ -1244,9 +1237,8 @@ msgid "File:"
msgstr "Fil:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Must use a valid extension."
-msgstr "Skal bruge en gyldig extension."
+msgstr "Du skal bruge en gyldig udvidelse."
#: editor/editor_file_system.cpp
msgid "ScanSources"
@@ -1345,7 +1337,7 @@ msgstr "Beskrivelse"
#: editor/editor_help.cpp
#, fuzzy
msgid "Online Tutorials:"
-msgstr "Online Dokumentation"
+msgstr "Online Dokumentation:"
#: editor/editor_help.cpp
#, fuzzy
@@ -1416,6 +1408,10 @@ msgstr "Clear"
msgid "Clear Output"
msgstr "Output"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Fejl, kan ikke gemme ressource!"
@@ -3742,6 +3738,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -4029,6 +4033,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5702,6 +5710,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6184,7 +6200,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6329,10 +6347,6 @@ msgid "Delete Item"
msgstr "Slet Valgte"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Kan ikke indeholde '/' eller ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7379,6 +7393,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8073,12 +8091,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Stien skal pege på en gyldig fysisk node for at virke."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Kun én WorldEnvironment er tilladt pr. scene (eller et sæt af instanserede "
"scener)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8169,6 +8197,9 @@ msgstr "Error loading skrifttype."
msgid "Invalid font size."
msgstr "Ugyldig skriftstørrelse."
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Kan ikke indeholde '/' eller ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/de.po b/editor/translations/de.po
index 87f69c3fde..2087c7f4b6 100644
--- a/editor/translations/de.po
+++ b/editor/translations/de.po
@@ -15,10 +15,12 @@
# hyperglow <greensoma@web.de>, 2016.
# Jan Groß <jan@grossit.de>, 2016.
# Kim <github@aggsol.de>, 2017.
+# Neicul <neicul@gmx.de>, 2018.
# Oliver Ruehl <oliver@ruehldesign.co>, 2016-2017.
# Paul-Vincent Roll <paviro@me.com>, 2016.
# Peter Friedland <peter_friedland@gmx.de>, 2016.
# No need for a name <endoplasmatik@gmx.net>, 2016.
+# Sönke <me@eknoes.de>, 2018.
# So Wieso <sowieso@dukun.de>, 2016-2018.
# Tim Schellenberg <smwleod@gmail.com>, 2017.
# Timo Schwarzer <account@timoschwarzer.com>, 2016-2018.
@@ -28,8 +30,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-02-12 08:36+0000\n"
-"Last-Translator: So Wieso <sowieso@dukun.de>\n"
+"PO-Revision-Date: 2018-04-18 15:38+0000\n"
+"Last-Translator: Neicul <neicul@gmx.de>\n"
"Language-Team: German <https://hosted.weblate.org/projects/godot-engine/"
"godot/de/>\n"
"Language: de\n"
@@ -37,7 +39,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -344,7 +346,7 @@ msgstr "Skalierungsverhältnis:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr "Node dessen Funktionen aufgerufen werden sollen auswählen."
+msgstr "Funktionen in welcher Node aufrufen?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
@@ -1423,6 +1425,10 @@ msgstr "Löschen"
msgid "Clear Output"
msgstr "Ausgabe löschen"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Fehler beim speichern der Ressource!"
@@ -1622,7 +1628,7 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"Es ist keine Hauptszene wurde jemals bestimmt, soll eine ausgewählt werden?\n"
+"Es wurde noch keine Hauptszene bestimmt, soll eine ausgewählt werden?\n"
"Dies kann später in den Projekteinstellungen unter der Kategorie ‚Anwendung‘ "
"geändert werden."
@@ -3479,8 +3485,8 @@ msgstr ""
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid "Failed creating lightmap images, make sure path is writable."
msgstr ""
-"Erstellung der Lightmap-Bilder fehlgeschlagen. Ist der Speicherpfad "
-"beschreibbar?"
+"Erstellung der Lightmap-Bilder fehlgeschlagen. Stellen Sie sicher, dass der "
+"Speicherpfad beschreibbar ist."
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid "Bake Lightmaps"
@@ -3739,6 +3745,16 @@ msgid "Show Guides"
msgstr "Hilfslinien anzeigen"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Zeige Ursprung"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "Eine Ansicht"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Auswahl zentrieren"
@@ -4029,6 +4045,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Mesh hat keine Oberfläche von der Umrisse erzeugt werden könnten!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Konnte keinen Umriss erzeugen!"
@@ -5700,6 +5720,16 @@ msgid "Checked Item"
msgstr "Überprüftes Element"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Element hinzufügen"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Überprüftes Element"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Enthält"
@@ -6015,11 +6045,12 @@ msgid "Invalid project path (changed anything?)."
msgstr "Ungültiger Projektpfad (etwas geändert?)."
#: editor/project_manager.cpp
-#, fuzzy
msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
-msgstr "project.godot des Projektpfads konnte nicht bearbeitet werden."
+msgstr ""
+"Konnte project.godot im Projektpfad nicht laden (Fehler %d). Sie könnte "
+"fehlen oder beschädigt worden sein."
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
@@ -6198,8 +6229,10 @@ msgid "Mouse Button"
msgstr "Maustaste"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Ungültiger Name für Aktion (alle Zeichen außer ‚/‘ und ‚:‘ möglich)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6342,10 +6375,6 @@ msgid "Delete Item"
msgstr "Eintrag löschen"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Darf nicht ‚/‘ oder ‚:‘ beinhalten"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Existiert bereits"
@@ -7293,18 +7322,16 @@ msgid "Object can't provide a length."
msgstr "Objekt kann keine Länge vorweisen."
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Next Plane"
-msgstr "Nächster Tab"
+msgstr "Nächste Ebene"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Plane"
-msgstr "Vorheriger Tab"
+msgstr "Vorherige Ebene"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Plane:"
-msgstr ""
+msgstr "Ebene:"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Next Floor"
@@ -7410,6 +7437,10 @@ msgstr "GridMap-Einstellungen"
msgid "Pick Distance:"
msgstr "Auswahlradius:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Lösungen erzeugen..."
@@ -7440,7 +7471,7 @@ msgstr "Mono"
#: modules/mono/editor/godotsharp_editor.cpp
msgid "About C# support"
-msgstr ""
+msgstr "Über die C#-Unterstützung"
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Create C# solution"
@@ -7460,7 +7491,7 @@ msgstr "Warnungen"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Ende des inneren Exception-Stack-Traces"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7646,7 +7677,7 @@ msgstr "Sequenz"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr "Schalter"
+msgstr "Switch"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
@@ -7654,7 +7685,7 @@ msgstr "Iterator"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr "Während"
+msgstr "While"
#: modules/visual_script/visual_script_editor.cpp
msgid "Return"
@@ -8027,11 +8058,11 @@ msgstr "ARVROrigin benötigt ein ARVRCamera-Unterobjekt"
#: scene/3d/baked_lightmap.cpp
msgid "%d%%"
-msgstr ""
+msgstr "%d%%"
#: scene/3d/baked_lightmap.cpp
msgid "(Time Left: %d:%02d s)"
-msgstr ""
+msgstr "(Verbleibende Zeit: %d:%20d s)"
#: scene/3d/baked_lightmap.cpp
msgid "Plotting Meshes: "
@@ -8132,12 +8163,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Spatial-Node verweisen."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Pro Szene (oder einem Satz von instanzierten Szenen) ist nur ein einziges "
"WorldEnvironment erlaubt."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8239,6 +8280,13 @@ msgstr "Fehler beim Laden der Schriftart."
msgid "Invalid font size."
msgstr "Ungültige Schriftgröße."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr ""
+#~ "Ungültiger Name für Aktion (alle Zeichen außer ‚/‘ und ‚:‘ möglich)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Darf nicht ‚/‘ oder ‚:‘ beinhalten"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/de_CH.po b/editor/translations/de_CH.po
index a9b1b8a994..ea942bb7c2 100644
--- a/editor/translations/de_CH.po
+++ b/editor/translations/de_CH.po
@@ -1385,6 +1385,10 @@ msgstr ""
msgid "Clear Output"
msgstr "Script hinzufügen"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3663,6 +3667,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3954,6 +3966,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5639,6 +5655,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6132,7 +6156,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6277,11 +6303,6 @@ msgid "Delete Item"
msgstr "Node(s) löschen"
#: editor/project_settings_editor.cpp
-#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "Verbindung zu Node:"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7348,6 +7369,10 @@ msgstr "Projekteinstellungen"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8031,10 +8056,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Die Pfad-Variable muss auf einen gültigen Particles2D Node verweisen."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8119,6 +8154,10 @@ msgid "Invalid font size."
msgstr ""
#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Verbindung zu Node:"
+
+#, fuzzy
#~ msgid "Can't write file."
#~ msgstr "Neues Projekt erstellen"
diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot
index 740ea4f930..61d67d7089 100644
--- a/editor/translations/editor.pot
+++ b/editor/translations/editor.pot
@@ -1364,6 +1364,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3583,6 +3587,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3868,6 +3880,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5529,6 +5545,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6004,7 +6028,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6148,10 +6174,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7190,6 +7212,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7826,10 +7852,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/el.po b/editor/translations/el.po
index 6eea5da60d..2bf8d790ab 100644
--- a/editor/translations/el.po
+++ b/editor/translations/el.po
@@ -8,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-27 22:19+0000\n"
+"PO-Revision-Date: 2018-03-05 16:04+0000\n"
"Last-Translator: George Tsiamasiotis <gtsiam@windowslive.com>\n"
"Language-Team: Greek <https://hosted.weblate.org/projects/godot-engine/godot/"
"el/>\n"
@@ -1394,6 +1394,10 @@ msgstr "ΕκκαθάÏιση"
msgid "Clear Output"
msgstr "ΕκκαθάÏιση εξόδου"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Σφάλμα κατά την αποθήκευση πόÏου!"
@@ -3716,6 +3720,16 @@ msgid "Show Guides"
msgstr "Εμφάνιση οδηγών"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "ΠÏοβολή ΑÏχής"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Οπτική γωνία"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "ΚεντÏάÏισμα επιλογής"
@@ -4005,6 +4019,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Το πλέγμα δεν έχει επιφάνει από την οποία να δημιουÏγήσει πεÏιγÏάματα!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Δεν ήταν δυνατή η δημιουÏγία πεÏιγÏάμματος!"
@@ -5679,6 +5697,16 @@ msgid "Checked Item"
msgstr "Επιλεγμένο στοιχείο"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "ΠÏοσθήκη στοιχείου"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Επιλεγμένο στοιχείο"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Έχει"
@@ -6180,8 +6208,10 @@ msgid "Mouse Button"
msgstr "Κουμπί ποντικιοÏ"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Μη έγκυÏη ενέÏγεια (Όλα επιτÏέποντα εκτός από το '/' και το ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6324,10 +6354,6 @@ msgid "Delete Item"
msgstr "ΔιαγÏαφή αντικειμένου"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Δεν μποÏεί να πεÏιέχει '/' ή ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "ΥπάÏχει ήδη"
@@ -7394,6 +7420,10 @@ msgstr "Ρυθμίσεις GridMap"
msgid "Pick Distance:"
msgstr "Επιλογή απόστασης:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "ΔημιουÏγία λÏσης..."
@@ -7444,7 +7474,7 @@ msgstr "ΠÏοειδοποιήσεις"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Τέλος ιχνηλάτησης στοίβας εσωτεÏικής εξαίÏεσης"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -8113,12 +8143,22 @@ msgstr ""
"δουλέψει αυτός ο κόμβος."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Μόνο ένα WorldEnvironment επιτÏέπεται σε κάθε σκηνή (ή σÏνολο στιγμιοτÏπων "
"σκηνών)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8216,6 +8256,12 @@ msgstr "Σφάλμα κατά την φόÏτωση της γÏαμματοσεÎ
msgid "Invalid font size."
msgstr "Μη έγκυÏο μέγεθος γÏαμματοσειÏάς."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Μη έγκυÏη ενέÏγεια (Όλα επιτÏέποντα εκτός από το '/' και το ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Δεν μποÏεί να πεÏιέχει '/' ή ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/es.po b/editor/translations/es.po
index b9b342114c..86188201c1 100644
--- a/editor/translations/es.po
+++ b/editor/translations/es.po
@@ -6,6 +6,7 @@
# Addiel Lucena Perez <addiell2017@gmail.com>, 2017.
# Aleix Sanchis <aleixsanchis@hotmail.com>, 2017.
# Alejandro Alvarez <eliluminado00@gmail.com>, 2017.
+# Avocado <avocadosan42@gmail.com>, 2018.
# BLaDoM GUY <simplybladom@gmail.com>, 2017.
# Carlos López <genetita@gmail.com>, 2016.
# David Arranz <davarrcal@hotmail.com>, 2018.
@@ -13,6 +14,7 @@
# Dharkael <izhe@hotmail.es>, 2017.
# Diego López <diegodario21@gmail.com>, 2017.
# Gustavo Leon <gleondiaz@gmail.com>, 2017-2018.
+# Javier Ocampos <xavier.ocampos@gmail.com>, 2018.
# Juan Quiroga <juanquiroga9@gmail.com>, 2017.
# Kiji Pixel <raccoon.fella@gmail.com>, 2017.
# Lisandro Lorea <lisandrolorea@gmail.com>, 2016-2017.
@@ -24,13 +26,14 @@
# Sebastian Silva <sebastian@fuentelibre.org>, 2016.
# Swyter <swyterzone@gmail.com>, 2016-2017.
# Vazquinhos <vazquinhos@gmail.com>, 2018.
+# Yovani Damián <blackblex@gmail.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-03-03 09:49+0000\n"
-"Last-Translator: David Arranz <davarrcal@hotmail.com>\n"
+"PO-Revision-Date: 2018-05-03 02:11+0000\n"
+"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/"
"godot/es/>\n"
"Language: es\n"
@@ -38,7 +41,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -46,7 +49,7 @@ msgstr "Desactivado"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr "Toda la selección"
+msgstr "Toda la Selección"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
@@ -224,31 +227,31 @@ msgstr "Crear"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
-msgstr "Crear e insertar animación"
+msgstr "Crear e Insertar Animación"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
-msgstr "Insertar pista y clave de animación"
+msgstr "Insertar Pista y Clave de Animación"
#: editor/animation_editor.cpp
msgid "Anim Insert Key"
-msgstr "Insertar clave de animación"
+msgstr "Insertar clave de Animación"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr "Cambiar duración de animación"
+msgstr "Cambiar duración de Animación"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr "Cambiar repeticiones de animación"
+msgstr "Cambiar bucle de Animación"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
-msgstr "Crear clave de valor de tipo para animación"
+msgstr "Crear clave de valor tipado para Animación"
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr "Insertar animación"
+msgstr "Insertar Animación"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
@@ -256,7 +259,7 @@ msgstr "Escalar Claves de Animación"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr "Añadir «call track» de Animación"
+msgstr "Añadir Call Track de Animación"
#: editor/animation_editor.cpp
msgid "Animation zoom."
@@ -264,11 +267,11 @@ msgstr "Zoom de Animación."
#: editor/animation_editor.cpp
msgid "Length (s):"
-msgstr "Duración (s):"
+msgstr "Duración (seg):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr "Duración de Animación (en segundos)."
+msgstr "Duración de la Animación (en segundos)."
#: editor/animation_editor.cpp
msgid "Step (s):"
@@ -346,7 +349,7 @@ msgstr "Relación de Escalado:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr "¿En qué nodo quieres llamar funciones?"
+msgstr "¿Desde que nodo quieres realizar llamadas a funciones?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
@@ -847,15 +850,15 @@ msgstr "Añadir Efecto"
#: editor/editor_audio_buses.cpp
msgid "Rename Audio Bus"
-msgstr "Renombrar bus de audio"
+msgstr "Renombrar Bus de Audio"
#: editor/editor_audio_buses.cpp
msgid "Change Audio Bus Volume"
-msgstr "Cambiar volumen del bus de audio"
+msgstr "Cambiar Volumen de Bus de Audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Solo"
-msgstr "Alternar Audio Bus Solo"
+msgstr "Act./Desact. Solo de Bus de Audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Mute"
@@ -867,7 +870,7 @@ msgstr "Alternar puenteado de efectos en Bus de Audio"
#: editor/editor_audio_buses.cpp
msgid "Select Audio Bus Send"
-msgstr "Seleccionar envío a bus de audio"
+msgstr "Seleccionar Envío de Audio Bus"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus Effect"
@@ -879,7 +882,7 @@ msgstr "Mover Efecto de Bus"
#: editor/editor_audio_buses.cpp
msgid "Delete Bus Effect"
-msgstr "Borrar Efecto de Bus"
+msgstr "Eliminar Efecto de Bus"
#: editor/editor_audio_buses.cpp
msgid "Audio Bus, Drag and Drop to rearrange."
@@ -895,7 +898,7 @@ msgstr "Silenciar"
#: editor/editor_audio_buses.cpp
msgid "Bypass"
-msgstr "Puentear"
+msgstr "Bypass"
#: editor/editor_audio_buses.cpp
msgid "Bus options"
@@ -1036,7 +1039,7 @@ msgstr "No está en la ruta de recursos."
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
-msgstr "Añadir «AutoLoad»"
+msgstr "Añadir AutoLoad"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
@@ -1422,6 +1425,10 @@ msgstr "Borrar todo"
msgid "Clear Output"
msgstr "Borrar salida"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "¡Hubo un error al guardar el recurso!"
@@ -1977,7 +1984,7 @@ msgstr "Ejecutar script"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
-msgstr "Exportar"
+msgstr "Export"
#: editor/editor_node.cpp
msgid "Tools"
@@ -3082,7 +3089,7 @@ msgstr "Autoreproducir al cargar"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Edit Target Blend Times"
-msgstr "Editar tiempos de mezcla de selección"
+msgstr "Editar tiempos de mezcla con otras animaciones"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Animation Tools"
@@ -3740,6 +3747,16 @@ msgid "Show Guides"
msgstr "Mostrar guías"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Ver origen"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 visor"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centrar selección"
@@ -4031,6 +4048,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "¡La malla no tiene superficie de la que crear contornos!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "¡No se pudo crear el contorno!"
@@ -4835,7 +4856,7 @@ msgstr "Minúscula"
#: editor/plugins/script_text_editor.cpp
msgid "Capitalize"
-msgstr "Convertir en Mayúsculas"
+msgstr "Letra Capital"
#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
@@ -5702,6 +5723,16 @@ msgid "Checked Item"
msgstr "Casilla de verificación activa"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Añadir elemento"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Casilla de verificación activa"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Tiene"
@@ -6203,8 +6234,10 @@ msgid "Mouse Button"
msgstr "Botón del ratón"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "La acción no es correcta (no puedes utilizar «/» o «:»)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6347,10 +6380,6 @@ msgid "Delete Item"
msgstr "Eliminar elemento"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "No puede contener '/' o ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Ya existe"
@@ -6730,7 +6759,7 @@ msgid ""
"satisfied."
msgstr ""
"No se pudo guardar la escena nueva. Es posible que no se hayan podido "
-"satisfacer las dependencias (instancias)."
+"resolver las dependencias (instancias)."
#: editor/scene_tree_dock.cpp
msgid "Error saving scene."
@@ -6766,7 +6795,7 @@ msgstr "Cambiar tipo"
#: editor/scene_tree_dock.cpp
msgid "Attach Script"
-msgstr "Adjuntar script"
+msgstr "Añadir Script"
#: editor/scene_tree_dock.cpp
msgid "Clear Script"
@@ -6806,7 +6835,7 @@ msgstr "Filtrar nodos"
#: editor/scene_tree_dock.cpp
msgid "Attach a new or existing script for the selected node."
-msgstr "Adjuntar un script nuevo o existente al nodo seleccionado."
+msgstr "Añadir un script nuevo o existente al nodo seleccionado."
#: editor/scene_tree_dock.cpp
msgid "Clear a script for the selected node."
@@ -6987,7 +7016,7 @@ msgstr "Cargar archivo de script existente"
#: editor/script_create_dialog.cpp
msgid "Language"
-msgstr "Idioma"
+msgstr "Lenguaje"
#: editor/script_create_dialog.cpp
msgid "Inherits"
@@ -7007,7 +7036,7 @@ msgstr "Script integrado"
#: editor/script_create_dialog.cpp
msgid "Attach Node Script"
-msgstr "Adjuntar script de nodo"
+msgstr "Añadir script de nodo"
#: editor/script_editor_debugger.cpp
msgid "Remote "
@@ -7051,11 +7080,11 @@ msgstr "Error de copia"
#: editor/script_editor_debugger.cpp
msgid "Inspect Previous Instance"
-msgstr "Inspeccionar instancia anterior"
+msgstr "Inspeccionar Instancia Anterior"
#: editor/script_editor_debugger.cpp
msgid "Inspect Next Instance"
-msgstr "Inspeccionar instancia siguiente"
+msgstr "Inspeccionar Instancia Siguiente"
#: editor/script_editor_debugger.cpp
msgid "Stack Frames"
@@ -7111,7 +7140,7 @@ msgstr "Tipo"
#: editor/script_editor_debugger.cpp
msgid "Format"
-msgstr "Formato"
+msgstr "Format"
#: editor/script_editor_debugger.cpp
msgid "Usage"
@@ -7243,7 +7272,7 @@ msgstr "Bibliotecas: "
#: modules/gdnative/register_types.cpp
msgid "GDNative"
-msgstr "\"GDNative\""
+msgstr "GDNative"
#: modules/gdscript/gdscript_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -7415,6 +7444,10 @@ msgstr "Ajustes del GridMap"
msgid "Pick Distance:"
msgstr "Seleccionar distancia:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Generando solución..."
@@ -7465,7 +7498,7 @@ msgstr "Advertencias"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Fin del reporte de la pila de excepciones"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7651,7 +7684,7 @@ msgstr "Secuencia"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr "Interruptor"
+msgstr "Switch"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
@@ -7667,7 +7700,7 @@ msgstr "Devuelve (\"Return\")"
#: modules/visual_script/visual_script_editor.cpp
msgid "Call"
-msgstr "Llamada (\"Call\")"
+msgstr "Call"
#: modules/visual_script/visual_script_editor.cpp
msgid "Get"
@@ -8132,12 +8165,22 @@ msgstr ""
"La propiedad Path debe apuntar a un nodo Spatial válido para funcionar."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Solo se permite un WorldEnvironment por escena (o conjunto de escenas "
"instanciadas)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8234,6 +8277,12 @@ msgstr "Error al cargar la tipografía."
msgid "Invalid font size."
msgstr "Tamaño de tipografía incorrecto."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "La acción no es correcta (no puedes utilizar «/» o «:»)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "No puede contener '/' o ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po
index f2d6508201..304fc7dbc5 100644
--- a/editor/translations/es_AR.po
+++ b/editor/translations/es_AR.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-02-24 21:43+0000\n"
+"PO-Revision-Date: 2018-03-04 06:03+0000\n"
"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n"
"Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/"
"godot-engine/godot/es_AR/>\n"
@@ -1401,6 +1401,10 @@ msgstr "Limpiar"
msgid "Clear Output"
msgstr "Limpiar Salida"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Error al guardar el recurso!"
@@ -3717,6 +3721,16 @@ msgid "Show Guides"
msgstr "Mostrar guías"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Ver Origen"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Viewport"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centrar Selección"
@@ -4006,6 +4020,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "El mesh no tiene una superficie de donde crear contornos(outlines)!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "No se pudo crear el outline!"
@@ -5676,6 +5694,16 @@ msgid "Checked Item"
msgstr "Item Tildado"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Agregar Item"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Item Tildado"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Tiene"
@@ -6180,8 +6208,10 @@ msgid "Mouse Button"
msgstr "Botón de Mouse"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Acción Invalida (cualquier cosa va menos '/' o ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6324,10 +6354,6 @@ msgid "Delete Item"
msgstr "Eliminar Ãtem"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "No puede contener '/' o ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Ya existe"
@@ -7389,6 +7415,10 @@ msgstr "Ajustes de GridMap"
msgid "Pick Distance:"
msgstr "Elegir Instancia:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Generando solución..."
@@ -7439,7 +7469,7 @@ msgstr "Advertencias"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Fin del stack trace de excepción interna"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -8097,12 +8127,22 @@ msgstr ""
"La propiedad Path debe apuntar a un nodo Spatial valido para funcionar."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Solo se permite un WorldEnvironment por escena (o conjunto de escenas "
"instanciadas)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8199,6 +8239,12 @@ msgstr "Error cargando tipografía."
msgid "Invalid font size."
msgstr "Tamaño de tipografía inválido."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Acción Invalida (cualquier cosa va menos '/' o ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "No puede contener '/' o ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/fa.po b/editor/translations/fa.po
index 7bcbeb15f0..8b7fdcbb79 100644
--- a/editor/translations/fa.po
+++ b/editor/translations/fa.po
@@ -4,6 +4,7 @@
# This file is distributed under the same license as the Godot source code.
#
# alabd14313 <alabd14313@yahoo.com>, 2016.
+# Dante Marshal <Marshal.Devilhunter@gmail.com>, 2018.
# hamed nasib <cghamed752@chmail.ir>, 2016.
# Hasan Hejdari Nasab <hsn6@openmailbox.org>, 2017.
# rezapouya <r.pouya@chmail.ir>, 2016.
@@ -12,15 +13,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-11-26 16:49+0000\n"
-"Last-Translator: sayyed hamed nasib <cghamed752@chmail.ir>\n"
+"PO-Revision-Date: 2018-04-29 05:39+0000\n"
+"Last-Translator: Dante Marshal <Marshal.Devilhunter@gmail.com>\n"
"Language-Team: Persian <https://hosted.weblate.org/projects/godot-engine/"
"godot/fa/>\n"
"Language: fa\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.18-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -31,9 +32,8 @@ msgid "All Selection"
msgstr "همه‌ی انتخاب ها"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Keyframe Time"
-msgstr "مقدار را در انیمیشن تغییر بده"
+msgstr "تغییر زمان Ùریم کلید در انیمیشن"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
@@ -44,9 +44,8 @@ msgid "Anim Change Transform"
msgstr "انتقال را در انیمیشن تغییر بده"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Keyframe Value"
-msgstr "مقدار را در انیمیشن تغییر بده"
+msgstr "تغییر مقدار Ùریم کلید در انیمیشن"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
@@ -54,52 +53,51 @@ msgstr "Ùراخوانی را در انیمیشن تغییر بده"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr ""
+msgstr "اÙزودن ترَک به انیمیشن"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr ""
+msgstr "تکرار کلید‌های انیمیشن"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr ""
+msgstr "انتقال ترک انیمشین به بالا"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr ""
+msgstr "انتقال ترک انیمشین به پایین"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr ""
+msgstr "حذ٠ترک انیمشین"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
-msgstr ""
+msgstr "تنظیم گذار‌ها به :"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr ""
+msgstr "تغییر نام ترک انیمشین"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr ""
+msgstr "تغییر سبک الحاق ترک انیمیشن"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr ""
+msgstr "تغییر حالت مقدار ترک انیمیشن"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "مقدار را در انیمیشن تغییر بده"
+msgstr "تغییر حالت بسته شدن ترک انیمشین"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr ""
+msgstr "ویرایش منحنی گره"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr ""
+msgstr "ویرایش منحنی انتخاب شده"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
@@ -377,7 +375,6 @@ msgid "No Matches"
msgstr "تطبیقی ندارد"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "تعداد d% رخداد جایگزین شد."
@@ -430,6 +427,8 @@ msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
msgstr ""
+"متد هد٠پیدا نشد! لطÙا یک متد صحیح مشخص کنید یا یک اسکریپت به گره هد٠الحاق "
+"کنید."
#: editor/connections_dialog.cpp
msgid "Connect To Node:"
@@ -499,9 +498,8 @@ msgid "Connecting Signal:"
msgstr "اتصال سیگنال:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Disconnect '%s' from '%s'"
-msgstr "'s%' را به 's%' متصل کن"
+msgstr "'s%' را از 's%' جدا کن"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -517,9 +515,8 @@ msgid "Signals"
msgstr "سیگنال‌ها"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Change %s Type"
-msgstr "تغییر نوع"
+msgstr "تغییر نوع %s"
#: editor/create_dialog.cpp editor/project_settings_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -527,18 +524,17 @@ msgid "Change"
msgstr "تغییر بده"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Create New %s"
-msgstr "ساختن جدید"
+msgstr "ساختن %s جدید"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
msgid "Favorites:"
-msgstr ""
+msgstr "برگزیده‌ها:"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
msgid "Recent:"
-msgstr ""
+msgstr "اخیر:"
#: editor/create_dialog.cpp editor/editor_node.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -640,8 +636,9 @@ msgstr ""
"آیا در هر صورت حذ٠شوند؟(بدون برگشت)"
#: editor/dependency_editor.cpp
+#, fuzzy
msgid "Cannot remove:"
-msgstr ""
+msgstr "ناتوانی در حذ٠:"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -697,80 +694,82 @@ msgstr "حذ٠کن"
#: editor/dictionary_property_edit.cpp
msgid "Change Dictionary Key"
-msgstr ""
+msgstr "تغییر کلید دیکشنری"
#: editor/dictionary_property_edit.cpp
msgid "Change Dictionary Value"
-msgstr "تغییر ارزش دیکشنری"
+msgstr "تغییر مقدار دیکشنری"
#: editor/editor_about.cpp
msgid "Thanks from the Godot community!"
-msgstr ""
+msgstr "با تشکر از سوی جامعه‌ی Godot!"
#: editor/editor_about.cpp
msgid "Thanks!"
-msgstr "تشکرات!"
+msgstr "با تشکر !"
#: editor/editor_about.cpp
msgid "Godot Engine contributors"
-msgstr ""
+msgstr "شرکت‌کنندگان در ساخت موتور Godot"
#: editor/editor_about.cpp
msgid "Project Founders"
-msgstr "برپا کننده های پروژه"
+msgstr "بنیان‌گذاران پروژه"
#: editor/editor_about.cpp
msgid "Lead Developer"
-msgstr ""
+msgstr "توسعه‌دهنده‌ی اصلی"
#: editor/editor_about.cpp
-#, fuzzy
msgid "Project Manager "
-msgstr "مدیر پروژه"
+msgstr "مدیر پروژه "
#: editor/editor_about.cpp
msgid "Developers"
-msgstr ""
+msgstr "توسعه دهندگان"
#: editor/editor_about.cpp
msgid "Authors"
msgstr "مؤلÙان"
#: editor/editor_about.cpp
+#, fuzzy
msgid "Platinum Sponsors"
-msgstr ""
+msgstr "اسپانسر‌های درجه ۱"
#: editor/editor_about.cpp
+#, fuzzy
msgid "Gold Sponsors"
-msgstr ""
+msgstr "اسپانسر‌های درجه ۲"
#: editor/editor_about.cpp
+#, fuzzy
msgid "Mini Sponsors"
-msgstr ""
+msgstr "اسپانسر‌های دیگر"
#: editor/editor_about.cpp
msgid "Gold Donors"
-msgstr ""
+msgstr "اهداکنندگان طلایی"
#: editor/editor_about.cpp
msgid "Silver Donors"
-msgstr ""
+msgstr "اهداکنندگان نقره‌ای"
#: editor/editor_about.cpp
msgid "Bronze Donors"
-msgstr ""
+msgstr "اهداکنندگان برنزی"
#: editor/editor_about.cpp
msgid "Donors"
-msgstr ""
+msgstr "اهدا کنندگان"
#: editor/editor_about.cpp
msgid "License"
-msgstr ""
+msgstr "مجوز"
#: editor/editor_about.cpp
msgid "Thirdparty License"
-msgstr ""
+msgstr "مجوز‌های شخص ثالث"
#: editor/editor_about.cpp
msgid ""
@@ -1333,7 +1332,7 @@ msgstr ""
#: editor/editor_help.cpp
msgid "Description"
-msgstr "توضیح"
+msgstr "توضیحات"
#: editor/editor_help.cpp
msgid "Online Tutorials:"
@@ -1398,6 +1397,10 @@ msgstr "پاک کردن"
msgid "Clear Output"
msgstr "خروجی"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -2046,7 +2049,7 @@ msgstr "انجمن"
#: editor/editor_node.cpp
msgid "About"
-msgstr "معرÙÛŒ"
+msgstr "درباره"
#: editor/editor_node.cpp
msgid "Play the project."
@@ -3646,6 +3649,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3934,6 +3945,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5623,6 +5638,15 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "اÙزودن مورد"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6113,7 +6137,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6258,10 +6284,6 @@ msgid "Delete Item"
msgstr "حذ٠مورد"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "نمی‌تواند شامل '/' یا ':' باشد"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "پیش از این وجود داشته است"
@@ -7340,6 +7362,10 @@ msgstr "ترجیحات"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7582,14 +7608,16 @@ msgid "Sequence"
msgstr "دنباله"
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Switch"
-msgstr "گزینه"
+msgstr "سوییچ"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
msgstr "تکرارکننده"
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "While"
msgstr "تا زمانی که"
@@ -8049,12 +8077,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "دارایی Path باید به یک گره Particles2D معتبر اشاره کند تا کار کند."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Ùقط یک WorldEnvironment در هر صحنه (یا مجموعه ای از صحنه های نمونه‌گذاری شده) "
"مجاز است."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8145,6 +8183,9 @@ msgstr "خطای بارگذاری قلم."
msgid "Invalid font size."
msgstr "اندازهٔ قلم نامعتبر."
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "نمی‌تواند شامل '/' یا ':' باشد"
+
#~ msgid "Can't write file."
#~ msgstr "ناتوان در نوشتن پرونده."
diff --git a/editor/translations/fi.po b/editor/translations/fi.po
index efc69a02bb..139983464e 100644
--- a/editor/translations/fi.po
+++ b/editor/translations/fi.po
@@ -1437,6 +1437,10 @@ msgstr "Tyhjennä"
msgid "Clear Output"
msgstr "Tuloste"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Virhe tallennettaessa resurssia!"
@@ -3811,6 +3815,16 @@ msgid "Show Guides"
msgstr "Näytä apuviivat"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Näytä origo"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 näyttöruutu"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Valinta keskikohtaan"
@@ -4105,6 +4119,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Ääriviivoja ei voitu luoda!"
@@ -5834,6 +5852,16 @@ msgid "Checked Item"
msgstr "Valittu"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Lisää"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Valittu"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "On"
@@ -6343,8 +6371,10 @@ msgid "Mouse Button"
msgstr "Hiiren painike"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Virheellinen tapahtuma (muut käy, paitsi '/' tai ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6490,11 +6520,6 @@ msgid "Delete Item"
msgstr "Poista syöte"
#: editor/project_settings_editor.cpp
-#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "Yhdistä Nodeen:"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "On jo olemassa"
@@ -7577,6 +7602,10 @@ msgstr "Näyttöruudun asetukset"
msgid "Pick Distance:"
msgstr "Poimi tile"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8240,10 +8269,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8339,6 +8378,13 @@ msgstr "Virhe fontin latauksessa."
msgid "Invalid font size."
msgstr "Virheellinen fonttikoko."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Virheellinen tapahtuma (muut käy, paitsi '/' tai ':')."
+
+#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Yhdistä Nodeen:"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/fr.po b/editor/translations/fr.po
index d9fd96081f..56969fe974 100644
--- a/editor/translations/fr.po
+++ b/editor/translations/fr.po
@@ -3,7 +3,7 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
-# Antoine Carrier <ac.g392@gmail.com>, 2017.
+# Antoine Carrier <ac.g392@gmail.com>, 2017-2018.
# ARocherVj <a.rocher.vj@gmail.com>, 2017.
# Arthur Templé <tuturtemple@gmail.com>, 2018.
# Brice <bbric@free.fr>, 2016.
@@ -13,31 +13,36 @@
# finkiki <specialpopol@gmx.fr>, 2016.
# Gilles Roudiere <gilles.roudiere@gmail.com>, 2017-2018.
# Hugo Locurcio <hugo.l@openmailbox.org>, 2016-2018.
+# John Bernier <john.bp@unknit.net>, 2018.
# Kanabenki <lucien.menassol@gmail.com>, 2017.
-# keltwookie <keltwookie@protonmail.com>, 2017.
+# keltwookie <keltwookie@protonmail.com>, 2017-2018.
+# LL <lu.lecocq@free.fr>, 2018.
# Luc Stepniewski <lior@gradstein.info>, 2017.
# Marc <marc.gilleron@gmail.com>, 2016-2017.
# Nathan Lovato <nathan.lovato.art@gmail.com>, 2017.
# Nicolas <flaithotw@gmail.com>, 2017.
# Nicolas Lehuen <nicolas@lehuen.com>, 2016.
# Nobelix <noe.le.cam@laposte.net>, 2017.
-# Omicron <tritonic.dev@gmail.com>, 2016.
+# Omicron <tritonic.dev@gmail.com>, 2016, 2018.
# Onyx Steinheim <thevoxelmanonyx@gmail.com>, 2016.
# Przemyslaw Gasinski <gasinski.przemek@protonmail.ch>, 2017.
# rafeu <duchainer@gmail.com>, 2016-2017.
+# rawida <rawida@tempinbox.com>, 2018.
# Rémi Verschelde <rverschelde@gmail.com>, 2016-2017.
# Robin Arys <robinarys@hotmail.com>, 2017.
# Roger BR <drai_kin@hotmail.com>, 2016.
+# salty64 <cedric.arrabie@univ-pau.fr>, 2018.
# Thomas Baijot <thomasbaijot@gmail.com>, 2016.
-# Tommy Melançon-Roy <tommel1234@hotmail.com>, 2017.
-# Xananax <xananax@yelostudio.com>, 2017.
+# Tommy Melançon-Roy <tommel1234@hotmail.com>, 2017-2018.
+# Willow <theotimefd@aol.com>, 2018.
+# Xananax <xananax@yelostudio.com>, 2017-2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-02-24 02:36+0000\n"
-"Last-Translator: Cindy Dallaire <c.dallaire93@gmail.com>\n"
+"PO-Revision-Date: 2018-05-02 21:48+0000\n"
+"Last-Translator: Omicron <omicron666.dev@gmail.com>\n"
"Language-Team: French <https://hosted.weblate.org/projects/godot-engine/"
"godot/fr/>\n"
"Language: fr\n"
@@ -45,7 +50,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -61,7 +66,7 @@ msgstr "Changer l'heure de l'animation des images clés"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr "Animation Changer la transition"
+msgstr "Transition du changement d'animation"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
@@ -832,7 +837,7 @@ msgstr "Paquetage installé avec succès !"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Success!"
-msgstr "Succès!"
+msgstr "Succès !"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -861,15 +866,15 @@ msgstr "Modifier le volume audio du bus"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Solo"
-msgstr "Basculer vers transport audio solo"
+msgstr "Activer/désactiver le mode solo pour le bus audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Mute"
-msgstr "Basculer vers désactivation de transport audio"
+msgstr "Activer/désactiver le mode muet pour le bus audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Bypass Effects"
-msgstr "Basculer vers effets de contournement de transport audio"
+msgstr "Activer/désactiver le contournement du bus audio"
#: editor/editor_audio_buses.cpp
msgid "Select Audio Bus Send"
@@ -897,11 +902,11 @@ msgstr "Solo"
#: editor/editor_audio_buses.cpp
msgid "Mute"
-msgstr "Assourdir"
+msgstr "Rendre muet"
#: editor/editor_audio_buses.cpp
msgid "Bypass"
-msgstr "Contournement"
+msgstr "Contourner"
#: editor/editor_audio_buses.cpp
msgid "Bus options"
@@ -1104,7 +1109,7 @@ msgstr "Mise à jour de la scène…"
#: editor/editor_data.cpp
msgid "[empty]"
-msgstr "(vide)"
+msgstr "[vide]"
#: editor/editor_data.cpp
msgid "[unsaved]"
@@ -1157,7 +1162,7 @@ msgstr "Le fichier existe, l'écraser ?"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Select Current Folder"
-msgstr "Selectionner le dossier actuel"
+msgstr "Sélectionner le dossier courant"
#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
msgid "Copy Path"
@@ -1227,7 +1232,7 @@ msgstr "Basculer les fichiers cachés"
#: editor/editor_file_dialog.cpp
msgid "Toggle Favorite"
-msgstr "Basculer le favori"
+msgstr "Basculer l'état favori"
#: editor/editor_file_dialog.cpp
msgid "Toggle Mode"
@@ -1369,8 +1374,8 @@ msgid ""
"$url]contribute one[/url][/color] or [color=$color][url=$url2]request one[/"
"url][/color]."
msgstr ""
-"Pas de tutoriels disponibles pour cette classe, vous pouvez [color=$color]"
-"[url=$url]en contribuer un[/url][/color] ou [color=$color][url=$url2]en "
+"Il n'y a pas de tutoriels disponibles pour cette classe, vous pouvez [color="
+"$color][url=$url]en créer un[/url][/color] ou [color=$color][url=$url2]en "
"demander un[/url][/color]."
#: editor/editor_help.cpp
@@ -1386,8 +1391,8 @@ msgid ""
"There is currently no description for this property. Please help us by "
"[color=$color][url=$url]contributing one[/url][/color]!"
msgstr ""
-"Pas de description disponible pour cette propriété. [color=$color][url="
-"$url]Contribuez[/url][/color] pour nous aider!"
+"Il n'y a pas de description disponible pour cette propriété. Aidez-nous en "
+"[color=$color][url=$url]en créant[/url][/color] une !"
#: editor/editor_help.cpp
msgid "Methods"
@@ -1402,8 +1407,8 @@ msgid ""
"There is currently no description for this method. Please help us by [color="
"$color][url=$url]contributing one[/url][/color]!"
msgstr ""
-"Pas de description disponible pour cette méthode. [color=$color][url="
-"$url]Contribuez[/url][/color] pour nous aider!"
+"Il n'y a pas de description disponible pour cette méthode. Aidez-nous en "
+"[color=$color][url=$url]en créant[/url][/color] une !"
#: editor/editor_help.cpp
msgid "Search Text"
@@ -1428,6 +1433,10 @@ msgstr "Effacer"
msgid "Clear Output"
msgstr "Effacer la sortie"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Erreur d'enregistrement de la ressource !"
@@ -1459,7 +1468,7 @@ msgstr "Impossible d'ouvrir '%s'."
#: editor/editor_node.cpp
msgid "Error while parsing '%s'."
-msgstr "Erreur lors de l'analyse de '%s'."
+msgstr "Erreur lors de l'analyse syntaxique de '%s'."
#: editor/editor_node.cpp
msgid "Unexpected end of file '%s'."
@@ -1467,7 +1476,7 @@ msgstr "Fin de fichier inattendue '%s'."
#: editor/editor_node.cpp
msgid "Missing '%s' or its dependencies."
-msgstr "Fichier '%s' ou dépendances manquantes."
+msgstr "La scène '%s' ou ses dépendances sont introuvables."
#: editor/editor_node.cpp
msgid "Error while loading '%s'."
@@ -1539,10 +1548,10 @@ msgid ""
"Please read the documentation relevant to importing scenes to better "
"understand this workflow."
msgstr ""
-"Cette ressource appartient à une scène qui a été importée, elle n'est donc "
-"pas éditable.\n"
-"Veuillez lire la documentation concernant l'import de scènes afin de mieux "
-"comprendre son déroulement."
+"Cette ressource n'est pas éditable car elle appartient à une scène "
+"importée.\n"
+"Merci de lire la documentation concernant l'import des scènes pour en "
+"comprendre le processus."
#: editor/editor_node.cpp
msgid ""
@@ -1550,16 +1559,15 @@ msgid ""
"Changes to it will not be kept when saving the current scene."
msgstr ""
"Cette ressource appartient a une scène qui a été instanciée ou héritée.\n"
-"Ses changements ne seront pas retenus lors de la sauvegarde de la scène "
-"actuelle."
+"Ses modifications seront perdues lors de la sauvegarde de la scène actuelle."
#: editor/editor_node.cpp
msgid ""
"This resource was imported, so it's not editable. Change its settings in the "
"import panel and then re-import."
msgstr ""
-"Cette ressource a été importée, aucune modification n’est possible. Modifiez "
-"ses paramètres dans le menu d'importation et, ensuite, réimportez-la."
+"Cette ressource a été importée, elle n'est donc pas éditable. Modifiez ses "
+"paramètres dans le panneau d'importation et, ensuite, réimportez-la."
#: editor/editor_node.cpp
msgid ""
@@ -1569,9 +1577,9 @@ msgid ""
"understand this workflow."
msgstr ""
"Cette scène a été importée, les changements ne seront donc pas conservés.\n"
-"L'instancier ou en hériter permettra de faire ces changements\n"
+"L'instancier ou l'hériter permettra de faire ces changements.\n"
"Veuillez lire la documentation concernant l'importation des scènes afin de "
-"mieux comprendre ce déroulement."
+"mieux comprendre ce processus."
#: editor/editor_node.cpp
msgid ""
@@ -1579,17 +1587,18 @@ msgid ""
"Please read the documentation relevant to debugging to better understand "
"this workflow."
msgstr ""
-"Ceci est un objet distant, les changements ne seront donc pas conservés.\n"
-"Veuillez lire la documentation concernant le débogage afin de mieux "
-"comprendre ce fonctionnement."
+"Ceci est un objet distant, les changements qui y sont faits ne seront pas "
+"sauvegardés.\n"
+"Merci de lire la section de la documentation portant sur le débogage pour "
+"mieux comprendre ce mécanisme."
#: editor/editor_node.cpp
msgid "Expand all properties"
-msgstr "Développer tout"
+msgstr "Développer toutes les propriétés"
#: editor/editor_node.cpp
msgid "Collapse all properties"
-msgstr "Réduire tout"
+msgstr "Réduire toutes les propriétés"
#: editor/editor_node.cpp
msgid "Copy Params"
@@ -1715,7 +1724,7 @@ msgstr "Exporter une bibliothèque de maillages"
#: editor/editor_node.cpp
msgid "This operation can't be done without a root node."
-msgstr "Cette opération ne peut être réalisée sans nœud racine."
+msgstr "Cette opération ne peut être réalisée sans noeud parent."
#: editor/editor_node.cpp
msgid "Export Tile Set"
@@ -1779,8 +1788,8 @@ msgid ""
"considered a bug. Please report."
msgstr ""
"Cette option est dépréciée. Les situations dans lesquelles un "
-"rafraîchissement doit être forcé sont désormais considérés comme bug. "
-"Veuillez le signaler."
+"rafraîchissement doit être forcé sont désormais considérées comme un bogue. "
+"Merci de le signaler."
#: editor/editor_node.cpp
msgid "Pick a Main Scene"
@@ -1789,8 +1798,8 @@ msgstr "Choisir une scène principale"
#: editor/editor_node.cpp
msgid "Unable to enable addon plugin at: '%s' parsing of config failed."
msgstr ""
-"Impossible d'activer le plugin depuis : '%s' la lecture de la configuration "
-"a échoué."
+"Impossible d'activer le greffon depuis : '%s' l’analyse syntaxique de la "
+"configuration a échoué."
#: editor/editor_node.cpp
msgid "Unable to find script field for addon plugin at: 'res://addons/%s'."
@@ -1845,7 +1854,7 @@ msgstr "La scène « %s » a des dépendences cassées :"
#: editor/editor_node.cpp
msgid "Clear Recent Scenes"
-msgstr "Retirer les scènes récentes"
+msgstr "Vider la liste des scènes récentes"
#: editor/editor_node.cpp
msgid "Save Layout"
@@ -1862,7 +1871,7 @@ msgstr "Par défaut"
#: editor/editor_node.cpp
msgid "Switch Scene Tab"
-msgstr "Basculer entre les onglets de scène"
+msgstr "Basculer entre onglets de scène"
#: editor/editor_node.cpp
msgid "%d more files or folders"
@@ -1886,7 +1895,7 @@ msgstr "Mode Sans Distraction"
#: editor/editor_node.cpp
msgid "Toggle distraction-free mode."
-msgstr "Basculer vers mode sans-distraction."
+msgstr "Basculer en mode sans distraction."
#: editor/editor_node.cpp
msgid "Add a new scene."
@@ -2093,7 +2102,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Editor"
-msgstr "Editeur"
+msgstr "Éditeur"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -2105,7 +2114,7 @@ msgstr "Disposition de l'éditeur"
#: editor/editor_node.cpp
msgid "Toggle Fullscreen"
-msgstr "Basculer le mode plein écran"
+msgstr "Activer/Désactiver le plein écran"
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Manage Export Templates"
@@ -2240,7 +2249,7 @@ msgstr "Propriétés de l'objet."
#: editor/editor_node.cpp
msgid "Changes may be lost!"
-msgstr "Les changements risquent d’être perdus !"
+msgstr "Les modifications risquent d'être perdues !"
#: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp
#: editor/project_manager.cpp
@@ -2309,7 +2318,7 @@ msgstr "Ouvrir éditeur 3D"
#: editor/editor_node.cpp
msgid "Open Script Editor"
-msgstr "Ouvrir éditeur de script"
+msgstr "Ouvrir l'éditeur de script"
#: editor/editor_node.cpp editor/project_manager.cpp
msgid "Open Asset Library"
@@ -2317,11 +2326,11 @@ msgstr "Ouvrir bibliothèque de ressource"
#: editor/editor_node.cpp
msgid "Open the next Editor"
-msgstr "Ouvrir éditeur suivant"
+msgstr "Ouvrir l'éditeur suivant"
#: editor/editor_node.cpp
msgid "Open the previous Editor"
-msgstr "Ouvrir éditeur précédant"
+msgstr "Ouvrir l'éditeur précédant"
#: editor/editor_plugin.cpp
msgid "Creating Mesh Previews"
@@ -2390,7 +2399,7 @@ msgstr "Inclusif"
#: editor/editor_profiler.cpp
msgid "Self"
-msgstr "Soi"
+msgstr "Self"
#: editor/editor_profiler.cpp
msgid "Frame #:"
@@ -2398,7 +2407,7 @@ msgstr "Frame # :"
#: editor/editor_profiler.cpp
msgid "Time"
-msgstr "Temps :"
+msgstr "Temps"
#: editor/editor_profiler.cpp
msgid "Calls"
@@ -2442,7 +2451,7 @@ msgstr "Avez-vous oublié la méthode « _run » ?"
#: editor/editor_settings.cpp
msgid "Default (Same as Editor)"
-msgstr "Par défaut (même que l'éditeur)"
+msgstr "Par défaut (le même que l'éditeur)"
#: editor/editor_sub_scene.cpp
msgid "Select Node(s) to Import"
@@ -2517,9 +2526,8 @@ msgid ""
"No download links found for this version. Direct download is only available "
"for official releases."
msgstr ""
-"Aucun lien de téléchargement n'a été trouvé pour cette version. Le "
-"téléchargement direct est uniquement disponible pour les versions "
-"officielles."
+"Aucun lien de téléchargement trouvé pour cette version. Le téléchargement "
+"direct est uniquement disponible pour les versions officielles."
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -2539,7 +2547,7 @@ msgstr "Pas de réponse."
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Request Failed."
-msgstr "Requête échouée."
+msgstr "Échec de la requête."
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -2645,7 +2653,9 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '%s' as it has not been found in the file system!"
-msgstr "Impossible d'accédez à '%s' car celui-ci n'a pas été trouvé !"
+msgstr ""
+"Impossible d'accédez à '%s' car celui-ci n'existe pas dans le système de "
+"fichiers !"
#: editor/filesystem_dock.cpp
msgid "View items as a grid of thumbnails"
@@ -2683,11 +2693,11 @@ msgstr "Impossible de mettre à jour les dépendences :"
#: editor/filesystem_dock.cpp
msgid "No name provided"
-msgstr "Aucun nom fourni"
+msgstr "Aucun nom renseigné"
#: editor/filesystem_dock.cpp
msgid "Provided name contains invalid characters"
-msgstr "Le nom fourni contient des caractères invalides"
+msgstr "Le nom renseigné contient des caractères invalides"
#: editor/filesystem_dock.cpp
msgid "No name provided."
@@ -3093,7 +3103,7 @@ msgstr "Lecture automatique au chargement"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Edit Target Blend Times"
-msgstr "Modifier les temps de mélange des cibles"
+msgstr "Modifier les temps de mélange de la cible"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Animation Tools"
@@ -3141,7 +3151,7 @@ msgstr "3 étapes"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Differences Only"
-msgstr "seul les différence"
+msgstr "Différences seules"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Force White Modulate"
@@ -3466,7 +3476,7 @@ msgstr "Officiel"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Testing"
-msgstr "En test"
+msgstr "Tester"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Assets ZIP File"
@@ -3558,11 +3568,11 @@ msgstr "créer un nouveau guide horizontal"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Remove horizontal guide"
-msgstr "Créer un nouveau guide horizontal"
+msgstr "Supprimer le guide horizontal"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Create new horizontal and vertical guides"
-msgstr "Créer des nouveaux guides horizontaux et verticaux"
+msgstr "Créer de nouveaux guides horizontaux et verticaux"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Edit IK Chain"
@@ -3637,7 +3647,7 @@ msgstr "Mode navigation"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Toggles snapping"
-msgstr "Active le magnétisme"
+msgstr "Activer/Désactiver le magnétisme de grille"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Snap"
@@ -3645,7 +3655,7 @@ msgstr "Aligner sur la grille"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snapping options"
-msgstr "Options de magnétisme"
+msgstr "Options du magnétisme"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to grid"
@@ -3657,7 +3667,7 @@ msgstr "Rotation alignée"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Configure Snap..."
-msgstr "Configurer la grille…"
+msgstr "Configurer le magnétisme…"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap Relative"
@@ -3669,7 +3679,7 @@ msgstr "Aligner au pixel près"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Smart snapping"
-msgstr "Alignement intelligent"
+msgstr "Magnétisme intelligent"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to parent"
@@ -3677,15 +3687,15 @@ msgstr "Aimanter au parent"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to node anchor"
-msgstr "Accrocher à l'ancre du noeud"
+msgstr "Accrocher à l'ancre du nœud"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to node sides"
-msgstr "Accrocher aux flancs du noeud"
+msgstr "Accrocher aux flancs du nœud"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to other nodes"
-msgstr "Accrocher aux autres noeuds"
+msgstr "Accrocher aux autres nœuds"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to guides"
@@ -3752,6 +3762,16 @@ msgid "Show Guides"
msgstr "Montrer les guides"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Afficher l'origine"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 vue"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centrer sur la sélection"
@@ -4041,6 +4061,10 @@ msgstr ""
"Le maillage n'a pas de surfaces où des contours pourraient être créées !"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Impossible de créer le contour !"
@@ -4219,7 +4243,7 @@ msgstr "Calcul de la taille de la grille..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Creating heightfield..."
-msgstr "Création de la heightmap…"
+msgstr "Création du champ de hauteur…"
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Marking walkable triangles..."
@@ -4227,7 +4251,7 @@ msgstr "Marquage des triangles parcourables..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Constructing compact heightfield..."
-msgstr "Construction d'une heightmap compacte..."
+msgstr "Construction d'un champ de hauteur compact..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Eroding walkable area..."
@@ -4734,7 +4758,7 @@ msgstr "Lancer"
#: editor/plugins/script_editor_plugin.cpp
msgid "Toggle Scripts Panel"
-msgstr "Basculer vers le panneau de scripts"
+msgstr "Afficher/Cacher la panneau des scripts"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4769,7 +4793,7 @@ msgstr "Garder le débogueur ouvert"
#: editor/plugins/script_editor_plugin.cpp
msgid "Debug with external editor"
-msgstr "Deboguer avec un éditeur externe"
+msgstr "Déboguer avec un éditeur externe"
#: editor/plugins/script_editor_plugin.cpp
msgid "Open Godot online documentation"
@@ -4912,7 +4936,7 @@ msgstr "Convertir indentations en espaces"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Indent To Tabs"
-msgstr "Convertir indentations en espaces"
+msgstr "Convertir les indentations en tabulations"
#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
@@ -4997,7 +5021,7 @@ msgstr "Modifier un opérateur RVB"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
-msgstr "Basculer seulement la rotation"
+msgstr "Basculer en mode rotation seule"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Function"
@@ -5165,7 +5189,7 @@ msgstr "Vertex"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "FPS"
-msgstr "Images par secondes"
+msgstr "IPS"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View."
@@ -5405,7 +5429,7 @@ msgstr "Outil échelle"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Toggle Freelook"
-msgstr "Activer mode vue libre"
+msgstr "Basculer en vue libre"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
@@ -5578,7 +5602,7 @@ msgstr "Insérer vide (après)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Move (Before)"
-msgstr "Déplacer avant"
+msgstr "Déplacer (Avant)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Move (After)"
@@ -5674,7 +5698,7 @@ msgstr "Éditer le thème..."
#: editor/plugins/theme_editor_plugin.cpp
msgid "Theme editing menu."
-msgstr "Menu d'édition des thèmes..."
+msgstr "Menu d'édition des thèmes."
#: editor/plugins/theme_editor_plugin.cpp
msgid "Add Class Items"
@@ -5694,7 +5718,7 @@ msgstr "Créer un nouveau modèle d'éditeur"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create From Current Editor Theme"
-msgstr "Créer à partir du thème éditeur actuel"
+msgstr "Créer à partir du thème actuel de l'éditeur"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio1"
@@ -5717,6 +5741,16 @@ msgid "Checked Item"
msgstr "Item coché"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Ajouter un item"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Item coché"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Possède"
@@ -5877,21 +5911,24 @@ msgid ""
"Select sub-tile to use as icon, this will be also used on invalid autotile "
"bindings."
msgstr ""
+"Sélectionne une ressource à utiliser comme icône, celle-ci sera aussi "
+"utilisée sur les liaisons autotile invalides."
#: editor/plugins/tile_set_editor_plugin.cpp
msgid ""
"LMB: set bit on.\n"
"RMB: set bit off."
msgstr ""
+"Clic gauche : Activer\n"
+"Clic droit : Désactiver"
#: editor/plugins/tile_set_editor_plugin.cpp
-#, fuzzy
msgid "Select current edited sub-tile."
-msgstr "Enregistrer la ressource actuellement modifiée."
+msgstr "Enregistrer la ressource en cours de modification."
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Select sub-tile to change its priority."
-msgstr ""
+msgstr "Sélectionner une sous-case pour changer sa priorité."
#: editor/progress_dialog.cpp scene/gui/dialogs.cpp
msgid "Cancel"
@@ -5899,7 +5936,7 @@ msgstr "Annuler"
#: editor/project_export.cpp
msgid "Runnable"
-msgstr "Activable"
+msgstr "Exécutable"
#: editor/project_export.cpp
msgid "Delete patch '%s' from list?"
@@ -5961,7 +5998,7 @@ msgstr ""
#: editor/project_export.cpp
msgid "Patches"
-msgstr "Patches"
+msgstr "Patchs"
#: editor/project_export.cpp
msgid "Make Patch"
@@ -6004,16 +6041,14 @@ msgid "Please choose a 'project.godot' file."
msgstr "Veuillez choisir un fichier 'project.godot'."
#: editor/project_manager.cpp
-#, fuzzy
msgid "Please choose an empty folder."
-msgstr "Veuillez choisir un fichier 'project.godot'."
+msgstr "Veuillez choisir un dossier vide."
#: editor/project_manager.cpp
msgid "Imported Project"
msgstr "Projet importé"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Couldn't create folder."
msgstr "Impossible de créer le dossier."
@@ -6030,12 +6065,12 @@ msgid "Invalid project path (changed anything?)."
msgstr "Chemin de projet non valide (avez-vous changé quelque chose ?)."
#: editor/project_manager.cpp
-#, fuzzy
msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
msgstr ""
-"Impossible de modifier le fichier project.godot dans le chemin du projet."
+"Impossible de charger le fichier project.godot dans le chemin du projet "
+"(erreur %d). Le fichier est manquant ou corrompu."
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
@@ -6063,27 +6098,24 @@ msgid "Import Existing Project"
msgstr "Importer un projet existant"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Import & Edit"
-msgstr "Importer et ouvrir"
+msgstr "Importer et Modifier"
#: editor/project_manager.cpp
msgid "Create New Project"
msgstr "Créer un nouveau projet"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Create & Edit"
-msgstr "Créer Émetteur"
+msgstr "Créer et ouvrir"
#: editor/project_manager.cpp
msgid "Install Project:"
msgstr "Installer projet :"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Install & Edit"
-msgstr "Installer"
+msgstr "Installer et ouvrir"
#: editor/project_manager.cpp
msgid "Project Name:"
@@ -6219,8 +6251,10 @@ msgid "Mouse Button"
msgstr "Bouton de souris"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Action invalide (tout passe, sauf « / » ou « : »)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6303,9 +6337,8 @@ msgid "Joypad Button Index:"
msgstr "Index de bouton de la manette de jeu :"
#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Erase Input Action"
-msgstr "Effacer l'événement d'action d'entrée"
+msgstr "Effacer l'action d'entrée"
#: editor/project_settings_editor.cpp
msgid "Erase Input Action Event"
@@ -6348,9 +6381,8 @@ msgid "Add Global Property"
msgstr "Ajouter une propriété globale"
#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Select a setting item first!"
-msgstr "Choisissez d'abord un élément de réglage !"
+msgstr "Sélectionnez d'abord un élément à configurer !"
#: editor/project_settings_editor.cpp
msgid "No property '%s' exists."
@@ -6365,10 +6397,6 @@ msgid "Delete Item"
msgstr "Supprimer élément"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Ne peut pas contenir de '/' ou ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Existe déjà"
@@ -6589,9 +6617,8 @@ msgid "On"
msgstr "Activé"
#: editor/property_editor.cpp
-#, fuzzy
msgid "[Empty]"
-msgstr "Ajouter vide"
+msgstr "[Vide]"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
@@ -6685,7 +6712,7 @@ msgstr "Instancier scène(s)"
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on the tree root."
-msgstr "Cette opération ne peut être réalisée sur la racine de l'arbre."
+msgstr "Cette opération ne peut être réalisée sur la racine de l'arborescence."
#: editor/scene_tree_dock.cpp
msgid "Move Node In Parent"
@@ -6760,7 +6787,6 @@ msgid "Error duplicating scene to save it."
msgstr "Erreur de duplication de la scène afin de l'enregistrer."
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Sub-Resources"
msgstr "Ressources secondaires :"
@@ -6907,7 +6933,7 @@ msgstr ""
#: editor/scene_tree_editor.cpp
msgid "Toggle Visibility"
-msgstr "Basculer visibilité"
+msgstr "Basculer la visibilité"
#: editor/scene_tree_editor.cpp
msgid "Invalid node name, the following characters are not allowed:"
@@ -7056,7 +7082,7 @@ msgstr "Fonction :"
#: editor/script_editor_debugger.cpp
msgid "Pick one or more items from the list to display the graph."
msgstr ""
-"Chosissez un ou plusieurs éléments dans la liste pour afficher le graphique."
+"Sélectionnez un ou plusieurs éléments de la liste pour afficher le graphique."
#: editor/script_editor_debugger.cpp modules/mono/editor/mono_bottom_panel.cpp
msgid "Errors"
@@ -7067,9 +7093,8 @@ msgid "Child Process Connected"
msgstr "Processus enfant connecté"
#: editor/script_editor_debugger.cpp
-#, fuzzy
msgid "Copy Error"
-msgstr "Erreurs de chargement"
+msgstr "Erreurs de copie"
#: editor/script_editor_debugger.cpp
msgid "Inspect Previous Instance"
@@ -7224,47 +7249,40 @@ msgid "Select dependencies of the library for this entry"
msgstr "Sélectionnez les dépendances de la librairie pour cette entrée"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "Remove current entry"
-msgstr "Supprimer point de courbe"
+msgstr "Supprimer l’entrée"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "Double click to create a new entry"
msgstr "Double-cliquez pour créer une nouvelle entrée"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "Platform:"
-msgstr "Platform:"
+msgstr "Plateforme :"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "Platform"
-msgstr "Copier vers la plate-forme…"
+msgstr "Plateforme"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "Dynamic Library"
-msgstr "Bibliothèque"
+msgstr "Bibliothèque dynamique"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "Add an architecture entry"
-msgstr "Ajouter une entrée architecturale"
+msgstr "Ajouter une entrée architecture"
#: modules/gdnative/gdnative_library_editor_plugin.cpp
-#, fuzzy
msgid "GDNativeLibrary"
-msgstr "GDNative"
+msgstr "GDNativeLibrary"
#: modules/gdnative/gdnative_library_singleton_editor.cpp
msgid "Library"
msgstr "Bibliothèque"
#: modules/gdnative/gdnative_library_singleton_editor.cpp
-#, fuzzy
msgid "Status"
-msgstr "État :"
+msgstr "État"
#: modules/gdnative/gdnative_library_singleton_editor.cpp
msgid "Libraries: "
@@ -7326,25 +7344,22 @@ msgid "Object can't provide a length."
msgstr "L'objet ne peut fournir une longueur."
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Next Plane"
-msgstr "Onglet suivant"
+msgstr "Plan suivant"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Plane"
-msgstr "Onglet precedent"
+msgstr "Plan précédent"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Plane:"
-msgstr "Onglet :"
+msgstr "Plan :"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Next Floor"
msgstr "Étage suivant"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Floor"
msgstr "Onglet précédent"
@@ -7444,34 +7459,33 @@ msgstr "Paramètres GridMap"
msgid "Pick Distance:"
msgstr "Choisissez distance :"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Generating solution..."
-msgstr "Création des coutours..."
+msgstr "Génération de la solution en cours..."
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating C# project..."
msgstr "Création du projet C# ..."
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Failed to create solution."
-msgstr "Impossible de créer le contour !"
+msgstr "Impossible de créer la solution."
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Failed to save solution."
-msgstr "Impossible de charger la ressource."
+msgstr "Impossible de sauvegarder la solution."
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Done"
msgstr "C'est fait !"
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Failed to create C# project."
-msgstr "Impossible de charger la ressource."
+msgstr "Impossible de créer le projet C#."
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Mono"
@@ -7482,27 +7496,24 @@ msgid "About C# support"
msgstr "À propos du support C#"
#: modules/mono/editor/godotsharp_editor.cpp
-#, fuzzy
msgid "Create C# solution"
-msgstr "Créer le contour"
+msgstr "Créer la solution C#"
#: modules/mono/editor/mono_bottom_panel.cpp
msgid "Builds"
msgstr "Constructions"
#: modules/mono/editor/mono_bottom_panel.cpp
-#, fuzzy
msgid "Build Project"
-msgstr "Projet"
+msgstr "Compiler le projet"
#: modules/mono/editor/mono_bottom_panel.cpp
-#, fuzzy
msgid "Warnings"
-msgstr "Avertissement"
+msgstr "Avertissements"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Fin de la trace d'appel (stack trace) intrinsèque"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7865,34 +7876,28 @@ msgid "Run exported HTML in the system's default browser."
msgstr "Exécutez le HTML exporté dans le navigateur par défaut du système."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:"
-msgstr "Impossible d'écrire le fichier:\n"
+msgstr "Impossible d'écrire le fichier :"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:"
-msgstr "Impossible d'ouvrir le modèle pour exportation:\n"
+msgstr "Impossible d'ouvrir le modèle pour exportation :"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Invalid export template:"
-msgstr "Modèle d'exportation non valide :\n"
+msgstr "Modèle d'exportation non valide :"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read custom HTML shell:"
-msgstr "Impossible de lire le shell HTML :\n"
+msgstr "Impossible de lire le shell HTML personnalisé :"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read boot splash image file:"
-msgstr "Impossible de lire l'image de démarrage :\n"
+msgstr "Impossible de lire l'image de démarrage :"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Using default boot splash image."
-msgstr "Impossible de lire l'image de démarrage :\n"
+msgstr "Impossible de lire l'image de démarrage."
#: scene/2d/animated_sprite.cpp
msgid ""
@@ -7916,6 +7921,9 @@ msgid ""
"Consider adding CollisionShape2D or CollisionPolygon2D children nodes to "
"define its shape."
msgstr ""
+"Ce nœud n'a aucune forme enfant, et ne peut donc interagir avec l'espace.\n"
+"Considérez ajouter un nœud enfant CollisionShape2D ou un CollisionPolygon2D "
+"pour définir sa forme."
#: scene/2d/collision_polygon_2d.cpp
msgid ""
@@ -8066,30 +8074,27 @@ msgstr "ARVROrigin requiert un nœud enfant ARVRCamera"
#: scene/3d/baked_lightmap.cpp
msgid "%d%%"
-msgstr ""
+msgstr "%d%%"
#: scene/3d/baked_lightmap.cpp
msgid "(Time Left: %d:%02d s)"
-msgstr ""
+msgstr "(Temps restant: %d:%02d s)"
#: scene/3d/baked_lightmap.cpp
-#, fuzzy
msgid "Plotting Meshes: "
-msgstr "Tracer les maillages"
+msgstr "Tracer les maillages : "
#: scene/3d/baked_lightmap.cpp
-#, fuzzy
msgid "Plotting Lights:"
-msgstr "Tracer les maillages"
+msgstr "Tracer les lumières :"
#: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp
msgid "Finishing Plot"
msgstr "Finalisation du tracer"
#: scene/3d/baked_lightmap.cpp
-#, fuzzy
msgid "Lighting Meshes: "
-msgstr "Tracer les maillages"
+msgstr "Tracer les maillages : "
#: scene/3d/collision_object.cpp
msgid ""
@@ -8097,6 +8102,9 @@ msgid ""
"Consider adding CollisionShape or CollisionPolygon children nodes to define "
"its shape."
msgstr ""
+"Ce nœud n'a aucune forme enfant, il ne peut donc interagir avec l'espace.\n"
+"Considérez ajouter un nœud enfant CollisionShape ou CollisionPolygon pour "
+"définir sa forme."
#: scene/3d/collision_polygon.cpp
msgid ""
@@ -8169,12 +8177,22 @@ msgstr ""
"La propriété Path doit pointer vers un nœud Spatial valide pour fonctionner."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Seul un WorldEnvironnement ne peut être utilisé par scène (ou ensemble de "
"scènes instanciées)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8188,8 +8206,8 @@ msgid ""
"VehicleWheel serves to provide a wheel system to a VehicleBody. Please use "
"it as a child of a VehicleBody."
msgstr ""
-"VehicleWheel ajoute un système de roues à un VehicleBody. Veuillez "
-"l'utiliser en tant qu'enfant d'un VehicleBody."
+"VehicleWheel permet de fournir un système de roue à un VehicleBody. Merci de "
+"l'utiliser comme enfant d'un VehicleBody."
#: scene/gui/color_picker.cpp
msgid "Raw Mode"
@@ -8209,7 +8227,7 @@ msgstr "Veuillez confirmer…"
#: scene/gui/file_dialog.cpp
msgid "Select this Folder"
-msgstr "Sélectionnez ce dossier"
+msgstr "Sélectionner ce dossier"
#: scene/gui/popup.cpp
msgid ""
@@ -8237,13 +8255,12 @@ msgid "(Other)"
msgstr "(Autre)"
#: scene/main/scene_tree.cpp
-#, fuzzy
msgid ""
"Default Environment as specified in Project Settings (Rendering -> "
"Environment -> Default Environment) could not be loaded."
msgstr ""
"L'environnement par défaut spécifié dans les réglages du projet (Rendu -> "
-"Viewport -> Environnement par défaut) ne peut pas être chargé."
+"Environnement -> Environnement par défaut) ne peut pas être chargé."
#: scene/main/viewport.cpp
msgid ""
@@ -8273,6 +8290,12 @@ msgstr "Erreur lors du chargement de la police."
msgid "Invalid font size."
msgstr "Taille de police invalide."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Action invalide (tout passe, sauf « / » ou « : »)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Ne peut pas contenir de '/' ou ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/he.po b/editor/translations/he.po
index a5f727b8ee..ee0a66cec1 100644
--- a/editor/translations/he.po
+++ b/editor/translations/he.po
@@ -3,6 +3,7 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
+# Daniel <lorddaniel09@gmail.com>, 2018.
# Ben Golan <golanben4@gmail.com>, 2017.
# Luc Stepniewski <lior@gradstein.info>, 2017.
# Yaron Shahrabani <sh.yaron@gmail.com>, 2018.
@@ -10,8 +11,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-22 12:37+0000\n"
-"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
+"PO-Revision-Date: 2018-04-18 16:38+0000\n"
+"Last-Translator: Daniel <lorddaniel09@gmail.com>\n"
"Language-Team: Hebrew <https://hosted.weblate.org/projects/godot-engine/"
"godot/he/>\n"
"Language: he\n"
@@ -19,7 +20,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=4; plural=(n == 1) ? 0 : ((n == 2) ? 1 : ((n > 10 && "
"n % 10 == 0) ? 2 : 3));\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -31,19 +32,19 @@ msgstr "כל הבחירה"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
-msgstr ""
+msgstr "שינוי זמן פריי×-מפתח ×נימציה"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr ""
+msgstr "שינוי ×ž×™×§×•× ×נימציה"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
-msgstr ""
+msgstr "שינוי ×ž×™×§×•× ×נימציה"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Value"
-msgstr ""
+msgstr "שינוי ערך פריי×-מפתח ×נימציה"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
@@ -1373,6 +1374,10 @@ msgstr "מחיקה"
msgid "Clear Output"
msgstr "מחיקת הפלט"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "שגי××” בשמירת המש×ב!"
@@ -3603,6 +3608,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3888,6 +3901,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -4658,7 +4675,7 @@ msgstr "שמירה מחדש"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Debugger"
-msgstr "מנפה שגי×ות"
+msgstr "ניפוי שגי×ות"
#: editor/plugins/script_editor_plugin.cpp
msgid ""
@@ -5391,7 +5408,7 @@ msgstr ""
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animations"
-msgstr "הנפשות"
+msgstr "×נימציות"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Speed (FPS):"
@@ -5554,6 +5571,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -5963,6 +5988,8 @@ msgid ""
"Language changed.\n"
"The UI will update next time the editor or project manager starts."
msgstr ""
+"השפה הוחלפה.\n"
+"מנשק המשתמש יתעדכן ×‘×¤×¢× ×”×‘××” שהעורך ×ו מנהל ×”×ž×™×–×ž×™× ×ž×ª×—×™×œ."
#: editor/project_manager.cpp
msgid ""
@@ -5972,11 +5999,11 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Project Manager"
-msgstr ""
+msgstr "מנהל המיזמי×"
#: editor/project_manager.cpp
msgid "Project List"
-msgstr ""
+msgstr "רשימת המיזמי×"
#: editor/project_manager.cpp
msgid "Scan"
@@ -5984,27 +6011,27 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Select a Folder to Scan"
-msgstr ""
+msgstr "× × ×œ×‘×—×•×¨ תיקייה לסריקה"
#: editor/project_manager.cpp
msgid "New Project"
-msgstr ""
+msgstr "×ž×™×–× ×—×“×©"
#: editor/project_manager.cpp
msgid "Templates"
-msgstr ""
+msgstr "תבניות"
#: editor/project_manager.cpp
msgid "Exit"
-msgstr ""
+msgstr "יצי××”"
#: editor/project_manager.cpp
msgid "Restart Now"
-msgstr ""
+msgstr "להפעיל מחדש כעת"
#: editor/project_manager.cpp
msgid "Can't run project"
-msgstr ""
+msgstr "×œ× × ×™×ª×Ÿ להריץ מיז×"
#: editor/project_manager.cpp
msgid ""
@@ -6014,7 +6041,7 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Key "
-msgstr ""
+msgstr "מקש "
#: editor/project_settings_editor.cpp
msgid "Joy Button"
@@ -6026,15 +6053,17 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Mouse Button"
-msgstr ""
+msgstr "כפתור עכבר"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
-msgstr ""
+msgstr "הפעולה ‚%s’ כבר קיימת!"
#: editor/project_settings_editor.cpp
msgid "Rename Input Action Event"
@@ -6058,47 +6087,47 @@ msgstr ""
#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
msgid "Press a Key.."
-msgstr ""
+msgstr "× × ×œ×œ×—×•×¥ על מקש…"
#: editor/project_settings_editor.cpp
msgid "Mouse Button Index:"
-msgstr ""
+msgstr "מפתח כפתורי עכבר:"
#: editor/project_settings_editor.cpp
msgid "Left Button"
-msgstr ""
+msgstr "כפתור שמ×לי"
#: editor/project_settings_editor.cpp
msgid "Right Button"
-msgstr ""
+msgstr "כפתור ימני"
#: editor/project_settings_editor.cpp
msgid "Middle Button"
-msgstr ""
+msgstr "כפתור ×מצעי"
#: editor/project_settings_editor.cpp
msgid "Wheel Up Button"
-msgstr ""
+msgstr "כפתור גלגלת למעלה"
#: editor/project_settings_editor.cpp
msgid "Wheel Down Button"
-msgstr ""
+msgstr "כפתור גלגלת למטה"
#: editor/project_settings_editor.cpp
msgid "Button 6"
-msgstr ""
+msgstr "כפתור 6"
#: editor/project_settings_editor.cpp
msgid "Button 7"
-msgstr ""
+msgstr "כפתור 7"
#: editor/project_settings_editor.cpp
msgid "Button 8"
-msgstr ""
+msgstr "כפתור 8"
#: editor/project_settings_editor.cpp
msgid "Button 9"
-msgstr ""
+msgstr "כפתור 9"
#: editor/project_settings_editor.cpp
msgid "Joypad Axis Index:"
@@ -6122,47 +6151,47 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Add Event"
-msgstr ""
+msgstr "הוספת ×ירוע"
#: editor/project_settings_editor.cpp
msgid "Device"
-msgstr ""
+msgstr "התקן"
#: editor/project_settings_editor.cpp
msgid "Button"
-msgstr ""
+msgstr "כפתור"
#: editor/project_settings_editor.cpp
msgid "Left Button."
-msgstr ""
+msgstr "כפתור שמ×לי."
#: editor/project_settings_editor.cpp
msgid "Right Button."
-msgstr ""
+msgstr "כפתור ימני."
#: editor/project_settings_editor.cpp
msgid "Middle Button."
-msgstr ""
+msgstr "כפתור ×מצעי."
#: editor/project_settings_editor.cpp
msgid "Wheel Up."
-msgstr ""
+msgstr "גלגלת למעלה."
#: editor/project_settings_editor.cpp
msgid "Wheel Down."
-msgstr ""
+msgstr "גלגלת למטה."
#: editor/project_settings_editor.cpp
msgid "Add Global Property"
-msgstr ""
+msgstr "הוספת מ×פיין גלובלי"
#: editor/project_settings_editor.cpp
msgid "Select a setting item first!"
-msgstr ""
+msgstr "יש לבחור פריט הגדרה ×§×•×“× ×›×œ!"
#: editor/project_settings_editor.cpp
msgid "No property '%s' exists."
-msgstr ""
+msgstr "×œ× ×§×™×™× ×ž×פיין ‚%s’."
#: editor/project_settings_editor.cpp
msgid "Setting '%s' is internal, and it can't be deleted."
@@ -6170,11 +6199,7 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Delete Item"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
+msgstr "מחיקת פריט"
#: editor/project_settings_editor.cpp
msgid "Already existing"
@@ -7100,14 +7125,12 @@ msgid "Object can't provide a length."
msgstr ""
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Next Plane"
-msgstr "הלשונית הב××”"
+msgstr "המישור הב×"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Plane"
-msgstr "הלשונית הקודמת"
+msgstr "המישור הקוד×"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Plane:"
@@ -7217,6 +7240,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr "בחירת מרחק:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "הפתרון נוצר…"
@@ -7665,7 +7692,7 @@ msgstr ""
#: scene/2d/collision_polygon_2d.cpp
msgid "An empty CollisionPolygon2D has no effect on collision."
-msgstr ""
+msgstr "ל־CollisionPolygon2D ריק ×ין השפעה על התנגשות."
#: scene/2d/collision_shape_2d.cpp
msgid ""
@@ -7774,7 +7801,7 @@ msgstr ""
#: scene/3d/baked_lightmap.cpp
msgid "(Time Left: %d:%02d s)"
-msgstr ""
+msgstr "(זמן שנותר: %d:%02d שנ׳)"
#: scene/3d/baked_lightmap.cpp
msgid "Plotting Meshes: "
@@ -7854,10 +7881,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -7872,11 +7909,11 @@ msgstr ""
#: scene/gui/color_picker.cpp
msgid "Raw Mode"
-msgstr ""
+msgstr "מצב גולמי"
#: scene/gui/color_picker.cpp
msgid "Add current color as a preset"
-msgstr ""
+msgstr "הוספת הצבע הנוכחי כערכה"
#: scene/gui/dialogs.cpp
msgid "Alert!"
@@ -7884,11 +7921,11 @@ msgstr ""
#: scene/gui/dialogs.cpp
msgid "Please Confirm..."
-msgstr ""
+msgstr "× × ×œ×מת…"
#: scene/gui/file_dialog.cpp
msgid "Select this Folder"
-msgstr ""
+msgstr "בחירת התיקייה"
#: scene/gui/popup.cpp
msgid ""
@@ -7906,7 +7943,7 @@ msgstr ""
#: scene/gui/tree.cpp
msgid "(Other)"
-msgstr ""
+msgstr "(×חר)"
#: scene/main/scene_tree.cpp
msgid ""
diff --git a/editor/translations/hi.po b/editor/translations/hi.po
index cba5b3059b..e017935860 100644
--- a/editor/translations/hi.po
+++ b/editor/translations/hi.po
@@ -1412,6 +1412,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3639,6 +3643,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3924,6 +3936,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5586,6 +5602,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6063,7 +6087,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6207,10 +6233,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7250,6 +7272,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7887,10 +7913,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/hu.po b/editor/translations/hu.po
index 3b728caafc..b6151574e9 100644
--- a/editor/translations/hu.po
+++ b/editor/translations/hu.po
@@ -4,14 +4,14 @@
# This file is distributed under the same license as the Godot source code.
#
# Nagy Lajos <neutron9707@gmail.com>, 2017.
-# Sandor Domokos <sandor.domokos@gmail.com>, 2017.
+# Sandor Domokos <sandor.domokos@gmail.com>, 2017-2018.
# Varga Dániel <danikah.danikah@gmail.com>, 2016-2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-24 12:37+0000\n"
-"Last-Translator: Varga Dániel <danikah.danikah@gmail.com>\n"
+"PO-Revision-Date: 2018-04-03 06:36+0000\n"
+"Last-Translator: Sandor Domokos <sandor.domokos@gmail.com>\n"
"Language-Team: Hungarian <https://hosted.weblate.org/projects/godot-engine/"
"godot/hu/>\n"
"Language: hu\n"
@@ -26,47 +26,47 @@ msgstr "Tiltva"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr "Minden Kiválasztás"
+msgstr "Minden kiválasztás"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
-msgstr "Animáció Kulcsképkocka Idő Változtatása"
+msgstr "Animáció kulcsképkocka idő változtatás"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr "Animáció Ãtmenet Váltás"
+msgstr "Animáció átmenet változtatás"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
-msgstr "Animáció Transzformáció Váltás"
+msgstr "Animáció transzformáció változtatás"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Value"
-msgstr "Animáció Kulcsképkocka Érték"
+msgstr "Animáció kulcsképkocka érték változtatás"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
-msgstr "Animáció Hívás Váltás"
+msgstr "Animáció hívás változtatás"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr "Animáció Nyomvonal Hozzáadása"
+msgstr "Animáció nyomvonal hozzáadás"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr "Animáció Kulcs Megkettőzése"
+msgstr "Animáció kulcsok megkettőzése"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr "Animáció Nyomvonal Felfelé Mozgatása"
+msgstr "Animáció nyomvonal felfelé mozgatás"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr "Animáció Nyomvonal Lefelé Mozgatása"
+msgstr "Animáció nyomvonal lefelé mozgatás"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr "Animáció Nyomvonal Eltávolítása"
+msgstr "Animáció nyomvonal eltávolítás"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
@@ -74,44 +74,44 @@ msgstr "Ãtmenet beállítása erre:"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr "Animáció Nyomvonal Ãtnevezése"
+msgstr "Animáció nyomvonal átnevezés"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr "Animáció Nyomvonal Interpoláció Változtatása"
+msgstr "Animáció nyomvonal interpoláció változtatás"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr "Animáció Nyomvonal Érték Mód Változtatása"
+msgstr "Animáció nyomvonal érték mód változtatás"
#: editor/animation_editor.cpp
msgid "Anim Track Change Wrap Mode"
-msgstr "Animáció Nyomvonal Takarási Mód Változtatása"
+msgstr "Animáció nyomvonal takarási mód változtatás"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr "Node Görbe Szerkesztése"
+msgstr "Node görbe szerkesztés"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr "Kiválasztás Görbe Szerkesztése"
+msgstr "Kiválasztás görbe szerkesztés"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr "Animáció Kulcs Törlése"
+msgstr "Animáció kulcs törlés"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr "Kiválasztás Megkettőzése"
+msgstr "Kiválasztás megkettőzés"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr "Ãthelyezettek MegkettÅ‘zése"
+msgstr "Ãthelyezettek megkettÅ‘zés"
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr "Kiválasztás Eltávolítása"
+msgstr "Kiválasztás eltávolítás"
#: editor/animation_editor.cpp
msgid "Continuous"
@@ -127,27 +127,27 @@ msgstr "Érzékelő"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr "Animáció Kulcs Hozzáadása"
+msgstr "Animáció kulcs hozzáadás"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr "Animáció Kulcs Mozgatása"
+msgstr "Animáció kulcs mozgatás"
#: editor/animation_editor.cpp
msgid "Scale Selection"
-msgstr "Kiválasztás Ãtméretezése"
+msgstr "Kiválasztás átméretezés"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr "Ãtméretezés A Kurzortól"
+msgstr "Ãtméretezés a kurzortól"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
-msgstr "Ugrás A Következő Lépésre"
+msgstr "Ugrás a következő lépésre"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
-msgstr "Ugrás Az Előző Lépésre"
+msgstr "Ugrás az előző lépésre"
#: editor/animation_editor.cpp editor/plugins/curve_editor_plugin.cpp
#: editor/property_editor.cpp
@@ -180,11 +180,11 @@ msgstr "Ãtmenetek"
#: editor/animation_editor.cpp
msgid "Optimize Animation"
-msgstr "Animáció Optimalizálása"
+msgstr "Animáció optimalizálás"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation"
-msgstr "Animáció Megtisztítása"
+msgstr "Animáció megtisztítás"
#: editor/animation_editor.cpp
msgid "Create NEW track for %s and insert key?"
@@ -204,39 +204,39 @@ msgstr "Létrehozás"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
-msgstr "Animáció Létrehozása És Beillesztése"
+msgstr "Animáció létrehozás és beillesztés"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
-msgstr "Animáció Nyomvonal És Kulcs Beillesztése"
+msgstr "Animáció nyomvonal és kulcs beillesztés"
#: editor/animation_editor.cpp
msgid "Anim Insert Key"
-msgstr "Animáció Kulcs Beillesztése"
+msgstr "Animáció kulcs beillesztés"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr "Animáció Hossz Változtatása"
+msgstr "Animáció hossz változtatás"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr "Animáció Loop Megváltoztatása"
+msgstr "Animáció hurok változtatás"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
-msgstr "Animáció Típusos Érték Kulcs Létrehozása"
+msgstr "Animáció típusos érték kulcs létrehozás"
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr "Animáció Beilleszt"
+msgstr "Animáció beillesztés"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
-msgstr "Animáció Kulcsok Nyújtása"
+msgstr "Animáció kulcsok nyújtás"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr "Animáció Hívási Nyomvonal Hozzáadása"
+msgstr "Animáció hívási nyomvonal hozzáadás"
#: editor/animation_editor.cpp
msgid "Animation zoom."
@@ -326,7 +326,7 @@ msgstr "Méretezési arány:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr "Melyik Node-ban Hívjon Funkciókat?"
+msgstr "Melyik Node-ban hívjon funkciókat?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
@@ -566,8 +566,8 @@ msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
msgstr ""
-"'%s' Jelenet éppen szerkesztés alatt ál.\n"
-"A változások nem lépnek érvénybe, ha csak újra nem tölti a jelenetet."
+"'%s' Scene éppen szerkesztés alatt áll.\n"
+"A változások újratöltés után lépnek érvénybe."
#: editor/dependency_editor.cpp
msgid ""
@@ -1045,7 +1045,7 @@ msgstr "Útvonal:"
#: editor/editor_autoload_settings.cpp
msgid "Node Name:"
-msgstr "Node Neve:"
+msgstr "Node neve:"
#: editor/editor_autoload_settings.cpp editor/editor_profiler.cpp
#: editor/project_manager.cpp editor/settings_config_dialog.cpp
@@ -1058,7 +1058,7 @@ msgstr "Egyke"
#: editor/editor_data.cpp
msgid "Updating Scene"
-msgstr "Jelenet Frissítése"
+msgstr "Scene Frissítése"
#: editor/editor_data.cpp
msgid "Storing local changes.."
@@ -1066,7 +1066,7 @@ msgstr "Helyi módosítások eltárolása.."
#: editor/editor_data.cpp
msgid "Updating scene.."
-msgstr "Jelenet frissítése.."
+msgstr "Scene frissítése.."
#: editor/editor_data.cpp
msgid "[empty]"
@@ -1394,6 +1394,10 @@ msgstr "Töröl"
msgid "Clear Output"
msgstr "Kimenet Törlése"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Hiba történt az erőforrás mentésekor!"
@@ -1441,7 +1445,7 @@ msgstr "Hiba történt '%s' betöltése közben."
#: editor/editor_node.cpp
msgid "Saving Scene"
-msgstr "Jelenet Mentése"
+msgstr "Scene mentése"
#: editor/editor_node.cpp
msgid "Analyzing"
@@ -1460,8 +1464,8 @@ msgid ""
"Couldn't save scene. Likely dependencies (instances or inheritance) couldn't "
"be satisfied."
msgstr ""
-"Nem sikerült a jelenet mentése. Valószínű, hogy a függőségei (példányok vagy "
-"öröklések) nem voltak kielégíthetők."
+"Nem sikerült a Scene mentése. Valószínű, hogy a függőségei (példányok vagy "
+"öröklések) nem voltak megfelelőek."
#: editor/editor_node.cpp
msgid "Failed to load resource."
@@ -1516,10 +1520,9 @@ msgid ""
"This resource belongs to a scene that was instanced or inherited.\n"
"Changes to it will not be kept when saving the current scene."
msgstr ""
-"Ez az erőforrás egy olyan jelenethez tartozik, amit példányosítottak, vagy "
-"amit örökölt a jelenet.\n"
-"A rajta végzett módosítások nem lesznek megtartva a jelenlegi jelenet "
-"elmentésekor."
+"Ez az erőforrás egy olyan Scene-hez tartozik amit példányosítottak vagy "
+"örökölt.\n"
+"A módosítások nem lesznek megtartva a jelenlegi Scene mentésekor."
#: editor/editor_node.cpp
msgid ""
@@ -1591,7 +1594,7 @@ msgstr "Megnyitás Súgóban"
#: editor/editor_node.cpp
msgid "There is no defined scene to run."
-msgstr "Nincs meghatározva jelenet a futtatáshoz."
+msgstr "Nincs meghatározva Scene a futtatáshoz."
#: editor/editor_node.cpp
msgid ""
@@ -1609,8 +1612,7 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"A kiválasztott '%s' jelenet nem létezik, kiválaszt most egy érvényes "
-"jelenetet?\n"
+"A kiválasztott '%s' Scene nem létezik, kiválaszt most egy érvényeset?\n"
"Ezt megváltoztathatja később a \"Projekt Beállításokban\" az \"Alkalmazás\" "
"kategóriában."
@@ -1620,15 +1622,15 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"A kiválasztott '%s' jelenet nem egy jelenetfájl, kiválaszt most egy érvényes "
-"jelenetet?\n"
+"A kiválasztott '%s' Scene nem egy Scene fájl, kiválaszt most egy "
+"érvényeset?\n"
"Ezt megváltoztathatja később a \"Projekt Beállításokban\" az \"Alkalmazás\" "
"kategóriában."
#: editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
msgstr ""
-"A jelenlegi jelenet soha nem volt még mentve, mentse el a futtatás előtt."
+"A jelenlegi Scene soha nem volt még mentve, mentse el a futtatás előtt."
#: editor/editor_node.cpp
msgid "Could not start subprocess!"
@@ -1636,19 +1638,19 @@ msgstr "Az alprocesszt nem lehetett elindítani!"
#: editor/editor_node.cpp
msgid "Open Scene"
-msgstr "Jelenet Megnyitása"
+msgstr "Scene megnyitás"
#: editor/editor_node.cpp
msgid "Open Base Scene"
-msgstr "Alap Jelenet Megnyitása"
+msgstr "Alap Scene megnyitás"
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
-msgstr "Jelenet Gyors Megnyitása.."
+msgstr "Scene gyors megnyitás"
#: editor/editor_node.cpp
msgid "Quick Open Script.."
-msgstr "Szkript Gyors Megnyitása.."
+msgstr "Szkript gyors megnyitás"
#: editor/editor_node.cpp
msgid "Save & Close"
@@ -1660,7 +1662,7 @@ msgstr "Bezárás előtt menti a '%s'-n végzett módosításokat?"
#: editor/editor_node.cpp
msgid "Save Scene As.."
-msgstr "Jelenet Mentése Másként.."
+msgstr "Scene mentés másként"
#: editor/editor_node.cpp
msgid "No"
@@ -1672,27 +1674,27 @@ msgstr "Igen"
#: editor/editor_node.cpp
msgid "This scene has never been saved. Save before running?"
-msgstr "Ez a jelenet soha nem volt mentve. Menti futtatás előtt?"
+msgstr "Ez a Scene még soha nem volt mentve. Menti futtatás előtt?"
#: editor/editor_node.cpp editor/scene_tree_dock.cpp
msgid "This operation can't be done without a scene."
-msgstr "Ezt a műveletet nem lehet végrehajtani jelenet nélkül."
+msgstr "Ezt a műveletet nem lehet végrehajtani egy Scene nélkül."
#: editor/editor_node.cpp
msgid "Export Mesh Library"
-msgstr "Mesh Könyvtár Exportálása"
+msgstr "Mesh könyvtár exportálás"
#: editor/editor_node.cpp
msgid "This operation can't be done without a root node."
-msgstr "Ezt a műveletet nem lehet végrehajtani gyökér node nélkül."
+msgstr "Ezt a műveletet nem lehet végrehajtani gyökér Node nélkül."
#: editor/editor_node.cpp
msgid "Export Tile Set"
-msgstr "Tile Set Exportálása"
+msgstr "Tile Set exportálás"
#: editor/editor_node.cpp
msgid "This operation can't be done without a selected node."
-msgstr "Ezt a műveletet nem lehet végrehajtani egy kiválaszott node nélkül."
+msgstr "Ezt a műveletet nem lehet végrehajtani egy kiválaszott Node nélkül."
#: editor/editor_node.cpp
msgid "Current scene not saved. Open anyway?"
@@ -1712,7 +1714,7 @@ msgstr "Ez a művelet nem vonható vissza. Visszaállítja mindenképp?"
#: editor/editor_node.cpp
msgid "Quick Run Scene.."
-msgstr "Jelenet Gyors Futtatása.."
+msgstr "Scene gyors futtatás"
#: editor/editor_node.cpp
msgid "Quit"
@@ -1732,13 +1734,12 @@ msgstr "Mentés és Kilépés"
#: editor/editor_node.cpp
msgid "Save changes to the following scene(s) before quitting?"
-msgstr ""
-"Elmenti a következő jelenet(ek)en végzett változtatásokat kilépés előtt?"
+msgstr "Elmenti a következő Scene(ek)en végzett változtatásokat kilépés előtt?"
#: editor/editor_node.cpp
msgid "Save changes the following scene(s) before opening Project Manager?"
msgstr ""
-"Elmenti a következő jelenet(ek)en végzett változtatásokat a Projektkezelő "
+"Elmenti a következő Scene(ek)en végzett változtatásokat a Projektkezelő "
"megnyitása előtt?"
#: editor/editor_node.cpp
@@ -1787,9 +1788,8 @@ msgid ""
"Scene '%s' was automatically imported, so it can't be modified.\n"
"To make changes to it, a new inherited scene can be created."
msgstr ""
-"A(z) '%s' jelenet automatikusan be lett importálva, ezért nem módosítható.\n"
-"Ahhoz, hogy változtatásokat végezhessen rajta, egy új, azt öröklő jelenetet "
-"hozhat létre."
+"A(z) '%s' Scene automatikusan be lett importálva, ezért nem módosítható.\n"
+"Változtatások végzéséhez egy új öröklött Scene-t hozhat létre."
#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
@@ -1801,9 +1801,9 @@ msgid ""
"Error loading scene, it must be inside the project path. Use 'Import' to "
"open the scene, then save it inside the project path."
msgstr ""
-"Hiba történt a jelenet betöltésekor, benne kell, hogy legyen a projekt "
-"útvonalában. Használja az 'import' lehetőséget a jelenet megnyitására, majd "
-"mentse el a projekt útvonalán belülre."
+"Hiba történt a Scene betöltésekor, benne kell lennnie a projekt útvonalában. "
+"Használja az 'import' lehetőséget a Scene megnyitására, majd mentse el a "
+"projekt útvonalán belülre."
#: editor/editor_node.cpp
msgid "Scene '%s' has broken dependencies:"
@@ -1828,7 +1828,7 @@ msgstr "Alapértelmezett"
#: editor/editor_node.cpp
msgid "Switch Scene Tab"
-msgstr "Jelenet Fül Váltása"
+msgstr "Scene fül váltás"
#: editor/editor_node.cpp
msgid "%d more files or folders"
@@ -1860,7 +1860,7 @@ msgstr "Hozzáad egy új jelenetet."
#: editor/editor_node.cpp
msgid "Scene"
-msgstr "Jelenet"
+msgstr "Scene"
#: editor/editor_node.cpp
msgid "Go to previously opened scene."
@@ -1880,31 +1880,31 @@ msgstr "Fájlok Szűrése.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
-msgstr "Műveletek a jelenet fájlokkal."
+msgstr "Műveletek Scene fájlokkal."
#: editor/editor_node.cpp
msgid "New Scene"
-msgstr "Új Jelenet"
+msgstr "Új Scene"
#: editor/editor_node.cpp
msgid "New Inherited Scene.."
-msgstr "Új Örökölt Jelenet.."
+msgstr "Új örökölt Scene"
#: editor/editor_node.cpp
msgid "Open Scene.."
-msgstr "Jelenet Megnyitása.."
+msgstr "Scene megnyitása"
#: editor/editor_node.cpp
msgid "Save Scene"
-msgstr "Jelenet Mentése"
+msgstr "Scene mentés"
#: editor/editor_node.cpp
msgid "Save all Scenes"
-msgstr "Minden Jelenet Mentése"
+msgstr "Minden Scene mentés"
#: editor/editor_node.cpp
msgid "Close Scene"
-msgstr "Jelenet Bezárása"
+msgstr "Scene bezárás"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
@@ -1934,11 +1934,11 @@ msgstr "Mégis"
#: editor/editor_node.cpp
msgid "Revert Scene"
-msgstr "Jelenet Visszaállítása"
+msgstr "Scene visszaállítás"
#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
-msgstr "Egyéb projekt- vagy jelenet-szintű eszközök."
+msgstr "Egyéb projekt- vagy Scene-szintű eszközök."
#: editor/editor_node.cpp
msgid "Project"
@@ -2009,7 +2009,7 @@ msgid ""
"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
"running game if this option is turned on."
msgstr ""
-"Az ütközési alakzatok és a fénysugárkövető node-ok (mind 2D-hez és 3D-hez) "
+"Az ütközési alakzatok és a fénysugárkövető Node-ok (mind 2D-hez és 3D-hez) "
"láthatóak lesznek a játék futásakor, ha ez az opció be van kapcsolva."
#: editor/editor_node.cpp
@@ -2026,7 +2026,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Scene Changes"
-msgstr "Jelenet Változtatások Szinkronizálása"
+msgstr "Scene változtatások szinkronizálás"
#: editor/editor_node.cpp
msgid ""
@@ -2125,7 +2125,7 @@ msgstr "Szünetelteti a jelenetet"
#: editor/editor_node.cpp
msgid "Pause Scene"
-msgstr "Jelenet Szüneteltetése"
+msgstr "Scene szüneteltetés"
#: editor/editor_node.cpp
msgid "Stop the scene."
@@ -2137,19 +2137,19 @@ msgstr "Leállítás"
#: editor/editor_node.cpp
msgid "Play the edited scene."
-msgstr "Szerkesztett jelenet futtatása."
+msgstr "Szerkesztett Scene futtatása."
#: editor/editor_node.cpp
msgid "Play Scene"
-msgstr "Jelenet Futtatása"
+msgstr "Scene futtatás"
#: editor/editor_node.cpp
msgid "Play custom scene"
-msgstr "Tetszőleges jelenet futtatása"
+msgstr "Tetszőleges Scene futtatás"
#: editor/editor_node.cpp
msgid "Play Custom Scene"
-msgstr "Tetszőleges Jelenet Futtatása"
+msgstr "Tetszőleges Scene futtatás"
#: editor/editor_node.cpp
msgid "Spins when the editor window repaints!"
@@ -2387,7 +2387,7 @@ msgstr "Ãrja a logikát a _run() metódusba."
#: editor/editor_run_script.cpp
msgid "There is an edited scene already."
-msgstr "Már létezik szerkesztett jelenet."
+msgstr "Már létezik a szerkesztett Scene."
#: editor/editor_run_script.cpp
msgid "Couldn't instance script:"
@@ -2411,11 +2411,11 @@ msgstr "Alapértelmezett (Ugyanaz, Mint a Szerkesztőnek)"
#: editor/editor_sub_scene.cpp
msgid "Select Node(s) to Import"
-msgstr "Válassza Ki Az Importálandó Node-okat"
+msgstr "Válassza ki az importálandó Node-okat"
#: editor/editor_sub_scene.cpp
msgid "Scene Path:"
-msgstr "Jelenet Elérési Útja:"
+msgstr "Scene elérési Út:"
#: editor/editor_sub_scene.cpp
msgid "Import From Node:"
@@ -2699,7 +2699,7 @@ msgstr "Ãthelyezés.."
#: editor/filesystem_dock.cpp
msgid "Open Scene(s)"
-msgstr "Jelenet(ek) Megnyitása"
+msgstr "Scene(k) megnyitás"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2735,8 +2735,7 @@ msgstr "Mappa Kedvencnek jelölése / Kedvenc jelölés visszavonása"
#: editor/filesystem_dock.cpp
msgid "Instance the selected scene(s) as child of the selected node."
-msgstr ""
-"Kiválasztott jelenet(ek) példányosítása a kiválasztott Node gyermekeként."
+msgstr "Kiválasztott Scene(k) példányosítása a kiválasztott Node gyermekeként."
#: editor/filesystem_dock.cpp
msgid ""
@@ -2806,11 +2805,11 @@ msgstr "Importálás Több Jelentként és Anyagokként"
#: editor/import/resource_importer_scene.cpp
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Import Scene"
-msgstr "Jelenet Importálása"
+msgstr "Scene importálás"
#: editor/import/resource_importer_scene.cpp
msgid "Importing Scene.."
-msgstr "Jelenet Importálása.."
+msgstr "Scene importálás"
#: editor/import/resource_importer_scene.cpp
msgid "Generating Lightmaps"
@@ -3242,7 +3241,7 @@ msgstr "Az animációs fa érvénytelen."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation Node"
-msgstr "Animációs Node"
+msgstr "Animáció Node"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "OneShot Node"
@@ -3266,7 +3265,7 @@ msgstr "Keverés4 Node"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeScale Node"
-msgstr "IdőSkála Node"
+msgstr "Időskála Node"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeSeek Node"
@@ -3282,7 +3281,7 @@ msgstr "Animációk Importálása.."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Edit Node Filters"
-msgstr "Node Szűrők Módosítása"
+msgstr "Node szűrők szerkesztés"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Filters.."
@@ -3290,7 +3289,7 @@ msgstr "Szűrők.."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "AnimationTree"
-msgstr "AnimationTree"
+msgstr "AnimációFa"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Free"
@@ -3643,15 +3642,15 @@ msgstr "Illesztés szülőhöz"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to node anchor"
-msgstr "Illesztés node horgonyhoz"
+msgstr "Illesztés Node horgonyhoz"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to node sides"
-msgstr "Illesztés node oldalakhoz"
+msgstr "Illesztés Node oldalakhoz"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to other nodes"
-msgstr "Illesztés más node-okhoz"
+msgstr "Illesztés más Node-okhoz"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to guides"
@@ -3718,6 +3717,16 @@ msgid "Show Guides"
msgstr "Vezetővonalak Megjelenítése"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Rács Megjelenítése"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "Segítők Megjelenítése"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Kijelölés Középre"
@@ -3779,17 +3788,17 @@ msgstr "Rendben"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Cannot instantiate multiple nodes without root."
-msgstr "Nem lehet több node-ot példányosítani gyökér nélkül."
+msgstr "Nem lehet több Node-ot példányosítani gyökér nélkül."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Create Node"
-msgstr "Node Létrehozása"
+msgstr "Node létrehozás"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Error instancing scene from %s"
-msgstr "Hiba történt a jelenet példányosításkor %s-ből"
+msgstr "Hiba történt a Scene példányosításkor %s-ből"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Change default type"
@@ -3927,8 +3936,8 @@ msgid ""
"No OccluderPolygon2D resource on this node.\n"
"Create and assign one?"
msgstr ""
-"Nincs OccluderPolygon2D erőforrás ezen a node-on.\n"
-"Létrehoz egyet és hozzárendeli a node-hoz?"
+"Nincs OccluderPolygon2D erőforrás ezen a Node-on.\n"
+"Létrehoz egyet és hozzárendeli a Node-hoz?"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
msgid "Create Occluder Polygon"
@@ -3968,7 +3977,7 @@ msgstr "Statikus Konvex Test Létrehozása"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "This doesn't work on scene root!"
-msgstr "Ez nem hajtható végre a jelenet gyökerén!"
+msgstr "Ez nem hajtható végre a gyökér Scene-en!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Shape"
@@ -4008,6 +4017,10 @@ msgstr ""
"A Mesh-nek nincsenek felszínei, ami alapján körvonalakat lehetni készíteni!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Körvonalkészítés sikertelen!"
@@ -4313,7 +4326,7 @@ msgstr "Kibocsátási Pontok Létrehozása A Mesh Alapján"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Node"
-msgstr "Kibocsátási Pontok Létrehozása A Node Alapján"
+msgstr "Kibocsátási pontok létrehozása a Node alapján"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emitter"
@@ -4572,7 +4585,7 @@ msgstr "Beillesztés"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "ResourcePreloader"
-msgstr "ResourcePreloader"
+msgstr "ForrásElőtöltö"
#: editor/plugins/script_editor_plugin.cpp
msgid "Clear Recent Files"
@@ -4785,8 +4798,8 @@ msgstr "Hibakereső"
msgid ""
"Built-in scripts can only be edited when the scene they belong to is loaded"
msgstr ""
-"A beépített szkriptek csak akkor szerkeszthetőek, amikor az a jelenet, "
-"amihez tartoznak, éppen be van töltve"
+"A beépített szkriptek csak akkor szerkeszthetőek, amikor az a Scene amihez "
+"tartoznak éppen be van töltve"
#: editor/plugins/script_text_editor.cpp
msgid "Only resources from filesystem can be dropped."
@@ -4927,27 +4940,27 @@ msgstr "Kontextusérzékeny Súgó"
#: editor/plugins/shader_editor_plugin.cpp
msgid "Shader"
-msgstr "Shader"
+msgstr "Ãrnyaló"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
-msgstr ""
+msgstr "Skaláris állandó változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Constant"
-msgstr ""
+msgstr "Vec állandó változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Constant"
-msgstr ""
+msgstr "RGB állandó változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Operator"
-msgstr ""
+msgstr "Skaláris kezelő változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Operator"
-msgstr ""
+msgstr "Vec kezelő változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Scalar Operator"
@@ -4955,7 +4968,7 @@ msgstr ""
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Operator"
-msgstr ""
+msgstr "RGB kezelő változtatás"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
@@ -5674,6 +5687,15 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Elem Hozzáadása"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6149,7 +6171,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6293,10 +6317,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7336,6 +7356,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7978,10 +8002,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/id.po b/editor/translations/id.po
index df10490482..21d333009f 100644
--- a/editor/translations/id.po
+++ b/editor/translations/id.po
@@ -11,21 +11,22 @@
# Khairul Hidayat <khairulcyber4rt@gmail.com>, 2016.
# Romi Kusuma Bakti <romikusumab@gmail.com>, 2017.
# Sofyan Sugianto <sofyanartem@gmail.com>, 2017-2018.
+# Tito <ijavadroid@gmail.com>, 2018.
# Tom My <tom.asadinawan@gmail.com>, 2017.
# yursan9 <rizal.sagi@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-03-02 01:38+0000\n"
-"Last-Translator: Sofyan Sugianto <sofyanartem@gmail.com>\n"
+"PO-Revision-Date: 2018-04-18 16:38+0000\n"
+"Last-Translator: Tito <ijavadroid@gmail.com>\n"
"Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/"
"godot/id/>\n"
"Language: id\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -1089,9 +1090,8 @@ msgid "[unsaved]"
msgstr "[belum disimpan]"
#: editor/editor_dir_dialog.cpp
-#, fuzzy
msgid "Please select a base directory first"
-msgstr "Pilih direktori kerja terlebih dahulu"
+msgstr "Slahkan pilih direktori kerja terlebih dahulu"
#: editor/editor_dir_dialog.cpp
msgid "Choose a Directory"
@@ -1409,6 +1409,10 @@ msgstr "Bersihkan"
msgid "Clear Output"
msgstr "Bersihkan Luaran"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Error menyimpan resource!"
@@ -3159,7 +3163,7 @@ msgstr ""
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Next (Auto Queue):"
-msgstr ""
+msgstr "Selanjutnya (Antrian Otomatis):"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Cross-Animation Blend Times"
@@ -3182,7 +3186,7 @@ msgstr "Sunting Filter"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Scale:"
-msgstr ""
+msgstr "Skala:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Fade In (s):"
@@ -3202,11 +3206,11 @@ msgstr ""
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Auto Restart:"
-msgstr ""
+msgstr "Mulai Ulang Otomatis:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Restart (s):"
-msgstr ""
+msgstr "Mulai Ulang:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Random Restart (s):"
@@ -3214,7 +3218,7 @@ msgstr ""
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Start!"
-msgstr ""
+msgstr "Mulai!"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/multimesh_editor_plugin.cpp
@@ -3303,7 +3307,7 @@ msgstr ""
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Import Animations.."
-msgstr ""
+msgstr "Impor Animasi.."
#: editor/plugins/animation_tree_editor_plugin.cpp
#, fuzzy
@@ -3312,12 +3316,11 @@ msgstr "Sunting Filter Node"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Filters.."
-msgstr ""
+msgstr "Penyaring.."
#: editor/plugins/animation_tree_editor_plugin.cpp
-#, fuzzy
msgid "AnimationTree"
-msgstr "Animasi"
+msgstr "PohonAnimasi"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Free"
@@ -3747,6 +3750,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -4043,6 +4054,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5744,6 +5759,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6244,7 +6267,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6393,11 +6418,6 @@ msgid "Delete Item"
msgstr "Hapus"
#: editor/project_settings_editor.cpp
-#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "Sambungkan Ke Node:"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7484,6 +7504,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8212,12 +8236,22 @@ msgstr ""
"bekerja."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Hanya satu WorldEnvironment yang diizinkan per scene (atau atur scene-scene "
"yang diacu)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8315,6 +8349,10 @@ msgid "Invalid font size."
msgstr "Ukuran font tidak sah."
#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Sambungkan Ke Node:"
+
+#, fuzzy
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/is.po b/editor/translations/is.po
index b0b8698f37..eb4f29126c 100644
--- a/editor/translations/is.po
+++ b/editor/translations/is.po
@@ -1372,6 +1372,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3592,6 +3596,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3877,6 +3889,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5538,6 +5554,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6013,7 +6037,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6157,10 +6183,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7199,6 +7221,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7835,10 +7861,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/it.po b/editor/translations/it.po
index ba1a09e3ad..85f4e665a1 100644
--- a/editor/translations/it.po
+++ b/editor/translations/it.po
@@ -9,16 +9,18 @@
# Elia Zanaboni <elia.zanaboni@gmail.com>, 2017.
# Giovanni Solimeno (Crax97) <gsolimeno97@gmail.com>, 2017.
# Marco Melorio <m.melorio@icloud.com>, 2017.
-# Myself <whatamidoing.wt@gmail.com>, 2017.
+# Matteo <matteo.guglielmetti@hotmail.it>, 2018.
+# Myself <whatamidoing.wt@gmail.com>, 2017-2018.
# RealAquilus <JamesHeller@live.it>, 2017.
+# Samuele Zolfanelli <samdazel@gmail.com>, 2018.
# Sean Bone <seanbone@zumguy.com>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-12-14 12:48+0000\n"
-"Last-Translator: anonymous <>\n"
+"PO-Revision-Date: 2018-05-02 10:38+0000\n"
+"Last-Translator: Samuele Zolfanelli <samdazel@gmail.com>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/"
"godot/it/>\n"
"Language: it\n"
@@ -26,7 +28,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.18-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -505,9 +507,8 @@ msgid "Connecting Signal:"
msgstr "Connessione Segnali:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Disconnect '%s' from '%s'"
-msgstr "Connetti '%s' a '%s'"
+msgstr "Disconnetti '%s' da '%s'"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -525,7 +526,7 @@ msgstr "Segnali"
#: editor/create_dialog.cpp
#, fuzzy
msgid "Change %s Type"
-msgstr "Cambia Tipo"
+msgstr "Cambia Tipo di %s"
#: editor/create_dialog.cpp editor/project_settings_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -533,9 +534,8 @@ msgid "Change"
msgstr "Cambia"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Create New %s"
-msgstr "Crea Nuovo"
+msgstr "Crea Nuovo %s"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
@@ -646,9 +646,8 @@ msgstr ""
"Rimuoverli comunque? (no undo)"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Cannot remove:"
-msgstr "Impossibile rimouvere:\n"
+msgstr "Impossibile rimuovere:"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -761,7 +760,7 @@ msgstr "Donatori Oro"
#: editor/editor_about.cpp
msgid "Silver Donors"
-msgstr "Sponsors Argento"
+msgstr "Donatori Argento"
#: editor/editor_about.cpp
msgid "Bronze Donors"
@@ -842,9 +841,8 @@ msgid "Rename Audio Bus"
msgstr "Rinomina Bus Audio"
#: editor/editor_audio_buses.cpp
-#, fuzzy
msgid "Change Audio Bus Volume"
-msgstr "Imposta Bus Audio su Solo"
+msgstr "Cambia il volume del Bus Audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Solo"
@@ -909,7 +907,7 @@ msgstr "Elimina Effetto"
#: editor/editor_audio_buses.cpp
msgid "Audio"
-msgstr ""
+msgstr "Audio"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
@@ -1090,13 +1088,12 @@ msgid "Updating scene.."
msgstr "Aggiornando la scena.."
#: editor/editor_data.cpp
-#, fuzzy
msgid "[empty]"
-msgstr "(vuoto)"
+msgstr "[vuoto]"
#: editor/editor_data.cpp
msgid "[unsaved]"
-msgstr ""
+msgstr "[non salvato]"
#: editor/editor_dir_dialog.cpp
msgid "Please select a base directory first"
@@ -1349,9 +1346,8 @@ msgid "Description"
msgstr "Descrizione"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Online Tutorials:"
-msgstr "Tutorials"
+msgstr "Tutorial online:"
#: editor/editor_help.cpp
#, fuzzy
@@ -1360,7 +1356,7 @@ msgid ""
"$url]contribute one[/url][/color] or [color=$color][url=$url2]request one[/"
"url][/color]."
msgstr ""
-"Al momento una descrizione per questo metodo non esiste. Aiutaci [color="
+"Al momento una descrizione per questa classe non esiste. Aiutaci [color="
"$color][url=$url]aggiungendone una[/url][/color]!"
#: editor/editor_help.cpp
@@ -1417,7 +1413,11 @@ msgstr "Rimuovi"
#: editor/editor_log.cpp
#, fuzzy
msgid "Clear Output"
-msgstr "Output"
+msgstr "Pulisci output"
+
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
@@ -2382,9 +2382,8 @@ msgid "Frame #:"
msgstr "Frame #:"
#: editor/editor_profiler.cpp
-#, fuzzy
msgid "Time"
-msgstr "Tempo:"
+msgstr "Tempo"
#: editor/editor_profiler.cpp
#, fuzzy
@@ -2491,7 +2490,7 @@ msgstr "Non é stato trovato version.txt all'interno di templates."
#: editor/export_template_manager.cpp
#, fuzzy
msgid "Error creating path for templates:"
-msgstr "Errore di creazione del percorso per le template:\n"
+msgstr "Errore di creazione del percorso per i template:"
#: editor/export_template_manager.cpp
msgid "Extracting Export Templates"
@@ -2526,9 +2525,8 @@ msgstr "Nessuna risposta."
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Request Failed."
-msgstr "Rich. Fall."
+msgstr "Richiesta fallita."
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -2572,7 +2570,7 @@ msgstr "Connettendo.."
#: editor/export_template_manager.cpp
#, fuzzy
msgid "Can't Connect"
-msgstr "Impossibile connettersi"
+msgstr "Impossibile connettere."
#: editor/export_template_manager.cpp
msgid "Connected"
@@ -2592,7 +2590,6 @@ msgid "Connection Error"
msgstr "Errore di connessione"
#: editor/export_template_manager.cpp
-#, fuzzy
msgid "SSL Handshake Error"
msgstr "Errore nell'Handshake SSL"
@@ -2651,8 +2648,7 @@ msgstr "Visualizza elementi come una lista"
#, fuzzy
msgid "Status: Import of file failed. Please fix file and reimport manually."
msgstr ""
-"\n"
-"Stato: Importazione file fallita. Si prega di sistemare il file e "
+"Stato: Importazione file fallita. Si prega di riparare il file e "
"reimportarlo manualmente."
#: editor/filesystem_dock.cpp
@@ -2662,7 +2658,7 @@ msgstr "Impossibile spostare/rinominare risorse root."
#: editor/filesystem_dock.cpp
#, fuzzy
msgid "Cannot move a folder into itself."
-msgstr "Impossibile spostare una cartella in se stessa.\n"
+msgstr "Impossibile spostare una cartella in se stessa."
#: editor/filesystem_dock.cpp
#, fuzzy
@@ -2670,14 +2666,12 @@ msgid "Error moving:"
msgstr "Errore spostamento:\n"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Error duplicating:"
-msgstr "Errore in caricamento:"
+msgstr "Errore duplicazione:"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Unable to update dependencies:"
-msgstr "Impossibile aggiornare le dipendenze:\n"
+msgstr "Impossibile aggiornare le dipendenze:"
#: editor/filesystem_dock.cpp
msgid "No name provided"
@@ -2708,14 +2702,12 @@ msgid "Renaming folder:"
msgstr "Rinomina cartella:"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Duplicating file:"
-msgstr "duplica"
+msgstr "Duplicando file:"
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Duplicating folder:"
-msgstr "Rinomina cartella:"
+msgstr "Duplicando cartella:"
#: editor/filesystem_dock.cpp
msgid "Expand all"
@@ -2736,7 +2728,7 @@ msgstr "Sposta in.."
#: editor/filesystem_dock.cpp
#, fuzzy
msgid "Open Scene(s)"
-msgstr "Apri Scena"
+msgstr "Apri Scena/e"
#: editor/filesystem_dock.cpp
msgid "Instance"
@@ -2751,9 +2743,8 @@ msgid "View Owners.."
msgstr "Vedi Proprietari.."
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Duplicate.."
-msgstr "duplica"
+msgstr "Duplica.."
#: editor/filesystem_dock.cpp
msgid "Previous Directory"
@@ -2850,14 +2841,13 @@ msgid "Importing Scene.."
msgstr "Importando Scena.."
#: editor/import/resource_importer_scene.cpp
-#, fuzzy
msgid "Generating Lightmaps"
-msgstr "Trasferisci a Lightmap:"
+msgstr "Generando Lightmap"
#: editor/import/resource_importer_scene.cpp
#, fuzzy
msgid "Generating for Mesh: "
-msgstr "Generando AABB"
+msgstr "Generando per Mesh: "
#: editor/import/resource_importer_scene.cpp
msgid "Running Custom Script.."
@@ -3106,15 +3096,16 @@ msgstr "Copia Animazione"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Onion Skinning"
-msgstr ""
+msgstr "Onion Skinning"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Enable Onion Skinning"
msgstr "Attiva Onion Skinning"
#: editor/plugins/animation_player_editor_plugin.cpp
+#, fuzzy
msgid "Directions"
-msgstr ""
+msgstr "Direzioni"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Past"
@@ -3135,12 +3126,12 @@ msgstr "1 Passo"
#: editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
msgid "2 steps"
-msgstr "2 Passi"
+msgstr "2 passi"
#: editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
msgid "3 steps"
-msgstr "3 Passi"
+msgstr "3 passi"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Differences Only"
@@ -3148,11 +3139,11 @@ msgstr "Solo Differenze"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Force White Modulate"
-msgstr ""
+msgstr "Forza Modulazione Bianca"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Include Gizmos (3D)"
-msgstr ""
+msgstr "Includi Gizmo (3D)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Create New Animation"
@@ -3482,21 +3473,28 @@ msgid ""
"Save your scene (for images to be saved in the same dir), or pick a save "
"path from the BakedLightmap properties."
msgstr ""
+"Impossibile determinare un percorso di salvataggio per le immagini di "
+"lightmap.\n"
+"Salva la scena (per salvare le immagini nella stessa directory), o scegli un "
+"percorso di salvataggio nelle proprietà di BackedLightmap."
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid ""
"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake "
"Light' flag is on."
msgstr ""
+"Nessuna mesh da preprocessare. Assicurarsi che contengano un canale UV2 e "
+"che la spunta 'Bake Light' sia abilitata."
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid "Failed creating lightmap images, make sure path is writable."
msgstr ""
+"Tentativo di creazione delle immagini di lightmap fallito, assicurarsi che "
+"il percorso dei file sia scrivibile."
#: editor/plugins/baked_lightmap_editor_plugin.cpp
-#, fuzzy
msgid "Bake Lightmaps"
-msgstr "Trasferisci a Lightmap:"
+msgstr "Preprocessa Lightmaps"
#: editor/plugins/camera_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -3757,6 +3755,16 @@ msgid "Show Guides"
msgstr "Mostra guide"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Visualizza Origine"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Vista"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centra Selezione"
@@ -4060,6 +4068,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "La mesh non ha superficie dalla quale creare un'outline!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Impossiblile creare outline!"
@@ -5776,6 +5788,16 @@ msgid "Checked Item"
msgstr "Checked Item"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Aggiungi Elemento"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Checked Item"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Ha"
@@ -6295,8 +6317,10 @@ msgid "Mouse Button"
msgstr "Pulsante Mouse"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Azione invalida (va bene tutto a parte '/' o ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6444,11 +6468,6 @@ msgstr "Elimina Input"
#: editor/project_settings_editor.cpp
#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "Impossibile connetersi all'host:"
-
-#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Already existing"
msgstr "Attiva Persistenza"
@@ -7556,6 +7575,10 @@ msgstr "Impostazioni Snap"
msgid "Pick Distance:"
msgstr "Istanza:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -7821,7 +7844,7 @@ msgstr "Iteratore"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr "Mentre"
+msgstr "While"
#: modules/visual_script/visual_script_editor.cpp
msgid "Return"
@@ -8307,12 +8330,22 @@ msgstr ""
"poter funzionare."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Solamente un WorldEnvironment è consentito per scena (o insieme di scene "
"istanziate)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8412,6 +8445,13 @@ msgstr "Errore caricamento font."
msgid "Invalid font size."
msgstr "Dimensione font Invalida."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Azione invalida (va bene tutto a parte '/' o ':')."
+
+#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Impossibile connetersi all'host:"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/ja.po b/editor/translations/ja.po
index 905c498a3c..e05530b258 100644
--- a/editor/translations/ja.po
+++ b/editor/translations/ja.po
@@ -12,20 +12,20 @@
# Lexi Grafen <shfeedly@gmail.com>, 2017.
# NoahDigital <taku_58@hotmail.com>, 2017.
# Tetsuji Ochiai <ochiaixp@gmail.com>, 2017.
-# Tohru Ike (rokujyouhitoma) <rokujyouhitomajp@gmail.com>, 2017.
+# Tohru Ike (rokujyouhitoma) <rokujyouhitomajp@gmail.com>, 2017-2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-06 13:19+0000\n"
-"Last-Translator: NoahDigital <taku_58@hotmail.com>\n"
+"PO-Revision-Date: 2018-04-02 08:38+0000\n"
+"Last-Translator: Tohru Ike (rokujyouhitoma) <rokujyouhitomajp@gmail.com>\n"
"Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/"
"godot/ja/>\n"
"Language: ja\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 2.20-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -468,7 +468,6 @@ msgstr "追加"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Remove"
msgstr "削除"
@@ -1554,6 +1553,10 @@ msgstr "削除"
msgid "Clear Output"
msgstr "出力"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
msgid "Error saving resource!"
@@ -4148,6 +4151,16 @@ msgstr "ボーンを表示ã™ã‚‹"
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
+msgid "Show Origin"
+msgstr "原点を見る"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 ビューãƒãƒ¼ãƒˆ"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
msgid "Center Selection"
msgstr "é¸æŠžå¯¾è±¡ã‚’中央ã«"
@@ -4467,6 +4480,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "メッシュã«ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚’作æˆã™ã‚‹ãŸã‚ã®ã‚µãƒ¼ãƒ•ã‚§ã‚¤ã‚¹ãŒå­˜åœ¨ã—ã¾ã›ã‚“"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
#, fuzzy
msgid "Could not create outline!"
msgstr "アウトラインを生æˆã§ãã¾ã›ã‚“ã§ã—ãŸ!"
@@ -6322,6 +6339,16 @@ msgid "Checked Item"
msgstr "ãƒã‚§ãƒƒã‚¯æ¸ˆã¿ã‚¢ã‚¤ãƒ†ãƒ "
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "アイテムを追加"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "ãƒã‚§ãƒƒã‚¯æ¸ˆã¿ã‚¢ã‚¤ãƒ†ãƒ "
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6838,6 +6865,8 @@ msgid ""
"You don't currently have any projects.\n"
"Would you like to explore the official example projects in the Asset Library?"
msgstr ""
+"ã‚ãªãŸã¯ç¾åœ¨ã©ã®ãƒ—ロジェクトもæŒã£ã¦ã„ã¾ã›ã‚“。\n"
+"アセットライブラリã§å…¬å¼ã®ã‚µãƒ³ãƒ—ルプロジェクトを探ã—ã¾ã—ょã†ã‹ï¼Ÿ"
#: editor/project_settings_editor.cpp
#, fuzzy
@@ -6859,8 +6888,10 @@ msgid "Mouse Button"
msgstr "マウスボタン"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "ä¸æ­£ãªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ï¼ˆ '/' ã¨':'ã¯ä¸å¯ã§ã™ï¼‰."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -7016,11 +7047,6 @@ msgstr "入力を消去"
#: editor/project_settings_editor.cpp
#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "ホストã«æŽ¥ç¶šã§ãã¾ã›ã‚“:"
-
-#: editor/project_settings_editor.cpp
-#, fuzzy
msgid "Already existing"
msgstr "アクション'%s'ã¯æ—¢ã«ã‚ã‚Šã¾ã™!"
@@ -8194,6 +8220,10 @@ msgstr "Snapã®è¨­å®š"
msgid "Pick Distance:"
msgstr "インスタンス:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -8977,6 +9007,10 @@ msgstr ""
"ã™ã€‚"
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
#, fuzzy
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
@@ -8984,6 +9018,12 @@ msgstr ""
"1 ã¤ã ã‘ã® WorldEnvironment ã¯ã€ã‚·ãƒ¼ãƒ³ (ã¾ãŸã¯ã‚¤ãƒ³ã‚¹ã‚¿ãƒ³ã‚¹åŒ–ã•ã‚ŒãŸã‚·ãƒ¼ãƒ³ã®"
"セット) ã”ã¨ã«è¨±å¯ã•ã‚Œã¾ã™ã€‚"
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -9084,6 +9124,13 @@ msgstr "フォント読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã€‚"
msgid "Invalid font size."
msgstr "無効ãªãƒ•ã‚©ãƒ³ãƒˆ サイズã§ã™ã€‚"
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "ä¸æ­£ãªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ï¼ˆ '/' ã¨':'ã¯ä¸å¯ã§ã™ï¼‰."
+
+#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "ホストã«æŽ¥ç¶šã§ãã¾ã›ã‚“:"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/ko.po b/editor/translations/ko.po
index 28294c7307..c3fcfbbb72 100644
--- a/editor/translations/ko.po
+++ b/editor/translations/ko.po
@@ -3,18 +3,19 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
-# 박한얼 (volzhs) <volzhs@gmail.com>, 2016-2018.
# Ch <ccwpc@hanmail.net>, 2017.
# paijai 송 (fivejobi) <xotjq237@gmail.com>, 2018.
+# Sun Kim <perplexingsun@gmail.com>, 2018.
# TheRedPlanet <junmo.moon8@gmail.com>, 2018.
# Xavier Cho <mysticfallband@gmail.com>, 2018.
+# 박한얼 (volzhs) <volzhs@gmail.com>, 2016-2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-02-24 08:39+0000\n"
-"Last-Translator: TheRedPlanet <junmo.moon8@gmail.com>\n"
+"PO-Revision-Date: 2018-04-18 15:39+0000\n"
+"Last-Translator: Sun Kim <perplexingsun@gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/"
"godot/ko/>\n"
"Language: ko\n"
@@ -22,7 +23,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -37,9 +38,8 @@ msgid "Anim Change Keyframe Time"
msgstr "애니메ì´ì…˜ 키프레임 시간 변경"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Transition"
-msgstr "애니메ì´ì…˜ êµì²´ 트랜지션"
+msgstr "애니메ì´ì…˜ 트랜지션 변경"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
@@ -164,7 +164,6 @@ msgid "Constant"
msgstr "비선형"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "In"
msgstr "In"
@@ -897,7 +896,7 @@ msgstr "ì´íŽ™íŠ¸ ì‚­ì œ"
#: editor/editor_audio_buses.cpp
msgid "Audio"
-msgstr "ìŒì„±"
+msgstr "오디오"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
@@ -1399,6 +1398,10 @@ msgstr "지우기"
msgid "Clear Output"
msgstr "출력 지우기"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "리소스 저장 중 ì—러!"
@@ -3689,6 +3692,16 @@ msgid "Show Guides"
msgstr "ê°€ì´ë“œ 보기"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "ì›ì  보기"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1ê°œ ë·°í¬íŠ¸"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "ì„ íƒ í•­ëª© 화면 ì¤‘ì•™ì— í‘œì‹œ"
@@ -3978,6 +3991,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "ë©”ì‹œì— ì™¸ê³½ì„ ì„ ë§Œë“¤ê¸° 위한 서피스가 없습니다!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "ì™¸ê³½ì„ ì„ ë§Œë“¤ìˆ˜ 없습니다!"
@@ -4609,7 +4626,7 @@ msgstr "파ì¼"
#: editor/plugins/script_editor_plugin.cpp
msgid "New"
-msgstr "새로운"
+msgstr "새 파ì¼"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save All"
@@ -5644,6 +5661,16 @@ msgid "Checked Item"
msgstr "항목 확ì¸ë¨"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "항목 추가"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "항목 확ì¸ë¨"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "가진다"
@@ -5861,7 +5888,7 @@ msgstr "프로ì íŠ¸ì˜ 모든 리소스 내보내기"
#: editor/project_export.cpp
msgid "Export selected scenes (and dependencies)"
-msgstr "ì„ íƒëœ 리소스 내보내기 (종ì†ëœ 리소스 í¬í•¨)"
+msgstr "ì„ íƒëœ 씬 내보내기 (종ì†ëœ 리소스 í¬í•¨)"
#: editor/project_export.cpp
msgid "Export selected resources (and dependencies)"
@@ -6135,8 +6162,10 @@ msgid "Mouse Button"
msgstr "마우스 버튼"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "유효하지 ì•Šì€ ì•¡ì…˜ ('/' ë˜ëŠ” ':' ë¬¸ìž ì‚¬ìš© 불가)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6279,10 +6308,6 @@ msgid "Delete Item"
msgstr "ì•„ì´í…œ ì‚­ì œ"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "'/' ë˜ëŠ” ':' 문ìžë¥¼ í¬í•¨í•  수 ì—†ìŒ"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "ì´ë¯¸ 존재함"
@@ -6801,15 +6826,15 @@ msgid ""
"Click to unlock"
msgstr ""
"노드가 잠겨있습니다.\n"
-"í´ë¦­í•´ì„œ 잠금해제 하십시오"
+"í´ë¦­í•˜ë©´ 잠금 í•´ì œë©ë‹ˆë‹¤"
#: editor/scene_tree_editor.cpp
msgid ""
"Children are not selectable.\n"
"Click to make selectable"
msgstr ""
-"ìžì‹ë“¤ì„ ì„ íƒ í•  수 없습니다.\n"
-"í´ë¦­í•´ì„œ ì„ íƒ í•  수 있게 하십시오"
+"ìžì‹ë“¤ì„ ì„ íƒí•  수 없습니다.\n"
+"í´ë¦­í•˜ë©´ ì„ íƒí•  수 있게 ë©ë‹ˆë‹¤"
#: editor/scene_tree_editor.cpp
msgid "Toggle Visibility"
@@ -7336,6 +7361,10 @@ msgstr "그리드맵 설정"
msgid "Pick Distance:"
msgstr "거리 ì„ íƒ:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "솔루션 ìƒì„± 중..."
@@ -7386,7 +7415,7 @@ msgstr "경고"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "내부 예외 ìŠ¤íƒ ì¶”ì ì˜ ë"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7418,7 +7447,8 @@ msgstr "유효하지 ì•Šì€ ì‹œí€€ìŠ¤ ì¶œë ¥ì„ ë°˜í™˜í•œ 노드: "
#: modules/visual_script/visual_script.cpp
msgid "Found sequence bit but not the node in the stack, report bug!"
-msgstr "시퀀스 비트를 발견했지만 스íƒì•ˆì˜ 노드ì—는 없습니다, 버그를 기ë¡!"
+msgstr ""
+"시퀀스 비트를 발견했지만 스íƒì•ˆì˜ 노드ì—는 없습니다, 버그를 제보하세요!"
#: modules/visual_script/visual_script.cpp
msgid "Stack overflow with stack depth: "
@@ -8033,10 +8063,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Path ì†ì„±ì€ 유효한 Spatial 노드를 가리켜야 합니다."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr "씬마다 WorldEnvironmentê°€ 단 하나만 허용ë©ë‹ˆë‹¤."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8132,6 +8172,12 @@ msgstr "í°íŠ¸ 로딩 ì—러."
msgid "Invalid font size."
msgstr "유효하지 ì•Šì€ í°íŠ¸ í¬ê¸°."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "유효하지 ì•Šì€ ì•¡ì…˜ ('/' ë˜ëŠ” ':' ë¬¸ìž ì‚¬ìš© 불가)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "'/' ë˜ëŠ” ':' 문ìžë¥¼ í¬í•¨í•  수 ì—†ìŒ"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/lt.po b/editor/translations/lt.po
index 0ad2945bdc..6504e570f7 100644
--- a/editor/translations/lt.po
+++ b/editor/translations/lt.po
@@ -1380,6 +1380,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3610,6 +3614,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3895,6 +3907,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5557,6 +5573,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6035,7 +6059,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6179,10 +6205,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7221,6 +7243,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7859,10 +7885,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/nb.po b/editor/translations/nb.po
index 8d9ffe7a21..17123dc8fc 100644
--- a/editor/translations/nb.po
+++ b/editor/translations/nb.po
@@ -3,7 +3,7 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
-# Allan Nordhøy <epost@anotheragency.no>, 2017.
+# Allan Nordhøy <epost@anotheragency.no>, 2017-2018.
# Anonymous <GentleSaucepan@protonmail.com>, 2017.
# flesk <eivindkn@gmail.com>, 2017.
# Jørgen Aarmo Lund <jorgen.aarmo@gmail.com>, 2016.
@@ -14,15 +14,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-20 08:55+0000\n"
-"Last-Translator: NicolaiF <nico-fre@hotmail.com>\n"
+"PO-Revision-Date: 2018-03-22 03:38+0000\n"
+"Last-Translator: Allan Nordhøy <epost@anotheragency.no>\n"
"Language-Team: Norwegian Bokmål <https://hosted.weblate.org/projects/godot-"
"engine/godot/nb/>\n"
"Language: nb\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 2.20-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -1219,15 +1219,15 @@ msgstr "Veksle modus"
#: editor/editor_file_dialog.cpp
msgid "Focus Path"
-msgstr ""
+msgstr "Fokuser Bane"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Up"
-msgstr "Flytt favoritt oppover"
+msgstr "Flytt Favoritt Oppover"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Down"
-msgstr "Flytt favoritt nedover"
+msgstr "Flytt Favoritt Nedover"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Go to parent folder"
@@ -1235,7 +1235,7 @@ msgstr "GÃ¥ til overnevnt mappe"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Directories & Files:"
-msgstr "Mapper og filer:"
+msgstr "Mapper og Filer:"
#: editor/editor_file_dialog.cpp
msgid "Preview:"
@@ -1252,7 +1252,7 @@ msgstr "MÃ¥ ha en gyldig filutvidelse."
#: editor/editor_file_system.cpp
msgid "ScanSources"
-msgstr ""
+msgstr "SkannKilder"
#: editor/editor_file_system.cpp
msgid "(Re)Importing Assets"
@@ -1414,6 +1414,10 @@ msgstr "Tøm"
msgid "Clear Output"
msgstr "Output"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Feil ved lagring av ressurs!"
@@ -1640,6 +1644,9 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
+"Valgte scene '%s' er ikke en scenefil, velg en gyldig én?\n"
+"Du kan endre dette senere i \"Prosjekt Instillinger\" under 'applikasjon' "
+"kategorien."
#: editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
@@ -1655,7 +1662,7 @@ msgstr "Ã…pne Scene"
#: editor/editor_node.cpp
msgid "Open Base Scene"
-msgstr ""
+msgstr "Ã…pne Base Scene"
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
@@ -1787,6 +1794,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Unable to load addon script from path: '%s' Script is not in tool mode."
msgstr ""
+"Kunne ikke laste tillegsskript fra sti: '%s' Script er ikke i verktøymodus."
#: editor/editor_node.cpp
msgid ""
@@ -2002,6 +2010,11 @@ msgid ""
"On Android, deploy will use the USB cable for faster performance. This "
"option speeds up testing for games with a large footprint."
msgstr ""
+"NÃ¥r dette alternativet er aktivert, eksportering eller distribuering vil "
+"produsere en kjørbar fil.\n"
+"Filstystemet vil få prosjektet fra redigerinsverktøyet over nettverket. \n"
+"PÃ¥ Android, distribusjon du vil bruke USB-kabelen for raskere ytelse. Dette "
+"alternativet gjør testing for spill med et stort fotavtrykk raskere."
#: editor/editor_node.cpp
#, fuzzy
@@ -2068,11 +2081,11 @@ msgstr "Redigeringsverktøy"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
-msgstr ""
+msgstr "Redigeringsverktøy-instillinger"
#: editor/editor_node.cpp
msgid "Editor Layout"
-msgstr ""
+msgstr "Redigeringsverktøy Layout"
#: editor/editor_node.cpp
msgid "Toggle Fullscreen"
@@ -2189,7 +2202,7 @@ msgstr "Last inn en eksisterende ressurs fra disk og rediger den."
#: editor/editor_node.cpp
msgid "Save the currently edited resource."
-msgstr ""
+msgstr "Lagre den nylige redigerte ressursen."
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Save As.."
@@ -2487,7 +2500,7 @@ msgstr "Feil ved laging av sti for mal:\n"
#: editor/export_template_manager.cpp
msgid "Extracting Export Templates"
-msgstr ""
+msgstr "Ekstraherer Eksport Mal"
#: editor/export_template_manager.cpp
msgid "Importing:"
@@ -2851,7 +2864,7 @@ msgstr ""
#: editor/import/resource_importer_scene.cpp
msgid "Generating for Mesh: "
-msgstr ""
+msgstr "Genererer for Maske: "
#: editor/import/resource_importer_scene.cpp
msgid "Running Custom Script.."
@@ -3501,7 +3514,7 @@ msgstr ""
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid "Failed creating lightmap images, make sure path is writable."
-msgstr ""
+msgstr "Laging av lysmapbilder feilet, forsikre om at stien er skrivbar."
#: editor/plugins/baked_lightmap_editor_plugin.cpp
msgid "Bake Lightmaps"
@@ -3760,6 +3773,16 @@ msgstr "Vis veiledere"
#: editor/plugins/canvas_item_editor_plugin.cpp
#, fuzzy
+msgid "Show Origin"
+msgstr "Vis Rutenett"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "Vis hjelpere"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
msgid "Center Selection"
msgstr "Plasser Utvalg I Midten"
@@ -3782,7 +3805,7 @@ msgstr "Sett inn Nøkkel"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Insert Key (Existing Tracks)"
-msgstr ""
+msgstr "Sett inn Nøkkel (Eksisterende Spor)"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Copy Pose"
@@ -3818,11 +3841,11 @@ msgstr "Legger til %s.."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Ok"
-msgstr ""
+msgstr "Ok"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Cannot instantiate multiple nodes without root."
-msgstr ""
+msgstr "Kan ikke instansiere flere noder uten rot."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
@@ -4051,6 +4074,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Kunne ikke lage omriss!"
@@ -4222,7 +4249,7 @@ msgstr ""
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Calculating grid size..."
-msgstr ""
+msgstr "Regner ut rutenettstørrelse…"
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Creating heightfield..."
@@ -4283,7 +4310,7 @@ msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
-msgstr ""
+msgstr "Feil ved innlasting av bilde:"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "No pixels with transparency > 128 in image.."
@@ -4369,7 +4396,7 @@ msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points"
-msgstr ""
+msgstr "Overflatepunkter"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
@@ -4481,11 +4508,11 @@ msgstr "Fjern Funksjon"
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Path"
-msgstr ""
+msgstr "Splitt Sti"
#: editor/plugins/path_editor_plugin.cpp
msgid "Remove Path Point"
-msgstr ""
+msgstr "Fjern Stipunkt"
#: editor/plugins/path_editor_plugin.cpp
#, fuzzy
@@ -4563,7 +4590,7 @@ msgstr ""
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Enable Snap"
-msgstr ""
+msgstr "Aktiver Snap"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid"
@@ -4588,28 +4615,28 @@ msgstr "Fjern Ressurs"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Resource clipboard is empty!"
-msgstr ""
+msgstr "Ressurs-utklippstavle er tom!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp
msgid "Open in Editor"
-msgstr ""
+msgstr "Åpne i Redigeringsverktøy"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/scene_tree_editor.cpp
msgid "Instance:"
-msgstr ""
+msgstr "Instans:"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp
#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
msgid "Type:"
-msgstr ""
+msgstr "Type:"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Load Resource"
-msgstr ""
+msgstr "Last Ressurs"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4680,35 +4707,33 @@ msgstr "Flytt Ned"
#: editor/plugins/script_editor_plugin.cpp
msgid "Next script"
-msgstr ""
+msgstr "Neste skript"
#: editor/plugins/script_editor_plugin.cpp
msgid "Previous script"
-msgstr ""
+msgstr "Forrige skript"
#: editor/plugins/script_editor_plugin.cpp
msgid "File"
-msgstr ""
+msgstr "Fil"
#: editor/plugins/script_editor_plugin.cpp
msgid "New"
-msgstr ""
+msgstr "Ny"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save All"
-msgstr ""
+msgstr "Lagre Alle"
#: editor/plugins/script_editor_plugin.cpp
msgid "Soft Reload Script"
msgstr ""
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Copy Script Path"
-msgstr "Kopier Sti"
+msgstr "Kopier Skript-Sti"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Show In File System"
msgstr "Vis I Filutforsker"
@@ -4722,35 +4747,35 @@ msgstr ""
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload Theme"
-msgstr ""
+msgstr "Gjeninnlast drakt"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme"
-msgstr ""
+msgstr "Lagre drakt"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As"
-msgstr ""
+msgstr "Lagre drakt som"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close Docs"
-msgstr ""
+msgstr "Lukk Dokumentasjon"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close All"
-msgstr ""
+msgstr "Lukk Alle"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close Other Tabs"
-msgstr ""
+msgstr "Lukk Andre Faner"
#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
msgid "Run"
-msgstr ""
+msgstr "Kjør"
#: editor/plugins/script_editor_plugin.cpp
msgid "Toggle Scripts Panel"
-msgstr ""
+msgstr "Veksle skriptpanel"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4764,15 +4789,15 @@ msgstr "Finn neste"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
-msgstr ""
+msgstr "Hopp Over"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Into"
-msgstr ""
+msgstr "Tre inn i"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Break"
-msgstr ""
+msgstr "Brekk"
#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
#: editor/script_editor_debugger.cpp
@@ -4781,35 +4806,35 @@ msgstr "Fortsett"
#: editor/plugins/script_editor_plugin.cpp
msgid "Keep Debugger Open"
-msgstr ""
+msgstr "Hold feilretteren åpen"
#: editor/plugins/script_editor_plugin.cpp
msgid "Debug with external editor"
-msgstr ""
+msgstr "Feilrett med ekstern behandler"
#: editor/plugins/script_editor_plugin.cpp
msgid "Open Godot online documentation"
-msgstr ""
+msgstr "Ã…pne Godots nettbaserte dokumentasjon"
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
-msgstr ""
+msgstr "Søk i klasse-hierarkiet."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the reference documentation."
-msgstr ""
+msgstr "Søk i referanse-dokumentasjonen."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to previous edited document."
-msgstr ""
+msgstr "GÃ¥ til tidligere redigert dokument."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to next edited document."
-msgstr ""
+msgstr "GÃ¥ til neste redigerte dokument."
#: editor/plugins/script_editor_plugin.cpp
msgid "Discard"
-msgstr ""
+msgstr "Forkast"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
@@ -4823,15 +4848,15 @@ msgstr ""
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload"
-msgstr ""
+msgstr "Gjeninnlat"
#: editor/plugins/script_editor_plugin.cpp
msgid "Resave"
-msgstr ""
+msgstr "Lagre på nytt"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Debugger"
-msgstr ""
+msgstr "Feilretter"
#: editor/plugins/script_editor_plugin.cpp
msgid ""
@@ -4852,15 +4877,15 @@ msgstr ""
#: editor/plugins/script_text_editor.cpp
msgid "Uppercase"
-msgstr ""
+msgstr "Store versaler"
#: editor/plugins/script_text_editor.cpp
msgid "Lowercase"
-msgstr ""
+msgstr "Små bokstaver"
#: editor/plugins/script_text_editor.cpp
msgid "Capitalize"
-msgstr ""
+msgstr "Store bokstaver"
#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
@@ -4876,7 +4901,7 @@ msgstr "Lim inn"
#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
msgid "Select All"
-msgstr ""
+msgstr "Velg Alle"
#: editor/plugins/script_text_editor.cpp
#, fuzzy
@@ -4885,15 +4910,15 @@ msgstr "Slett Valgte"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Left"
-msgstr ""
+msgstr "Innrykk Venstre"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Right"
-msgstr ""
+msgstr "Innrykk Høyre"
#: editor/plugins/script_text_editor.cpp
msgid "Toggle Comment"
-msgstr ""
+msgstr "Veksle kommentar"
#: editor/plugins/script_text_editor.cpp
#, fuzzy
@@ -4902,15 +4927,15 @@ msgstr "Slett Valgte"
#: editor/plugins/script_text_editor.cpp
msgid "Fold All Lines"
-msgstr ""
+msgstr "Fold sammen alle linjer"
#: editor/plugins/script_text_editor.cpp
msgid "Unfold All Lines"
-msgstr ""
+msgstr "Brett ut alle linjer"
#: editor/plugins/script_text_editor.cpp
msgid "Clone Down"
-msgstr ""
+msgstr "Klon nedover"
#: editor/plugins/script_text_editor.cpp
msgid "Complete Symbol"
@@ -4930,7 +4955,7 @@ msgstr ""
#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
-msgstr ""
+msgstr "Automatisk innrykk"
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -4951,11 +4976,11 @@ msgstr ""
#: editor/plugins/script_text_editor.cpp
msgid "Convert To Uppercase"
-msgstr ""
+msgstr "Konverter til store versaler"
#: editor/plugins/script_text_editor.cpp
msgid "Convert To Lowercase"
-msgstr ""
+msgstr "Konverter til små versaler"
#: editor/plugins/script_text_editor.cpp
msgid "Find Previous"
@@ -5051,7 +5076,7 @@ msgstr ""
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Comment"
-msgstr ""
+msgstr "Endre Kommentar"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add/Remove to Color Ramp"
@@ -5135,15 +5160,15 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scaling: "
-msgstr ""
+msgstr "Skalerer: "
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translating: "
-msgstr ""
+msgstr "Oversetter: "
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
-msgstr ""
+msgstr "Roterer %s grader."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Keying is disabled (no key inserted)."
@@ -5168,7 +5193,7 @@ msgstr "Forandre"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Surface Changes"
-msgstr ""
+msgstr "Overflateendringer"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Draw Calls"
@@ -5200,31 +5225,31 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left"
-msgstr ""
+msgstr "Venstre"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View."
-msgstr ""
+msgstr "Høyrevisning."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right"
-msgstr ""
+msgstr "Høyre"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View."
-msgstr ""
+msgstr "Frontvisning."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front"
-msgstr ""
+msgstr "Front"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View."
-msgstr ""
+msgstr "Bakvisning."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear"
-msgstr ""
+msgstr "Bak"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
@@ -5268,15 +5293,15 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Information"
-msgstr ""
+msgstr "Vis Informasjon"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View FPS"
-msgstr ""
+msgstr "Vis FPS"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Half Resolution"
-msgstr ""
+msgstr "Halver Oppløsning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Audio Listener"
@@ -5357,27 +5382,27 @@ msgstr "Snap til veiledere"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View"
-msgstr ""
+msgstr "Bunnvisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View"
-msgstr ""
+msgstr "Toppvisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View"
-msgstr ""
+msgstr "Bakvisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View"
-msgstr ""
+msgstr "Frontvisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View"
-msgstr ""
+msgstr "Venstrevisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View"
-msgstr ""
+msgstr "Høyrevisning"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Switch Perspective/Orthogonal view"
@@ -5563,15 +5588,15 @@ msgstr ""
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "(empty)"
-msgstr ""
+msgstr "(tom)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animations"
-msgstr ""
+msgstr "Animasjoner"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Speed (FPS):"
-msgstr ""
+msgstr "Hastighet (FPS):"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Loop"
@@ -5732,6 +5757,15 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Legg til Element"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -5741,7 +5775,7 @@ msgstr ""
#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
msgid "Options"
-msgstr ""
+msgstr "Innstillinger"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Have,Many,Several,Options!"
@@ -5749,15 +5783,15 @@ msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 1"
-msgstr ""
+msgstr "Fane 1"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 2"
-msgstr ""
+msgstr "Fane 2"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 3"
-msgstr ""
+msgstr "Fane 3"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Data Type:"
@@ -5765,7 +5799,7 @@ msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
msgid "Icon"
-msgstr ""
+msgstr "Ikon"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Style"
@@ -5773,15 +5807,15 @@ msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
msgid "Font"
-msgstr ""
+msgstr "Font"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Color"
-msgstr ""
+msgstr "Farge"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Theme"
-msgstr ""
+msgstr "Tema"
#: editor/plugins/tile_map_editor_plugin.cpp
#, fuzzy
@@ -5822,11 +5856,11 @@ msgstr ""
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror X"
-msgstr ""
+msgstr "Speil X"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror Y"
-msgstr ""
+msgstr "Speil Y"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Paint Tile"
@@ -5838,19 +5872,19 @@ msgstr ""
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 0 degrees"
-msgstr ""
+msgstr "Roter 0 grader"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 90 degrees"
-msgstr ""
+msgstr "Roter 90 grader"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 180 degrees"
-msgstr ""
+msgstr "Roter 180 grader"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 270 degrees"
-msgstr ""
+msgstr "Roter 270 grader"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Could not find tile:"
@@ -5912,11 +5946,11 @@ msgstr ""
#: editor/progress_dialog.cpp scene/gui/dialogs.cpp
msgid "Cancel"
-msgstr ""
+msgstr "Avbryt"
#: editor/project_export.cpp
msgid "Runnable"
-msgstr ""
+msgstr "Kjørbar"
#: editor/project_export.cpp
msgid "Delete patch '%s' from list?"
@@ -5940,19 +5974,19 @@ msgstr ""
#: editor/project_export.cpp
msgid "Resources"
-msgstr ""
+msgstr "Ressurser"
#: editor/project_export.cpp
msgid "Export all resources in the project"
-msgstr ""
+msgstr "Eksporter alle ressurser til prosjektet"
#: editor/project_export.cpp
msgid "Export selected scenes (and dependencies)"
-msgstr ""
+msgstr "Eksporter valgte scener (og avhengigheter)"
#: editor/project_export.cpp
msgid "Export selected resources (and dependencies)"
-msgstr ""
+msgstr "Exporter valgte ressurs (og avhengigheter)"
#: editor/project_export.cpp
msgid "Export Mode:"
@@ -6046,39 +6080,40 @@ msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
msgstr ""
+"Kunne ikke laste project.godot i prosjekt sti (error %d). Den kan være "
+"manglet eller korruptert."
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
-msgstr ""
+msgstr "Kunne ikke endre project.godot i projsektstien."
#: editor/project_manager.cpp
msgid "Couldn't create project.godot in project path."
-msgstr ""
+msgstr "Kunne ikke lage project.godot i prosjektstien."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
-msgstr ""
+msgstr "De følgende filene feilet ekstrahering fra pakke:"
#: editor/project_manager.cpp
msgid "Rename Project"
-msgstr ""
+msgstr "Endre Navn på Prosjekt"
#: editor/project_manager.cpp
msgid "New Game Project"
-msgstr ""
+msgstr "Nytt Spill-Prosjekt"
#: editor/project_manager.cpp
msgid "Import Existing Project"
-msgstr ""
+msgstr "Importer Eksisterende Prosjekt"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Import & Edit"
-msgstr "Importer"
+msgstr "Importer & Endre"
#: editor/project_manager.cpp
msgid "Create New Project"
-msgstr ""
+msgstr "Opprett Nytt Prosjekt"
#: editor/project_manager.cpp
#, fuzzy
@@ -6087,24 +6122,23 @@ msgstr "Opprett skript"
#: editor/project_manager.cpp
msgid "Install Project:"
-msgstr ""
+msgstr "Installer Prosjekt:"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Install & Edit"
-msgstr "Installer"
+msgstr "Installer & Endre"
#: editor/project_manager.cpp
msgid "Project Name:"
-msgstr ""
+msgstr "Prosjektnavn:"
#: editor/project_manager.cpp
msgid "Create folder"
-msgstr ""
+msgstr "Opprett mappe"
#: editor/project_manager.cpp
msgid "Project Path:"
-msgstr ""
+msgstr "Prosjektsti:"
#: editor/project_manager.cpp
msgid "Browse"
@@ -6116,11 +6150,11 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Can't open project"
-msgstr ""
+msgstr "Kan ikke åpne prosjekt"
#: editor/project_manager.cpp
msgid "Are you sure to open more than one project?"
-msgstr ""
+msgstr "Er du sikker på at du vil åpne mer enn ett prosjekt?"
#: editor/project_manager.cpp
msgid ""
@@ -6137,11 +6171,11 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Are you sure to run more than one project?"
-msgstr ""
+msgstr "Er du sikker på at du vil kjøre mer enn ett prosjekt?"
#: editor/project_manager.cpp
msgid "Remove project from the list? (Folder contents will not be modified)"
-msgstr ""
+msgstr "Fjern prosjekt fra listen? (Mappeinnhold vil ikke bli modifisert)"
#: editor/project_manager.cpp
msgid ""
@@ -6154,6 +6188,8 @@ msgid ""
"You are about the scan %s folders for existing Godot projects. Do you "
"confirm?"
msgstr ""
+"Du er i ferd med å skanne %s mapper for eksisterende Godotprosjekter. "
+"Bekrefter du?"
#: editor/project_manager.cpp
msgid "Project Manager"
@@ -6161,19 +6197,19 @@ msgstr "Prosjektleder"
#: editor/project_manager.cpp
msgid "Project List"
-msgstr ""
+msgstr "Prosjektliste"
#: editor/project_manager.cpp
msgid "Scan"
-msgstr ""
+msgstr "Skann"
#: editor/project_manager.cpp
msgid "Select a Folder to Scan"
-msgstr ""
+msgstr "Velg en Mappe å Skanne"
#: editor/project_manager.cpp
msgid "New Project"
-msgstr ""
+msgstr "Nytt Prosjekt"
#: editor/project_manager.cpp
msgid "Templates"
@@ -6181,15 +6217,15 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Exit"
-msgstr ""
+msgstr "Avslutt"
#: editor/project_manager.cpp
msgid "Restart Now"
-msgstr ""
+msgstr "Omstart NÃ¥"
#: editor/project_manager.cpp
msgid "Can't run project"
-msgstr ""
+msgstr "Kan ikke kjøre prosjekt"
#: editor/project_manager.cpp
msgid ""
@@ -6211,10 +6247,12 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Mouse Button"
-msgstr ""
+msgstr "Museknapp"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6360,12 +6398,8 @@ msgid "Delete Item"
msgstr "Slett Valgte"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
-msgstr ""
+msgstr "Eksisterer allerede"
#: editor/project_settings_editor.cpp
msgid "Add Input Action"
@@ -7419,6 +7453,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -8084,10 +8122,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/nl.po b/editor/translations/nl.po
index e54a0c7960..9927fd8e8a 100644
--- a/editor/translations/nl.po
+++ b/editor/translations/nl.po
@@ -13,6 +13,7 @@
# Ferdinand de Coninck <ferdinand.deconinck@gmail.com>, 2018.
# Jorn Theunissen <jorn-theunissen@hotmail.com>, 2018.
# Maikel <maikel_martens_1@hotmail.com>, 2017.
+# millenniumproof <millenniumproof@gmail.com>, 2018.
# Pieter-Jan Briers <pieterjan.briers@gmail.com>, 2017-2018.
# Robin Arys <robinarys@hotmail.com>, 2017.
# Senno Kaasjager <senno.kaasjager@gmail.com>, 2017.
@@ -24,15 +25,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-17 19:35+0000\n"
-"Last-Translator: Pieter-Jan Briers <pieterjan.briers@gmail.com>\n"
+"PO-Revision-Date: 2018-04-06 15:35+0000\n"
+"Last-Translator: millenniumproof <millenniumproof@gmail.com>\n"
"Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/"
"nl/>\n"
"Language: nl\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.19\n"
+"X-Generator: Weblate 2.20\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -754,7 +755,7 @@ msgstr "Gouden Sponsors"
#: editor/editor_about.cpp
msgid "Mini Sponsors"
-msgstr "Mini Sponsors"
+msgstr "Mini Sponsoren"
#: editor/editor_about.cpp
msgid "Gold Donors"
@@ -770,7 +771,7 @@ msgstr "Bronzen Donors"
#: editor/editor_about.cpp
msgid "Donors"
-msgstr "Donors"
+msgstr "Donoren"
#: editor/editor_about.cpp
msgid "License"
@@ -1412,6 +1413,10 @@ msgstr "Leegmaken"
msgid "Clear Output"
msgstr "Maak Uitvoer Leeg"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Error bij het opslaan van resource!"
@@ -3087,14 +3092,12 @@ msgid "Enable Onion Skinning"
msgstr "\"Onion Skinning\" Inschakelen"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Directions"
-msgstr "Beschrijving"
+msgstr "Richtingen"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Past"
-msgstr "Plakken"
+msgstr "Verleden"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Future"
@@ -3612,9 +3615,8 @@ msgid "Pan Mode"
msgstr "Verschuif Modus"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Toggles snapping"
-msgstr "Breekpunt Aan- of Uitschakelen"
+msgstr "Snappen Aan- of Uitschakelen"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Snap"
@@ -3637,9 +3639,8 @@ msgid "Configure Snap..."
msgstr "Configureer Uitlijnen..."
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Snap Relative"
-msgstr "Uitlijn Relatief"
+msgstr "Snap Relatief"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Pixel Snap"
@@ -3650,14 +3651,12 @@ msgid "Smart snapping"
msgstr "Slim Uitlijnen"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Snap to parent"
-msgstr "Uitlijnen naar ouder"
+msgstr "Snap naar ouder"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Snap to node anchor"
-msgstr "Uitlijnen naar node anker"
+msgstr "Snap naar node anker"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap to node sides"
@@ -3736,6 +3735,16 @@ msgid "Show Guides"
msgstr "Toon hulplijnen"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Raster Weergeven"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "Toon helpers"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centreer Selectie"
@@ -3772,9 +3781,8 @@ msgid "Drag pivot from mouse position"
msgstr "Versleep draaipunt vanaf muispositie"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Set pivot at mouse position"
-msgstr "Verwijder Signaal"
+msgstr "Plaats pivot bij muispositie"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Multiply grid step by 2"
@@ -3894,9 +3902,8 @@ msgid "Remove point"
msgstr "Punt verwijderen"
#: editor/plugins/curve_editor_plugin.cpp
-#, fuzzy
msgid "Left linear"
-msgstr "Lineair"
+msgstr "Links Lineair"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Right linear"
@@ -3907,9 +3914,8 @@ msgid "Load preset"
msgstr "Laad voorinstelling"
#: editor/plugins/curve_editor_plugin.cpp
-#, fuzzy
msgid "Remove Curve Point"
-msgstr "Verwijder Signaal"
+msgstr "Verwijder Curve Punt"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Toggle Curve Linear Tangent"
@@ -3925,9 +3931,8 @@ msgid "Bake GI Probe"
msgstr "Bak GI Probe"
#: editor/plugins/gradient_editor_plugin.cpp
-#, fuzzy
msgid "Add/Remove Color Ramp Point"
-msgstr "Verwijder/Voeg Kleuren Hellings Punt Toe"
+msgstr "Voeg Toe/Verwijder Kleur Hellingspunt"
#: editor/plugins/gradient_editor_plugin.cpp
#: editor/plugins/shader_graph_editor_plugin.cpp
@@ -3953,7 +3958,7 @@ msgid ""
"Create and assign one?"
msgstr ""
"Geen OccluderPolygon2D resource op deze node.\n"
-"Creëer en wijs een toe?"
+"Creëer en wijs één toe?"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
msgid "Create Occluder Polygon"
@@ -4012,13 +4017,12 @@ msgid "Create Navigation Mesh"
msgstr "Creëer Navigatie Mesh"
#: editor/plugins/mesh_instance_editor_plugin.cpp
-#, fuzzy
msgid "Contained Mesh is not of type ArrayMesh."
-msgstr "Bevatte Mesh is niet van type ArrayMesh"
+msgstr "Bevatte Mesh is niet van type ArrayMesh."
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "UV Unwrap failed, mesh may not be manifold?"
-msgstr ""
+msgstr "UV Uitpakken is gefaald, wellicht is de mesh niet manifold?"
#: editor/plugins/mesh_instance_editor_plugin.cpp
#, fuzzy
@@ -4038,6 +4042,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Mesh heeft geen oppervlakte om omlijning van te maken!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Kon omlijning niet maken!"
@@ -4058,14 +4066,12 @@ msgid "Create Convex Static Body"
msgstr "Creëer Convex Statisch Lichaam"
#: editor/plugins/mesh_instance_editor_plugin.cpp
-#, fuzzy
msgid "Create Trimesh Collision Sibling"
-msgstr "Creëer Trimesh Botsings Broer"
+msgstr "Creëer Trimesh Botsing Broer"
#: editor/plugins/mesh_instance_editor_plugin.cpp
-#, fuzzy
msgid "Create Convex Collision Sibling"
-msgstr "Creëer Convex Botsings Broer"
+msgstr "Creëer Convex Botsing Broer"
#: editor/plugins/mesh_instance_editor_plugin.cpp
#, fuzzy
@@ -4082,7 +4088,7 @@ msgstr "Geef UV2 Weer"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Unwrap UV2 for Lightmap/AO"
-msgstr ""
+msgstr "Pak UV2 uit voor Lichtmap/AO"
#: editor/plugins/mesh_instance_editor_plugin.cpp
#, fuzzy
@@ -4090,9 +4096,8 @@ msgid "Create Outline Mesh"
msgstr "Creëer Omlijning Mesh"
#: editor/plugins/mesh_instance_editor_plugin.cpp
-#, fuzzy
msgid "Outline Size:"
-msgstr "Omlijning Grootte:"
+msgstr "Grootte Omlijning:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "No mesh source specified (and no MultiMesh set in node)."
@@ -4138,7 +4143,7 @@ msgstr "Ouder heeft geen vaste vlakken om te bevolken."
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Couldn't map area."
-msgstr ""
+msgstr "Kon het gebied niet mappen."
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Select a Source Mesh:"
@@ -4150,7 +4155,7 @@ msgstr "Selecteer een Doel Oppervlakte:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate Surface"
-msgstr ""
+msgstr "Bevolk Oppervlakte"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate MultiMesh"
@@ -4221,9 +4226,8 @@ msgid "Creating heightfield..."
msgstr "Hoogteveld aan het creëeren..."
#: editor/plugins/navigation_mesh_generator.cpp
-#, fuzzy
msgid "Marking walkable triangles..."
-msgstr "Lokale wijziging aan het opslaan.."
+msgstr "Markeer loopbare driehoeken.."
#: editor/plugins/navigation_mesh_generator.cpp
#, fuzzy
@@ -4231,9 +4235,8 @@ msgid "Constructing compact heightfield..."
msgstr "Compact hoogteveld aan het bouwen..."
#: editor/plugins/navigation_mesh_generator.cpp
-#, fuzzy
msgid "Eroding walkable area..."
-msgstr "Wandelbaar gebied eroderen..."
+msgstr "Wandelbaar gebied aan het eroderen..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Partitioning..."
@@ -4249,15 +4252,15 @@ msgstr "Polymesh aan het creëeren..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Converting to native navigation mesh..."
-msgstr ""
+msgstr "Naar navigatie mesh aan het converteren..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Navigation Mesh Generator Setup:"
-msgstr ""
+msgstr "Navigatie Mesh Generator Setup:"
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Parsing Geometry..."
-msgstr ""
+msgstr "Geometrie aan het ontleden..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Done!"
@@ -4274,7 +4277,7 @@ msgstr "AABB Genereren"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Can only set point into a ParticlesMaterial process material"
-msgstr ""
+msgstr "Kan punt alleen plaatsen in een PartikelsMateriaal proces materiaal"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Error loading image:"
@@ -4286,250 +4289,246 @@ msgstr "Geen pixels met transparantie > 128 in afbeelding.."
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generate Visibility Rect"
-msgstr ""
+msgstr "Genereer Zichtbaarheid Rechthoek"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
-msgstr ""
+msgstr "Laad Emissie Masker"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Clear Emission Mask"
-msgstr ""
+msgstr "Leeg Emissie Masker"
#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
msgid "Particles"
-msgstr ""
+msgstr "Partikels"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generated Point Count:"
-msgstr ""
+msgstr "Telling Gegenereerde Punten:"
#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generation Time (sec):"
-msgstr ""
+msgstr "Genereer Tijd (sec):"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Emission Mask"
-msgstr ""
+msgstr "Emissie Masker"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Capture from Pixel"
-msgstr ""
+msgstr "Neem uit Pixel"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Emission Colors"
-msgstr ""
+msgstr "Kleuren Emissie"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
-msgstr ""
+msgstr "Node bevat geen geometrie."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry (faces)."
-msgstr ""
+msgstr "Node bevat geen geometrie (vlakken)."
#: editor/plugins/particles_editor_plugin.cpp
msgid "A processor material of type 'ParticlesMaterial' is required."
-msgstr ""
+msgstr "Een processor materiaal of type 'PartikelMateriaal' is nodig."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
-msgstr ""
+msgstr "Vlakken bevatten geen gebied!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "No faces!"
-msgstr ""
+msgstr "Geen vlakken!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate AABB"
-msgstr ""
+msgstr "Genereer AABB"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Mesh"
-msgstr ""
+msgstr "Creëer Emissie Punten Vanuit Mesh"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Node"
-msgstr ""
+msgstr "Creëer Emissie Punten Vanuit Node"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emitter"
-msgstr ""
+msgstr "Creëer Emitter"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Points:"
-msgstr ""
+msgstr "Emissie Punten:"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points"
-msgstr ""
+msgstr "Oppervlakte Punten"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Oppervlakte Punten+Normaal (Gericht)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
-msgstr ""
+msgstr "Volume"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Source: "
-msgstr ""
+msgstr "Emissie Bron: "
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate Visibility AABB"
-msgstr ""
+msgstr "Genereer Zichtbaarheid AABB"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
-msgstr ""
+msgstr "Verwijder Punt van Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Out-Control from Curve"
-msgstr ""
+msgstr "Verwijder Uit-Control van Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove In-Control from Curve"
-msgstr ""
+msgstr "Verwijder In-Controle van Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point to Curve"
-msgstr ""
+msgstr "Voeg Punt toe aan Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move Point in Curve"
-msgstr ""
+msgstr "Verplaats Punt in Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move In-Control in Curve"
-msgstr ""
+msgstr "Verplaats In-Control in Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move Out-Control in Curve"
-msgstr ""
+msgstr "Verplaats Uit-Controle in Curve"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Select Points"
-msgstr ""
+msgstr "Selecteer Punten"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Shift+Drag: Select Control Points"
-msgstr ""
+msgstr "Shift+Drag: Selecteer Controle Punten"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Click: Add Point"
-msgstr ""
+msgstr "Klik: Voeg Punt Toe"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Right Click: Delete Point"
-msgstr ""
+msgstr "Rechter Klik: Verwijder Punt"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Select Control Points (Shift+Drag)"
-msgstr ""
+msgstr "Selecteer Controle Punten (Shift+Sleep)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Add Point (in empty space)"
-msgstr ""
+msgstr "Voeg Punt Toe (in lege ruimte)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Segment (in curve)"
-msgstr ""
+msgstr "Splits Segment (in curve)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Delete Point"
-msgstr ""
+msgstr "Verwijder Punt"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
msgid "Close Curve"
-msgstr ""
+msgstr "Sluit Curve"
#: editor/plugins/path_editor_plugin.cpp
msgid "Curve Point #"
-msgstr ""
+msgstr "Curve Punt #"
#: editor/plugins/path_editor_plugin.cpp
-#, fuzzy
msgid "Set Curve Point Position"
-msgstr "Verwijder Signaal"
+msgstr "Zet Curve Punt Positie"
#: editor/plugins/path_editor_plugin.cpp
-#, fuzzy
msgid "Set Curve In Position"
-msgstr "Verwijder Signaal"
+msgstr "Zet Curve In Positie"
#: editor/plugins/path_editor_plugin.cpp
-#, fuzzy
msgid "Set Curve Out Position"
-msgstr "Verwijder Signaal"
+msgstr "Set Curve Uit Positie"
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Path"
-msgstr ""
+msgstr "Splits Pad"
#: editor/plugins/path_editor_plugin.cpp
msgid "Remove Path Point"
-msgstr ""
+msgstr "Verwijder Pad Punt"
#: editor/plugins/path_editor_plugin.cpp
-#, fuzzy
msgid "Remove Out-Control Point"
-msgstr "Verwijder Autoload"
+msgstr "Verwijder Uit-Controle Punt"
#: editor/plugins/path_editor_plugin.cpp
msgid "Remove In-Control Point"
-msgstr ""
+msgstr "Verwijder In-Controle Punt"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Create UV Map"
-msgstr ""
+msgstr "Creëer UV Map"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Transform UV Map"
-msgstr ""
+msgstr "Transformeer UV Map"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Polygon 2D UV Editor"
-msgstr ""
+msgstr "Polygon 2D UV Editor"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Move Point"
-msgstr ""
+msgstr "Beweeg Punt"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Ctrl: Rotate"
-msgstr ""
+msgstr "Ctrl: Roteer"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift: Move All"
-msgstr ""
+msgstr "Shift: Beweeg alles"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift+Ctrl: Scale"
-msgstr ""
+msgstr "Shift+Ctrl: Schaal"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Move Polygon"
-msgstr ""
+msgstr "Beweeg Polygon"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Rotate Polygon"
-msgstr ""
+msgstr "Roteer Polygon"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Scale Polygon"
-msgstr ""
+msgstr "Schaal Polygon"
#: editor/plugins/polygon_2d_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4541,70 +4540,70 @@ msgstr "Bewerken"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Polygon->UV"
-msgstr ""
+msgstr "Polygon->UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "UV->Polygon"
-msgstr ""
+msgstr "UV->Polygon"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Clear UV"
-msgstr ""
+msgstr "Wis UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap"
-msgstr ""
+msgstr "Snap"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Enable Snap"
-msgstr ""
+msgstr "Zet Snap Aan"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid"
-msgstr ""
+msgstr "Grid"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "ERROR: Couldn't load resource!"
-msgstr ""
+msgstr "ERROR: Laden van bron mislukt!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Add Resource"
-msgstr ""
+msgstr "Voeg Bron Toe"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Rename Resource"
-msgstr ""
+msgstr "Naam Wijzigen Bron"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Delete Resource"
-msgstr ""
+msgstr "Verwijder Bron"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Resource clipboard is empty!"
-msgstr ""
+msgstr "Bronnen klembord is leeg!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp
msgid "Open in Editor"
-msgstr ""
+msgstr "Openen in Editor"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/scene_tree_editor.cpp
msgid "Instance:"
-msgstr ""
+msgstr "Instantie:"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp
#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
msgid "Type:"
-msgstr ""
+msgstr "Type:"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Load Resource"
-msgstr ""
+msgstr "Laad Bron"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4614,249 +4613,246 @@ msgid "Paste"
msgstr "Plakken"
#: editor/plugins/resource_preloader_editor_plugin.cpp
-#, fuzzy
msgid "ResourcePreloader"
-msgstr "Resource"
+msgstr "BronnenPrelader"
#: editor/plugins/script_editor_plugin.cpp
msgid "Clear Recent Files"
-msgstr ""
+msgstr "Wis Recente Bestanden"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close and save changes?"
-msgstr ""
+msgstr "Wijzigingen oplaan en sluiten?"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error while saving theme"
-msgstr ""
+msgstr "Fout bij het opslaan van het thema"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error saving"
-msgstr ""
+msgstr "Fout bij het opslaan"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing theme"
-msgstr ""
+msgstr "Fout bij import van thema"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing"
-msgstr ""
+msgstr "Fout bij importeren"
#: editor/plugins/script_editor_plugin.cpp
msgid "Import Theme"
-msgstr ""
+msgstr "Importeer Thema"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As.."
-msgstr ""
+msgstr "Thema Opslaan Als.."
#: editor/plugins/script_editor_plugin.cpp
msgid " Class Reference"
-msgstr ""
+msgstr " Klasse Referentie"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Sort"
-msgstr "Sorteren:"
+msgstr "Sorteren"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "Move Up"
-msgstr ""
+msgstr "Plaats Omhoog"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "Move Down"
-msgstr ""
+msgstr "Plaats Omlaag"
#: editor/plugins/script_editor_plugin.cpp
msgid "Next script"
-msgstr ""
+msgstr "Volgend script"
#: editor/plugins/script_editor_plugin.cpp
msgid "Previous script"
-msgstr ""
+msgstr "Vorig script"
#: editor/plugins/script_editor_plugin.cpp
msgid "File"
-msgstr ""
+msgstr "Bestand"
#: editor/plugins/script_editor_plugin.cpp
msgid "New"
-msgstr ""
+msgstr "Nieuw"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save All"
-msgstr ""
+msgstr "Alles Opslaan"
#: editor/plugins/script_editor_plugin.cpp
msgid "Soft Reload Script"
-msgstr ""
+msgstr "Zacht Herladen Script"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Copy Script Path"
-msgstr "Kopieer Pad"
+msgstr "Kopieer Script Pad"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Show In File System"
-msgstr "Weergeven in Bestandsbeheer"
+msgstr "Toon in Bestandsbeheer"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Prev"
-msgstr ""
+msgstr "Geschiedenis voorgaande"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Next"
-msgstr ""
+msgstr "Geschiedenis Volgende"
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload Theme"
-msgstr ""
+msgstr "Herlaad Thema"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme"
-msgstr ""
+msgstr "Thema Opslaan"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As"
-msgstr ""
+msgstr "Thema Opslaan Als"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close Docs"
-msgstr ""
+msgstr "Sluit Docs"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close All"
-msgstr ""
+msgstr "Sluit Alles"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close Other Tabs"
-msgstr ""
+msgstr "Sluit Andere Tabbladen"
#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
msgid "Run"
msgstr "Starten"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Toggle Scripts Panel"
-msgstr "Toggle Favoriet"
+msgstr "Schakel Scripten Paneel"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
msgid "Find.."
-msgstr ""
+msgstr "Vind.."
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
msgid "Find Next"
-msgstr ""
+msgstr "Vind Volgende"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
-msgstr ""
+msgstr "Stap Over"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Into"
-msgstr ""
+msgstr "Stap In"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Break"
-msgstr ""
+msgstr "Breek"
#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
#: editor/script_editor_debugger.cpp
msgid "Continue"
-msgstr ""
+msgstr "Vervolg"
#: editor/plugins/script_editor_plugin.cpp
msgid "Keep Debugger Open"
-msgstr ""
+msgstr "Houd Debugger Open"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Debug with external editor"
-msgstr "Afhankelijkheden Editor"
+msgstr "Debug met externe editor"
#: editor/plugins/script_editor_plugin.cpp
msgid "Open Godot online documentation"
-msgstr ""
+msgstr "Open Godot online documentatie"
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the class hierarchy."
-msgstr ""
+msgstr "Zoek in de klasse hiërarchie."
#: editor/plugins/script_editor_plugin.cpp
msgid "Search the reference documentation."
-msgstr ""
+msgstr "Zoek in de referentie documentatie."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to previous edited document."
-msgstr ""
+msgstr "Ga naar voorgaand bewerkte document."
#: editor/plugins/script_editor_plugin.cpp
msgid "Go to next edited document."
-msgstr ""
+msgstr "Ga naar volgend bewerkte document."
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Discard"
-msgstr "Discreet"
+msgstr "Verwerp"
#: editor/plugins/script_editor_plugin.cpp
msgid "Create Script"
-msgstr ""
+msgstr "Creëer Script"
#: editor/plugins/script_editor_plugin.cpp
msgid ""
"The following files are newer on disk.\n"
"What action should be taken?:"
msgstr ""
+"De volgende bestanden zijn nieuwer op de schijf.\n"
+"Welke aktie moet worden genomen?:"
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload"
-msgstr ""
+msgstr "Herlaad"
#: editor/plugins/script_editor_plugin.cpp
msgid "Resave"
-msgstr ""
+msgstr "Heropslaan"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Debugger"
-msgstr ""
+msgstr "Debugger"
#: editor/plugins/script_editor_plugin.cpp
msgid ""
"Built-in scripts can only be edited when the scene they belong to is loaded"
msgstr ""
+"Ingebouwde scripts kunnen alleen ge-edit worden wanneer de bijbehorende "
+"scène geladen is"
#: editor/plugins/script_text_editor.cpp
msgid "Only resources from filesystem can be dropped."
-msgstr ""
+msgstr "Alleen bronnen uit bestandssysteem kunnen gedropt worden."
#: editor/plugins/script_text_editor.cpp
msgid "Pick Color"
-msgstr ""
+msgstr "Kies Kleur"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Case"
-msgstr ""
+msgstr "Converteer Hoofdlettergebruik"
#: editor/plugins/script_text_editor.cpp
msgid "Uppercase"
-msgstr ""
+msgstr "Hoofdletters"
#: editor/plugins/script_text_editor.cpp
msgid "Lowercase"
-msgstr ""
+msgstr "Kleine letters"
#: editor/plugins/script_text_editor.cpp
msgid "Capitalize"
-msgstr ""
+msgstr "Maak Hoofdletters"
#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
#: scene/gui/text_edit.cpp
@@ -4875,58 +4871,56 @@ msgid "Select All"
msgstr "Alles Selecteren"
#: editor/plugins/script_text_editor.cpp
-#, fuzzy
msgid "Delete Line"
-msgstr "Verwijder"
+msgstr "Verwijder Regel"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Left"
-msgstr ""
+msgstr "Links Inspringen"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Right"
-msgstr ""
+msgstr "Rechts Inspringen"
#: editor/plugins/script_text_editor.cpp
msgid "Toggle Comment"
-msgstr ""
+msgstr "Commentaar Aan/Uit"
#: editor/plugins/script_text_editor.cpp
-#, fuzzy
msgid "Fold/Unfold Line"
-msgstr "Ga naar Regel"
+msgstr "Vouw/Ontvouw Regel"
#: editor/plugins/script_text_editor.cpp
msgid "Fold All Lines"
-msgstr ""
+msgstr "Vouw Alle Regels"
#: editor/plugins/script_text_editor.cpp
msgid "Unfold All Lines"
-msgstr ""
+msgstr "Ontvouw Alle Regels"
#: editor/plugins/script_text_editor.cpp
msgid "Clone Down"
-msgstr ""
+msgstr "Kloon Omlaag"
#: editor/plugins/script_text_editor.cpp
msgid "Complete Symbol"
-msgstr ""
+msgstr "Voltooi Symbool"
#: editor/plugins/script_text_editor.cpp
msgid "Trim Trailing Whitespace"
-msgstr ""
+msgstr "Trim Navolgende Spaties"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Indent To Spaces"
-msgstr ""
+msgstr "Converteer Indentatie Naar Spaties"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Indent To Tabs"
-msgstr ""
+msgstr "Converteer Indentatie Naar Tabs"
#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
-msgstr ""
+msgstr "Auto Indentatie"
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -4935,389 +4929,379 @@ msgstr "Breekpunt Aan- of Uitschakelen"
#: editor/plugins/script_text_editor.cpp
msgid "Remove All Breakpoints"
-msgstr ""
+msgstr "Verwijder Alle Breekpunten"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Next Breakpoint"
-msgstr ""
+msgstr "Ga Naar Volgende Breekpunt"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Previous Breakpoint"
-msgstr ""
+msgstr "Ga Naar Vorige Breekpunt"
#: editor/plugins/script_text_editor.cpp
msgid "Convert To Uppercase"
-msgstr ""
+msgstr "Converteer Naar Hoofdletters"
#: editor/plugins/script_text_editor.cpp
-#, fuzzy
msgid "Convert To Lowercase"
-msgstr "Verbind Aan Node:"
+msgstr "Converteer Naar Kleine Letters"
#: editor/plugins/script_text_editor.cpp
msgid "Find Previous"
-msgstr ""
+msgstr "Vind Vorige"
#: editor/plugins/script_text_editor.cpp
msgid "Replace.."
-msgstr ""
+msgstr "Vervang.."
#: editor/plugins/script_text_editor.cpp
msgid "Goto Function.."
-msgstr ""
+msgstr "Ga Naar Functie.."
#: editor/plugins/script_text_editor.cpp
msgid "Goto Line.."
-msgstr ""
+msgstr "Ga Naar Regel.."
#: editor/plugins/script_text_editor.cpp
msgid "Contextual Help"
-msgstr ""
+msgstr "Contextuele Hulp"
#: editor/plugins/shader_editor_plugin.cpp
msgid "Shader"
-msgstr ""
+msgstr "Shader"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Constant"
-msgstr ""
+msgstr "Verander Shalar Constante"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Constant"
-msgstr ""
+msgstr "Verander Vec Constante"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Constant"
-msgstr ""
+msgstr "Verander RGB Constante"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Operator"
-msgstr ""
+msgstr "Verander Scalar Operator"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Operator"
-msgstr ""
+msgstr "Verander Vec Operator"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Scalar Operator"
-msgstr ""
+msgstr "Verander Vec Scalar Operator"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Operator"
-msgstr ""
+msgstr "Verander RGB Operator"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
-msgstr ""
+msgstr "Aan/Uit Alleen Rot"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Function"
-msgstr ""
+msgstr "Verander Scalar Functie"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Function"
-msgstr ""
+msgstr "Verander Vec Functie"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Uniform"
-msgstr ""
+msgstr "Verander Scalar Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Uniform"
-msgstr ""
+msgstr "Verander Vec Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Uniform"
-msgstr ""
+msgstr "Verander RGB Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Default Value"
-msgstr ""
+msgstr "Verander Standaardwaarde"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change XForm Uniform"
-msgstr ""
+msgstr "Verander XForm Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Texture Uniform"
-msgstr ""
+msgstr "Verander Textuur Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Cubemap Uniform"
-msgstr ""
+msgstr "Verander Cubemap Uniform"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Comment"
-msgstr ""
+msgstr "Verander Commentaar"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add/Remove to Color Ramp"
-msgstr ""
+msgstr "Voeg Toe/Verwijder van Kleur Helling"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add/Remove to Curve Map"
-msgstr ""
+msgstr "Voeg Toe/Verwijder van Curve Map"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Modify Curve Map"
-msgstr ""
+msgstr "Wijzig Curve Map"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Input Name"
-msgstr ""
+msgstr "Verander Input Naam"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Connect Graph Nodes"
-msgstr ""
+msgstr "Verbind Graaf Knooppunten"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Disconnect Graph Nodes"
-msgstr ""
+msgstr "Ontkoppel Graaf Knooppunten"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Remove Shader Graph Node"
-msgstr ""
+msgstr "Verwijder Shader Graaf Knooppunten"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Move Shader Graph Node"
-msgstr ""
+msgstr "Verplaats Shader Graaf Knooppunten"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Duplicate Graph Node(s)"
-msgstr ""
+msgstr "Dupliceer Graaf Knooppunt(en)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Delete Shader Graph Node(s)"
-msgstr ""
+msgstr "Verwijder Shader Graaf Knooppunt(en)"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Error: Cyclic Connection Link"
-msgstr ""
+msgstr "Fout: Cyclische Connectie Link"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Error: Missing Input Connections"
-msgstr ""
+msgstr "Fout: Ontbrekende Input Connecties"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add Shader Graph Node"
-msgstr ""
+msgstr "Voeg Shader Graaf Knooppunt Toe"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Orthogonal"
-msgstr ""
+msgstr "Orthogonaal"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective"
-msgstr ""
+msgstr "Perspectief"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Aborted."
-msgstr ""
+msgstr "Transformatie Afgebroken."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "X-Axis Transform."
-msgstr ""
+msgstr "X-As Transformatie."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Y-Axis Transform."
-msgstr ""
+msgstr "Y-As Transformatie."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Z-Axis Transform."
-msgstr ""
+msgstr "Z-As Transformatie."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Plane Transform."
-msgstr ""
+msgstr "Bekijk Vlak Transformatie."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scaling: "
-msgstr ""
+msgstr "Schaling: "
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Translating: "
-msgstr "Transitie"
+msgstr "Transitie: "
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
-msgstr ""
+msgstr "Roteren %s graden."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Keying is disabled (no key inserted)."
-msgstr ""
+msgstr "Key-en is uitgeschakeld (geen key ingevoegd)."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Animation Key Inserted."
-msgstr ""
+msgstr "Animatie Key Ingevoegd."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Objects Drawn"
-msgstr ""
+msgstr "Objecten Getekend"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Material Changes"
-msgstr "Lokale wijziging aan het opslaan.."
+msgstr "Materiaal Wijzigingen"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Shader Changes"
-msgstr "Wijzig"
+msgstr "Shader Wijzigingen"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Surface Changes"
-msgstr ""
+msgstr "Oppervlakte Wijzigingen"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Draw Calls"
-msgstr ""
+msgstr "Teken Aanroepingen"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Vertices"
-msgstr ""
+msgstr "Vertices"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "FPS"
-msgstr ""
+msgstr "FPS"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View."
-msgstr ""
+msgstr "Bovenaanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View."
-msgstr ""
+msgstr "Onderaanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom"
-msgstr ""
+msgstr "Onder"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View."
-msgstr ""
+msgstr "Linkeraanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left"
-msgstr ""
+msgstr "Links"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View."
-msgstr ""
+msgstr "Rechteraanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right"
-msgstr ""
+msgstr "Rechts"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View."
-msgstr ""
+msgstr "Vooraanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front"
-msgstr ""
+msgstr "Voor"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View."
-msgstr ""
+msgstr "Achteraanzicht."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear"
-msgstr ""
+msgstr "Achter"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align with view"
-msgstr ""
+msgstr "Uitlijnen met zicht"
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "OK :("
-msgstr ""
+msgstr "OK :("
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "No parent to instance a child at."
-msgstr ""
+msgstr "Geen ouder om kind aan te instantiëren."
#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "This operation requires a single selected node."
-msgstr ""
+msgstr "Deze bewerking vereist één geselecteerde knooppunt."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Display Normal"
-msgstr ""
+msgstr "Weergave Normaalvector"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Display Wireframe"
-msgstr ""
+msgstr "Weergave Wireframe"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Display Overdraw"
-msgstr ""
+msgstr "Weergave Overdraw"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Display Unshaded"
-msgstr ""
+msgstr "Weergave Zonder Shading"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Environment"
-msgstr ""
+msgstr "Bekijk Omgeving"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Gizmos"
-msgstr ""
+msgstr "Bekijk Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Information"
-msgstr ""
+msgstr "Bekijk Informatie"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "View FPS"
-msgstr "Bekijk Bestanden"
+msgstr "Bekijk FPS"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Half Resolution"
-msgstr "Schaal Selectie"
+msgstr "Halve Resolutie"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Audio Listener"
-msgstr ""
+msgstr "Audio Luisteraar"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Doppler Enable"
-msgstr "Inschakelen"
+msgstr "Inschakelen Doppler"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Freelook Left"
-msgstr ""
+msgstr "Vrijekijk Links"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Freelook Right"
-msgstr ""
+msgstr "Vrijekijk Rechts"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Freelook Forward"
-msgstr "Ga Verder"
+msgstr "Vrijekijk Vooruit"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Freelook Backwards"
-msgstr "Achterwaarts"
+msgstr "Vrijekijk Achteruit"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Freelook Up"
-msgstr ""
+msgstr "Vrijekijk Omhoog"
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Freelook Down"
-msgstr "Scrollwiel Omlaag."
+msgstr "Vrijekijk Omlaag"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Freelook Speed Modifier"
-msgstr ""
+msgstr "Vrijekijk Snelheid Modificator"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "XForm Dialog"
@@ -5739,6 +5723,15 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Item Toevoegen"
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6233,7 +6226,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6380,11 +6375,6 @@ msgid "Delete Item"
msgstr "Verwijder"
#: editor/project_settings_editor.cpp
-#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "Kan niet verbinden met host:"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7453,6 +7443,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8176,12 +8170,22 @@ msgstr ""
"Pad eigenschap moet verwijzen naar een geldige Spatial node om te werken."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Slechts één WorldEnvironment is toegestaan per scene (of set van "
"geïnstantieerde scenes)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8275,6 +8279,10 @@ msgstr "Fout bij het laden van lettertype."
msgid "Invalid font size."
msgstr "Ongeldige lettertype grootte."
+#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Kan niet verbinden met host:"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/pl.po b/editor/translations/pl.po
index 21618953a0..3c8ee72cec 100644
--- a/editor/translations/pl.po
+++ b/editor/translations/pl.po
@@ -8,6 +8,7 @@
# Adrian Węcławski <weclawskiadrian@gmail.com>, 2016.
# aelspire <aelspire@gmail.com>, 2017.
# Daniel Lewan <vision360.daniel@gmail.com>, 2016-2018.
+# Dariusz Król <rexioweb@gmail.com>, 2018.
# heya10 <igor.gielzak@gmail.com>, 2017.
# holistyczny interlokutor <jakubowesmieci@gmail.com>, 2017.
# Kajetan Kuszczyński <kajetanek99@gmail.com>, 2016.
@@ -26,8 +27,8 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-22 08:08+0000\n"
-"Last-Translator: Maksymilian Świąć <maksymilian.swiac@gmail.com>\n"
+"PO-Revision-Date: 2018-04-23 15:40+0000\n"
+"Last-Translator: Dariusz Król <rexioweb@gmail.com>\n"
"Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/"
"godot/pl/>\n"
"Language: pl\n"
@@ -35,7 +36,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -242,7 +243,7 @@ msgstr "Zmień pętlę animacji"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
-msgstr ""
+msgstr "Utwórz klucz dla wpisanej wartości"
#: editor/animation_editor.cpp
msgid "Anim Insert"
@@ -1411,6 +1412,10 @@ msgstr "Wyczyść"
msgid "Clear Output"
msgstr "Wyczyść dane wyjściowe"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "BÅ‚Ä…d podczas zapisu zasobu!"
@@ -3726,6 +3731,16 @@ msgid "Show Guides"
msgstr "Pokaż prowadnice"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Pokaż pozycję początkową"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 widok"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Wyśrodkowywanie na zaznaczeniu"
@@ -4019,6 +4034,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Siatka nie posiada powierzchni z której można utworzyć zarys!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Nie udało się utworzyć zarysu!"
@@ -5730,6 +5749,16 @@ msgid "Checked Item"
msgstr "Zaznaczony element"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Dodaj element"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Zaznaczony element"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Ma"
@@ -6227,8 +6256,10 @@ msgid "Mouse Button"
msgstr "Przycisk myszy"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Nieprawidłowa akcja (wszystko oprócz '/' lub ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6371,10 +6402,6 @@ msgid "Delete Item"
msgstr "Usuń element"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Nie może zawierać '/ 'lub':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Już istnieje"
@@ -7446,6 +7473,10 @@ msgstr "Ustawienia GridMap"
msgid "Pick Distance:"
msgstr "Wybierz odległość:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Generowanie solucji..."
@@ -8139,12 +8170,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "Pole Path musi wskazywać na węzeł Spatial."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Tylko jeden WorldEnvironment jest dozwolony na scenÄ™ (lub zestaw "
"zinstancjonowanych scen)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8243,6 +8284,12 @@ msgstr "BÅ‚Ä…d Å‚adowania fonta."
msgid "Invalid font size."
msgstr "Niepoprawny rozmiar fonta."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Nieprawidłowa akcja (wszystko oprócz '/' lub ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Nie może zawierać '/ 'lub':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/pr.po b/editor/translations/pr.po
index 6029e861fd..94856aa875 100644
--- a/editor/translations/pr.po
+++ b/editor/translations/pr.po
@@ -1385,6 +1385,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3624,6 +3628,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3913,6 +3925,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5588,6 +5604,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6066,7 +6090,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6212,10 +6238,6 @@ msgid "Delete Item"
msgstr "Yar, Blow th' Selected Down!"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7274,6 +7296,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7939,10 +7965,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po
index ae67217cfd..3ad4798ca0 100644
--- a/editor/translations/pt_BR.po
+++ b/editor/translations/pt_BR.po
@@ -4,11 +4,13 @@
# This file is distributed under the same license as the Godot source code.
#
# Allyson Souza <allyson_as@outlook.com>, 2017.
+# Anderson Araujo <anderson.araujoprog@gmail.com>, 2018.
# António Sarmento <antonio.luis.sarmento@gmail.com>, 2016.
# AWK <arthurwk1800@gmail.com>, 2017.
# Francesco Perrotti-Garcia <fpg1503@gmail.com>, 2017.
# George Marques <george@gmarqu.es>, 2016.
# Guilherme Felipe C G Silva <guilhermefelipecgs@gmail.com>, 2017.
+# João Victor Lima <victordevtb@outlook.com>, 2018.
# João Vitor de Oliveira Carlos <lopogax@gmail.com>, 2018.
# Joaquim Ferreira <joaquimferreira1996@bol.com.br>, 2016.
# jonathan railarem <railarem@gmail.com>, 2017.
@@ -19,16 +21,15 @@
# Marcus Correia <marknokalt@live.com>, 2017-2018.
# Michael Alexsander Silva Dias <michaelalexsander@protonmail.com>, 2017-2018.
# Renato Rotenberg <renato.rotenberg@gmail.com>, 2017.
-# Rodolfo R Gomes <rodolforg@gmail.com>, 2017.
+# Rodolfo R Gomes <rodolforg@gmail.com>, 2017-2018.
# Tiago Almeida <thyagoeap@gmail.com>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: 2016-05-30\n"
-"PO-Revision-Date: 2018-02-22 20:49+0000\n"
-"Last-Translator: Michael Alexsander Silva Dias <michaelalexsander@protonmail."
-"com>\n"
+"PO-Revision-Date: 2018-04-30 13:39+0000\n"
+"Last-Translator: Rodolfo R Gomes <rodolforg@gmail.com>\n"
"Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/"
"godot-engine/godot/pt_BR/>\n"
"Language: pt_BR\n"
@@ -36,7 +37,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -44,7 +45,7 @@ msgstr "Desabilitado"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr "Toda a Seleção"
+msgstr "Toda a seleção"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
@@ -775,7 +776,7 @@ msgstr "Doadores"
#: editor/editor_about.cpp
msgid "License"
-msgstr "LIcença"
+msgstr "Licença"
#: editor/editor_about.cpp
msgid "Thirdparty License"
@@ -1413,6 +1414,10 @@ msgstr "Limpar"
msgid "Clear Output"
msgstr "Limpar Saída"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Erro ao salvar Recurso!"
@@ -1654,11 +1659,11 @@ msgstr "Abrir Cena Base"
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
-msgstr "Abri Cena Rápidamente..."
+msgstr "Abrir Cena Rapidamente..."
#: editor/editor_node.cpp
msgid "Quick Open Script.."
-msgstr "Abrir Script Rápidamente..."
+msgstr "Abrir Script Rapidamente..."
#: editor/editor_node.cpp
msgid "Save & Close"
@@ -1977,7 +1982,7 @@ msgstr "Depurar"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
-msgstr "Instalar Depuração Remota"
+msgstr "Distribuir com Depuragem Remota"
#: editor/editor_node.cpp
msgid ""
@@ -1989,7 +1994,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Small Deploy with Network FS"
-msgstr "Instalação Pequena com FS em rede"
+msgstr "Pequeno teste com o sistema de arquivos em rede"
#: editor/editor_node.cpp
msgid ""
@@ -2032,7 +2037,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Scene Changes"
-msgstr "Sincronizar Alterações na Cena"
+msgstr "Sincronizar Mudanças de Cena"
#: editor/editor_node.cpp
msgid ""
@@ -2048,7 +2053,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Script Changes"
-msgstr "Sincronizar Alterações no Script"
+msgstr "Sincronizar Mudanças de Script"
#: editor/editor_node.cpp
msgid ""
@@ -2361,7 +2366,7 @@ msgstr "Inclusivo"
#: editor/editor_profiler.cpp
msgid "Self"
-msgstr "Mesmo"
+msgstr "Self"
#: editor/editor_profiler.cpp
msgid "Frame #:"
@@ -3436,7 +3441,7 @@ msgstr "Oficial"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Testing"
-msgstr "Em teste"
+msgstr "Testando"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Assets ZIP File"
@@ -3721,6 +3726,16 @@ msgid "Show Guides"
msgstr "Mostrar guias"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Ver Origem"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Viewport"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centralizar Seleção"
@@ -4010,6 +4025,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Malha não tem superfície para criar contornos dela!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Não se pôde criar contorno!"
@@ -5297,7 +5316,7 @@ msgstr "Modo Escala (R)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Coords"
-msgstr "Coordenadas Locais"
+msgstr "Local Coords"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Space Mode (%s)"
@@ -5681,6 +5700,16 @@ msgid "Checked Item"
msgstr "Item Checado"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Adicionar Item"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Item Checado"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Tem"
@@ -5726,7 +5755,7 @@ msgstr "Fonte"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Color"
-msgstr "Cor"
+msgstr "Color"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Theme"
@@ -6182,8 +6211,10 @@ msgid "Mouse Button"
msgstr "Botão do Mous"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Ação Inválida (qualquer coisa serve, exceto '/' ou ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6326,10 +6357,6 @@ msgid "Delete Item"
msgstr "Excluir Item"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Não pode conter '/' ou ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Já existe"
@@ -6443,7 +6470,7 @@ msgstr "Remapeamentos por Localidade:"
#: editor/project_settings_editor.cpp
msgid "Locale"
-msgstr "Localidade"
+msgstr "Locale"
#: editor/project_settings_editor.cpp
msgid "Locales Filter"
@@ -6555,7 +6582,7 @@ msgstr "[Vazio]"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr "Definir"
+msgstr "Set"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -6964,7 +6991,7 @@ msgstr "Carregar arquivo de script existente"
#: editor/script_create_dialog.cpp
msgid "Language"
-msgstr "Idioma"
+msgstr "Linguagem"
#: editor/script_create_dialog.cpp
msgid "Inherits"
@@ -7052,7 +7079,7 @@ msgstr "Pilha de Rastreamento (se aplicável):"
#: editor/script_editor_debugger.cpp
msgid "Profiler"
-msgstr "Profiler"
+msgstr "Profilador"
#: editor/script_editor_debugger.cpp
msgid "Monitor"
@@ -7076,11 +7103,11 @@ msgstr "Total:"
#: editor/script_editor_debugger.cpp
msgid "Video Mem"
-msgstr "Memória de Vídeo"
+msgstr "Mem. de Vídeo"
#: editor/script_editor_debugger.cpp
msgid "Resource Path"
-msgstr "Caminho do recurso"
+msgstr "Caminho do Recurso"
#: editor/script_editor_debugger.cpp
msgid "Type"
@@ -7386,6 +7413,10 @@ msgstr "Configurações do GridMap"
msgid "Pick Distance:"
msgstr "Escolha uma Distância:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Gerando solução..."
@@ -7436,7 +7467,7 @@ msgstr "Avisos"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Fim da pilha de rastreamento de exceção interna"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7616,27 +7647,27 @@ msgstr "Condição"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr "Sequência"
+msgstr "Sequence"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr "Trocar"
+msgstr "Switch"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
-msgstr "Iterador"
+msgstr "Iterator"
#: modules/visual_script/visual_script_editor.cpp
msgid "While"
-msgstr "Enquanto"
+msgstr "While"
#: modules/visual_script/visual_script_editor.cpp
msgid "Return"
-msgstr "Retornar"
+msgstr "Return"
#: modules/visual_script/visual_script_editor.cpp
msgid "Call"
-msgstr "Chamar"
+msgstr "Call"
#: modules/visual_script/visual_script_editor.cpp
msgid "Get"
@@ -8097,12 +8128,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "A propriedade Caminho deve apontar para um nó Spatial para funcionar."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"É permitido apenas um nó WorldEnvironment por cena (ou conjunto de cenas "
"instanciadas)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8199,6 +8240,12 @@ msgstr "Erro ao carregar fonte."
msgid "Invalid font size."
msgstr "Tamanho de fonte inválido."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Ação Inválida (qualquer coisa serve, exceto '/' ou ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Não pode conter '/' ou ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/pt_PT.po b/editor/translations/pt_PT.po
index 9f520ddf46..84e80718da 100644
--- a/editor/translations/pt_PT.po
+++ b/editor/translations/pt_PT.po
@@ -17,15 +17,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-24 23:41+0000\n"
-"Last-Translator: Paulo Caldeira <paucal@gmail.com>\n"
+"PO-Revision-Date: 2018-04-25 09:40+0000\n"
+"Last-Translator: João Lopes <linux-man@hotmail.com>\n"
"Language-Team: Portuguese (Portugal) <https://hosted.weblate.org/projects/"
"godot-engine/godot/pt_PT/>\n"
"Language: pt_PT\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -830,31 +830,31 @@ msgstr "Adicionar Efeito"
#: editor/editor_audio_buses.cpp
msgid "Rename Audio Bus"
-msgstr "Mudar Barramento de Ãudio"
+msgstr "Renomear o barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Change Audio Bus Volume"
-msgstr "Alterar Volume do canal áudio"
+msgstr "Alterar Volume do barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Solo"
-msgstr "Alternar solo do canal de áudio"
+msgstr "Alternar solo do barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Mute"
-msgstr "Alternar silêncio do canal áudio"
+msgstr "Alternar silêncio do barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Bypass Effects"
-msgstr "Alternar efeitos bypass do canal de áudio"
+msgstr "Alternar efeitos bypass do barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Select Audio Bus Send"
-msgstr "Selecionar envio do canal áudio"
+msgstr "Selecionar envio do barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus Effect"
-msgstr "Adicionar Efeito de Barramento de Ãudio"
+msgstr "Adicionar Efeito de barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Move Bus Effect"
@@ -866,7 +866,7 @@ msgstr "Apagar Efeito de Barramento"
#: editor/editor_audio_buses.cpp
msgid "Audio Bus, Drag and Drop to rearrange."
-msgstr "Canal áudio, arrastar e largar para reorganizar."
+msgstr "Barramento de áudio, arrastar e largar para reorganizar."
#: editor/editor_audio_buses.cpp
msgid "Solo"
@@ -903,7 +903,7 @@ msgstr "Ãudio"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
-msgstr "Adicionar Barramento de Ãudio"
+msgstr "Adicionar barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Master bus can't be deleted!"
@@ -911,23 +911,23 @@ msgstr "O barramento principal não pode ser removido!"
#: editor/editor_audio_buses.cpp
msgid "Delete Audio Bus"
-msgstr "Apagar Barramento de Ãudio"
+msgstr "Apagar barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Duplicate Audio Bus"
-msgstr "Barramento de Ãudio Duplicado"
+msgstr "Duplicar barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Reset Bus Volume"
-msgstr "Restabelecer Volume do Barramento"
+msgstr "Restabelecer volume do barramento"
#: editor/editor_audio_buses.cpp
msgid "Move Audio Bus"
-msgstr "Mover Barramento de Ãudio"
+msgstr "Mover barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr "Guardar Modelo de Barramento de Ãudio Como.."
+msgstr "Guardar Modelo do barramento de áudio como.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
@@ -935,7 +935,7 @@ msgstr "Localização para o Novo Modelo.."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr "Abrir Modelo de Barramento de Ãudio"
+msgstr "Abrir Modelo de barramento de áudio"
#: editor/editor_audio_buses.cpp
msgid "There is no 'res://default_bus_layout.tres' file."
@@ -969,7 +969,7 @@ msgstr "Guardar Como"
#: editor/editor_audio_buses.cpp
msgid "Save this Bus Layout to a file."
-msgstr "Guardar este Modelo de Barramento para um Ficheiro."
+msgstr "Guardar este Modelo de Barramento para um ficheiro."
#: editor/editor_audio_buses.cpp editor/import_dock.cpp
msgid "Load Default"
@@ -1405,6 +1405,10 @@ msgstr "Limpar"
msgid "Clear Output"
msgstr "Limpar Saída"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Erro ao guardar recurso!"
@@ -3706,6 +3710,16 @@ msgid "Show Guides"
msgstr "Mostrar guias"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Ver origem"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Vista"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Centrar seleção"
@@ -3995,6 +4009,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "A Mesh não tem superfície para criar contornos!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Contorno não pode ser criado!"
@@ -5663,6 +5681,16 @@ msgid "Checked Item"
msgstr "Item verificado"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Adicionar item"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Item verificado"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Tem"
@@ -5983,8 +6011,8 @@ msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
msgstr ""
-"Não foi possível carregar o project.godot no caminho do projeto. Poderá "
-"estar em falta ou corrompido."
+"Não foi possível carregar o project.godot no caminho do projeto (erro %d). "
+"Poderá estar em falta ou corrompido."
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
@@ -6161,8 +6189,10 @@ msgid "Mouse Button"
msgstr "Botão do rato"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Ação inválida (tudo menos '/' ou ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6305,10 +6335,6 @@ msgid "Delete Item"
msgstr "Apagar item"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Não pode conter '/' ou ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Já existe"
@@ -7027,7 +7053,7 @@ msgstr "Erros:"
#: editor/script_editor_debugger.cpp
msgid "Stack Trace (if applicable):"
-msgstr "Rastreamento de pilha (se aplicável):"
+msgstr "Stack Trace (se aplicável):"
#: editor/script_editor_debugger.cpp
msgid "Profiler"
@@ -7059,7 +7085,7 @@ msgstr "Memória Vídeo"
#: editor/script_editor_debugger.cpp
msgid "Resource Path"
-msgstr "Caminho de recurso"
+msgstr "Caminho do recurso"
#: editor/script_editor_debugger.cpp
msgid "Type"
@@ -7075,7 +7101,7 @@ msgstr "Uso"
#: editor/script_editor_debugger.cpp
msgid "Misc"
-msgstr "Misc"
+msgstr "Diversos"
#: editor/script_editor_debugger.cpp
msgid "Clicked Control:"
@@ -7366,6 +7392,10 @@ msgstr "Configurações do GridMap"
msgid "Pick Distance:"
msgstr "Distância de escolha:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "A gerar soluções..."
@@ -7416,7 +7446,7 @@ msgstr "Avisos"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Fim do stack trace de exceção interna"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7448,12 +7478,11 @@ msgstr "O Nó retornou uma sequência de saída (output) incorreta: "
#: modules/visual_script/visual_script.cpp
msgid "Found sequence bit but not the node in the stack, report bug!"
-msgstr ""
-"A sequência foi encontrada mas não o Nó na pilha (stack), faça report de bug!"
+msgstr "Foi encontrada o bit da sequência mas não o Nó na pilha, relate o bug!"
#: modules/visual_script/visual_script.cpp
msgid "Stack overflow with stack depth: "
-msgstr "Stack overflow com a profundidade da pilha (stack): "
+msgstr "Pilha cheia com a profundidade da pilha: "
#: modules/visual_script/visual_script_editor.cpp
msgid "Change Signal Arguments"
@@ -8078,12 +8107,22 @@ msgstr ""
"válido."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Apenas um WorldEnvironment é permitido por Cena (ou grupo de cenas "
"instanciadas)."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8180,6 +8219,12 @@ msgstr "Erro ao carregar letra."
msgid "Invalid font size."
msgstr "Tamanho de letra inválido."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Ação inválida (tudo menos '/' ou ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Não pode conter '/' ou ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/ro.po b/editor/translations/ro.po
index 1d89dd74ea..e5b3fcbad7 100644
--- a/editor/translations/ro.po
+++ b/editor/translations/ro.po
@@ -3,13 +3,14 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
+# Filip <filipanton@tutanota.com>, 2018.
# TigerxWood <TigerxWood@gmail.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-20 08:55+0000\n"
-"Last-Translator: TigerxWood <TigerxWood@gmail.com>\n"
+"PO-Revision-Date: 2018-05-02 18:03+0000\n"
+"Last-Translator: Filip <filipanton@tutanota.com>\n"
"Language-Team: Romanian <https://hosted.weblate.org/projects/godot-engine/"
"godot/ro/>\n"
"Language: ro\n"
@@ -17,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -25,15 +26,15 @@ msgstr "Dezactivat"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr "Toate selecțiile"
+msgstr "Toată selecția"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
-msgstr "Anim Schimbare timp cadre cheie"
+msgstr "Anim Schimbați Timpul Cadru Cheie"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr "Anim Schimbare tranziție"
+msgstr "Anim Schimbați Tranziție"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
@@ -49,149 +50,149 @@ msgstr "Anim Schimbare apelare"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr "Anim Adăugare pistă"
+msgstr "Anim Adăugați Pistă"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr "Anim Clonare chei"
+msgstr "Anim Clonare Chei"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr "Mutare sus pistă anim"
+msgstr "Mută Pista Anim Sus"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr "Mutare jos pistă anim"
+msgstr "Mută Pista Anim Jos"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr "Eliminare pistă anim"
+msgstr "Elimină Pista Anim"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
-msgstr "Setare tranziții la:"
+msgstr "Setează Tranziții la:"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr "Redenumire pistă anim"
+msgstr "Redenumește Pista Anim"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr ""
+msgstr "Anim Schimbați Interpolarea Pistei"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr ""
+msgstr "Anim Schimbați Modul Valorii Pistei"
#: editor/animation_editor.cpp
msgid "Anim Track Change Wrap Mode"
-msgstr ""
+msgstr "Anim Schimbați Modul Învelirii Pistei"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
-msgstr ""
+msgstr "Editați Curba Nodului"
#: editor/animation_editor.cpp
msgid "Edit Selection Curve"
-msgstr ""
+msgstr "Editați Curba Selecției"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr ""
+msgstr "Anim Ștergeți Cheile"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr ""
+msgstr "Duplicați Selecția"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr ""
+msgstr "Duplicați Transpunerea"
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr ""
+msgstr "Elminați Selecția"
#: editor/animation_editor.cpp
msgid "Continuous"
-msgstr ""
+msgstr "Continuu"
#: editor/animation_editor.cpp
msgid "Discrete"
-msgstr ""
+msgstr "Discret"
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "Trăgaci"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr ""
+msgstr "Anim Adaugați Cheie"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr ""
+msgstr "Anim Mutați Cheie"
#: editor/animation_editor.cpp
msgid "Scale Selection"
-msgstr ""
+msgstr "Scalați Selecția"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr ""
+msgstr "Scalați De La Cursor"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
-msgstr ""
+msgstr "Mergeți la Pasul Următor"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
-msgstr ""
+msgstr "Mergeți la Pasul Anterior"
#: editor/animation_editor.cpp editor/plugins/curve_editor_plugin.cpp
#: editor/property_editor.cpp
msgid "Linear"
-msgstr ""
+msgstr "Linear"
#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
msgid "Constant"
-msgstr ""
+msgstr "Constant"
#: editor/animation_editor.cpp
msgid "In"
-msgstr ""
+msgstr "ÃŽn"
#: editor/animation_editor.cpp
msgid "Out"
-msgstr ""
+msgstr "Afară"
#: editor/animation_editor.cpp
msgid "In-Out"
-msgstr ""
+msgstr "Înăuntru-Afară"
#: editor/animation_editor.cpp
msgid "Out-In"
-msgstr ""
+msgstr "Afară-Înăuntru"
#: editor/animation_editor.cpp
msgid "Transitions"
-msgstr ""
+msgstr "Tranziții"
#: editor/animation_editor.cpp
msgid "Optimize Animation"
-msgstr ""
+msgstr "Optimizați Animația"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation"
-msgstr ""
+msgstr "Curățați Animația"
#: editor/animation_editor.cpp
msgid "Create NEW track for %s and insert key?"
-msgstr ""
+msgstr "Creați pistă NOUA pentru %s și inserați cheie?"
#: editor/animation_editor.cpp
msgid "Create %d NEW tracks and insert keys?"
-msgstr ""
+msgstr "Creați %d piste NOI și inserați cheie?"
#: editor/animation_editor.cpp editor/create_dialog.cpp
#: editor/editor_audio_buses.cpp editor/plugins/abstract_polygon_2d_editor.cpp
@@ -199,270 +200,272 @@ msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp editor/script_create_dialog.cpp
msgid "Create"
-msgstr ""
+msgstr "Creați"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
-msgstr ""
+msgstr "Anim Creați și Inserați"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
-msgstr ""
+msgstr "Anim Inserați Pistă și Cheie"
#: editor/animation_editor.cpp
msgid "Anim Insert Key"
-msgstr ""
+msgstr "Anim Inserați Cheie"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr ""
+msgstr "Schimbați Lung Anim"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr ""
+msgstr "Schimbați Bucla Anim"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
-msgstr ""
+msgstr "Anim Creați Cheie Valoare Typed"
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr ""
+msgstr "Anim Inserați"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
-msgstr ""
+msgstr "Anim Scalați Cheile"
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr ""
+msgstr "Anim Adăugați Pistă Chemare"
#: editor/animation_editor.cpp
msgid "Animation zoom."
-msgstr ""
+msgstr "Zoom Animație."
#: editor/animation_editor.cpp
msgid "Length (s):"
-msgstr ""
+msgstr "Lungime (s):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr ""
+msgstr "Lungime Animație (în secunde)."
#: editor/animation_editor.cpp
msgid "Step (s):"
-msgstr ""
+msgstr "Pas (s):"
#: editor/animation_editor.cpp
msgid "Cursor step snap (in seconds)."
-msgstr ""
+msgstr "Pas Bruscare Cursor (în secunde)."
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
-msgstr ""
+msgstr "Activați / Dezactivați Repetiția în Animație."
#: editor/animation_editor.cpp
msgid "Add new tracks."
-msgstr ""
+msgstr "Adăugați piste noi."
#: editor/animation_editor.cpp
msgid "Move current track up."
-msgstr ""
+msgstr "Mișcați pista curentă sus."
#: editor/animation_editor.cpp
msgid "Move current track down."
-msgstr ""
+msgstr "Mișcați pista curentă jos."
#: editor/animation_editor.cpp
msgid "Remove selected track."
-msgstr ""
+msgstr "Ștergeți pista selectată."
#: editor/animation_editor.cpp
msgid "Track tools"
-msgstr ""
+msgstr "Unelte Pistă"
#: editor/animation_editor.cpp
msgid "Enable editing of individual keys by clicking them."
-msgstr ""
+msgstr "Activați editarea de chei individuale prin clic."
#: editor/animation_editor.cpp
msgid "Anim. Optimizer"
-msgstr ""
+msgstr "Anim. Optimizator"
#: editor/animation_editor.cpp
msgid "Max. Linear Error:"
-msgstr ""
+msgstr "Eroare Lineară Max:"
#: editor/animation_editor.cpp
msgid "Max. Angular Error:"
-msgstr ""
+msgstr "Eroare Angulară Max:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr ""
+msgstr "Max Unghi Optimizabil:"
#: editor/animation_editor.cpp
msgid "Optimize"
-msgstr ""
+msgstr "Optimizați"
#: editor/animation_editor.cpp
msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
-msgstr ""
+msgstr "Selectați un Animator din Copacul Scenă să editați animații."
#: editor/animation_editor.cpp
msgid "Key"
-msgstr ""
+msgstr "Cheie"
#: editor/animation_editor.cpp
msgid "Transition"
-msgstr ""
+msgstr "Tranziție"
#: editor/animation_editor.cpp
msgid "Scale Ratio:"
-msgstr ""
+msgstr "Proporție Scalare:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr ""
+msgstr "Chemați Funcții în Care Nod?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
-msgstr ""
+msgstr "Ștergeți chei inoperabile"
#: editor/animation_editor.cpp
msgid "Remove unresolved and empty tracks"
-msgstr ""
+msgstr "Ștergeți piste nerezolvate sau goale"
#: editor/animation_editor.cpp
msgid "Clean-up all animations"
-msgstr ""
+msgstr "Curățați toate animațiile"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation(s) (NO UNDO!)"
-msgstr ""
+msgstr "Curățați Animațiile (FĂRĂ ANULARE!)"
#: editor/animation_editor.cpp
msgid "Clean-Up"
-msgstr ""
+msgstr "Curățați"
#: editor/array_property_edit.cpp
msgid "Resize Array"
-msgstr ""
+msgstr "Redimensionați Array-ul"
#: editor/array_property_edit.cpp
msgid "Change Array Value Type"
-msgstr ""
+msgstr "Schimbați Tipul Array-ului"
#: editor/array_property_edit.cpp
msgid "Change Array Value"
-msgstr ""
+msgstr "Schimbați Valoarea Array-ului"
#: editor/code_editor.cpp
msgid "Go to Line"
-msgstr ""
+msgstr "Duceți-vă la Linie"
#: editor/code_editor.cpp
msgid "Line Number:"
-msgstr ""
+msgstr "Linia Numărul:"
#: editor/code_editor.cpp
msgid "No Matches"
-msgstr ""
+msgstr "Nici o Potrivire"
#: editor/code_editor.cpp
msgid "Replaced %d occurrence(s)."
-msgstr ""
+msgstr "ÃŽnlocuit %d potriviri."
#: editor/code_editor.cpp
msgid "Match Case"
-msgstr ""
+msgstr "Potrivește Caz-ul"
#: editor/code_editor.cpp
msgid "Whole Words"
-msgstr ""
+msgstr "Cuvinte Complete"
#: editor/code_editor.cpp
msgid "Replace"
-msgstr ""
+msgstr "Înlocuiți"
#: editor/code_editor.cpp
msgid "Replace All"
-msgstr ""
+msgstr "Înlocuiți Tot"
#: editor/code_editor.cpp
msgid "Selection Only"
-msgstr ""
+msgstr "Numai Selecția"
#: editor/code_editor.cpp
msgid "Zoom In"
-msgstr ""
+msgstr "Zoom-ați În"
#: editor/code_editor.cpp
msgid "Zoom Out"
-msgstr ""
+msgstr "Zoom-ați Afară"
#: editor/code_editor.cpp
msgid "Reset Zoom"
-msgstr ""
+msgstr "Resetați Zoom-area"
#: editor/code_editor.cpp editor/script_editor_debugger.cpp
msgid "Line:"
-msgstr ""
+msgstr "Linie:"
#: editor/code_editor.cpp
msgid "Col:"
-msgstr ""
+msgstr "Col:"
#: editor/connections_dialog.cpp
msgid "Method in target Node must be specified!"
-msgstr ""
+msgstr "Metoda din Nod-ul țintă trebuie specificată!"
#: editor/connections_dialog.cpp
msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
msgstr ""
+"Metoda țintă nu există! Specificați o metodă validă sau atașați un script la "
+"Nod-ul țintă."
#: editor/connections_dialog.cpp
msgid "Connect To Node:"
-msgstr ""
+msgstr "Conectați la Nod:"
#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp
msgid "Add"
-msgstr ""
+msgstr "Adăugați"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
#: editor/project_settings_editor.cpp
msgid "Remove"
-msgstr ""
+msgstr "Ștergeți"
#: editor/connections_dialog.cpp
msgid "Add Extra Call Argument:"
-msgstr ""
+msgstr "Adăugați Extra Argument de Chemare:"
#: editor/connections_dialog.cpp
msgid "Extra Call Arguments:"
-msgstr ""
+msgstr "Extra Argumente de Chemare:"
#: editor/connections_dialog.cpp
msgid "Path to Node:"
-msgstr ""
+msgstr "Drum la Nod:"
#: editor/connections_dialog.cpp
msgid "Make Function"
-msgstr ""
+msgstr "Faceți Funcția"
#: editor/connections_dialog.cpp
msgid "Deferred"
-msgstr ""
+msgstr "Amânat(ă)"
#: editor/connections_dialog.cpp
msgid "Oneshot"
-msgstr ""
+msgstr "Oneshot"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/export_template_manager.cpp
@@ -476,143 +479,147 @@ msgstr ""
#: editor/run_settings_dialog.cpp editor/settings_config_dialog.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Close"
-msgstr ""
+msgstr "Aproape"
#: editor/connections_dialog.cpp
msgid "Connect"
-msgstr ""
+msgstr "Conectați"
#: editor/connections_dialog.cpp
msgid "Connect '%s' to '%s'"
-msgstr ""
+msgstr "Conectați '%s' la '%s'"
#: editor/connections_dialog.cpp
msgid "Connecting Signal:"
-msgstr ""
+msgstr "Conectați Semnal:"
#: editor/connections_dialog.cpp
msgid "Disconnect '%s' from '%s'"
-msgstr ""
+msgstr "Deconectați '%s' de la '%s'"
#: editor/connections_dialog.cpp
msgid "Connect.."
-msgstr ""
+msgstr "Conectați.."
#: editor/connections_dialog.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Disconnect"
-msgstr ""
+msgstr "Deconectați"
#: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp
msgid "Signals"
-msgstr ""
+msgstr "Semnale"
#: editor/create_dialog.cpp
msgid "Change %s Type"
-msgstr ""
+msgstr "Schimbați Tipul %s"
#: editor/create_dialog.cpp editor/project_settings_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Change"
-msgstr ""
+msgstr "Schimbați"
#: editor/create_dialog.cpp
msgid "Create New %s"
-msgstr ""
+msgstr "Creați %s Nou"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
msgid "Favorites:"
-msgstr ""
+msgstr "Favorite:"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
msgid "Recent:"
-msgstr ""
+msgstr "Recent:"
#: editor/create_dialog.cpp editor/editor_node.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
#: editor/quick_open.cpp
msgid "Search:"
-msgstr ""
+msgstr "Cautați:"
#: editor/create_dialog.cpp editor/editor_help.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
#: editor/quick_open.cpp
msgid "Matches:"
-msgstr ""
+msgstr "Potriviri:"
#: editor/create_dialog.cpp editor/editor_help.cpp
#: editor/plugins/asset_library_editor_plugin.cpp editor/property_selector.cpp
#: editor/script_editor_debugger.cpp
msgid "Description:"
-msgstr ""
+msgstr "Descripție:"
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
-msgstr ""
+msgstr "Cautați Înlocuitor Pentru:"
#: editor/dependency_editor.cpp
msgid "Dependencies For:"
-msgstr ""
+msgstr "Dependențe Pentru:"
#: editor/dependency_editor.cpp
msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
msgstr ""
+"Scena '%s' este în proces de editare. \n"
+"Modificările nu vor avea efect dacă nu reîncărcați."
#: editor/dependency_editor.cpp
msgid ""
"Resource '%s' is in use.\n"
"Changes will take effect when reloaded."
msgstr ""
+"Resursa '%s' este în folosință.\n"
+"Modificările vor avea efect după ce reîncărcați."
#: editor/dependency_editor.cpp
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "Dependencies"
-msgstr ""
+msgstr "Dependențe"
#: editor/dependency_editor.cpp
msgid "Resource"
-msgstr ""
+msgstr "Resursă"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings_editor.cpp
#: editor/script_create_dialog.cpp
msgid "Path"
-msgstr ""
+msgstr "Cale"
#: editor/dependency_editor.cpp
msgid "Dependencies:"
-msgstr ""
+msgstr "Dependințe:"
#: editor/dependency_editor.cpp
msgid "Fix Broken"
-msgstr ""
+msgstr "Reparați Stricat"
#: editor/dependency_editor.cpp
msgid "Dependency Editor"
-msgstr ""
+msgstr "Editor de Dependență"
#: editor/dependency_editor.cpp
msgid "Search Replacement Resource:"
-msgstr ""
+msgstr "Cautați Înlocuitor Resursă:"
#: editor/dependency_editor.cpp editor/editor_file_dialog.cpp
#: editor/editor_help.cpp editor/editor_node.cpp editor/filesystem_dock.cpp
#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
#: editor/quick_open.cpp scene/gui/file_dialog.cpp
msgid "Open"
-msgstr ""
+msgstr "Deschide"
#: editor/dependency_editor.cpp
msgid "Owners Of:"
-msgstr ""
+msgstr "Stăpâni La:"
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
-msgstr ""
+msgstr "Ștergeți fișierele selectate din proiect? (fără anulare)"
#: editor/dependency_editor.cpp
msgid ""
@@ -620,54 +627,57 @@ msgid ""
"work.\n"
"Remove them anyway? (no undo)"
msgstr ""
+"Fișierele în proces de ștergere sunt necesare pentru alte resurse ca ele să "
+"sa funcționeze.\n"
+"Ștergeți oricum? (fără anulare)"
#: editor/dependency_editor.cpp
msgid "Cannot remove:"
-msgstr ""
+msgstr "Nu se poate șterge:"
#: editor/dependency_editor.cpp
msgid "Error loading:"
-msgstr ""
+msgstr "Eroare încărcând:"
#: editor/dependency_editor.cpp
msgid "Scene failed to load due to missing dependencies:"
-msgstr ""
+msgstr "Scena nu a putut fi încărcata deoarece are dependențe în lipsa:"
#: editor/dependency_editor.cpp editor/editor_node.cpp
msgid "Open Anyway"
-msgstr ""
+msgstr "Deschide Oricum"
#: editor/dependency_editor.cpp
msgid "Which action should be taken?"
-msgstr ""
+msgstr "Ce acțiune trebuie să fie luată?"
#: editor/dependency_editor.cpp
msgid "Fix Dependencies"
-msgstr ""
+msgstr "Rezolvă dependențele"
#: editor/dependency_editor.cpp
msgid "Errors loading!"
-msgstr ""
+msgstr "Erori încărcând!"
#: editor/dependency_editor.cpp
msgid "Permanently delete %d item(s)? (No undo!)"
-msgstr ""
+msgstr "Ștergeți permanent %d articol(e)? (Fără anulare!)"
#: editor/dependency_editor.cpp
msgid "Owns"
-msgstr ""
+msgstr "Deține"
#: editor/dependency_editor.cpp
msgid "Resources Without Explicit Ownership:"
-msgstr ""
+msgstr "Resurse Fără Deținere Explicită:"
#: editor/dependency_editor.cpp editor/editor_node.cpp
msgid "Orphan Resource Explorer"
-msgstr ""
+msgstr "Explorator de Resurse Orfane"
#: editor/dependency_editor.cpp
msgid "Delete selected files?"
-msgstr ""
+msgstr "Ştergeți fişierele selectate?"
#: editor/dependency_editor.cpp editor/editor_audio_buses.cpp
#: editor/editor_file_dialog.cpp editor/editor_node.cpp
@@ -675,83 +685,83 @@ msgstr ""
#: editor/project_export.cpp editor/project_settings_editor.cpp
#: editor/scene_tree_dock.cpp
msgid "Delete"
-msgstr ""
+msgstr "Ștergeți"
#: editor/dictionary_property_edit.cpp
msgid "Change Dictionary Key"
-msgstr ""
+msgstr "Schimbați Cheie Dicţionar"
#: editor/dictionary_property_edit.cpp
msgid "Change Dictionary Value"
-msgstr ""
+msgstr "Schimbaţi Valoarea Dicţionar"
#: editor/editor_about.cpp
msgid "Thanks from the Godot community!"
-msgstr ""
+msgstr "Mulțumesc din partea comunităţii Godot!"
#: editor/editor_about.cpp
msgid "Thanks!"
-msgstr ""
+msgstr "Mulţumiri!"
#: editor/editor_about.cpp
msgid "Godot Engine contributors"
-msgstr ""
+msgstr "Contribuabili Motor Godot"
#: editor/editor_about.cpp
msgid "Project Founders"
-msgstr ""
+msgstr "Fondatorii Proiectului"
#: editor/editor_about.cpp
msgid "Lead Developer"
-msgstr ""
+msgstr "Dezvoltator Principal"
#: editor/editor_about.cpp
msgid "Project Manager "
-msgstr ""
+msgstr "Manager de Proiect "
#: editor/editor_about.cpp
msgid "Developers"
-msgstr ""
+msgstr "Dezvoltatori"
#: editor/editor_about.cpp
msgid "Authors"
-msgstr ""
+msgstr "Autori"
#: editor/editor_about.cpp
msgid "Platinum Sponsors"
-msgstr ""
+msgstr "Sponsori Platină"
#: editor/editor_about.cpp
msgid "Gold Sponsors"
-msgstr ""
+msgstr "Sponsori Aur"
#: editor/editor_about.cpp
msgid "Mini Sponsors"
-msgstr ""
+msgstr "Mini Sponsori"
#: editor/editor_about.cpp
msgid "Gold Donors"
-msgstr ""
+msgstr "Donatori de Aur"
#: editor/editor_about.cpp
msgid "Silver Donors"
-msgstr ""
+msgstr "Donatori de Argint"
#: editor/editor_about.cpp
msgid "Bronze Donors"
-msgstr ""
+msgstr "Donatori de Bronz"
#: editor/editor_about.cpp
msgid "Donors"
-msgstr ""
+msgstr "Donatori"
#: editor/editor_about.cpp
msgid "License"
-msgstr ""
+msgstr "Licență"
#: editor/editor_about.cpp
msgid "Thirdparty License"
-msgstr ""
+msgstr "Licenţe Thirdparty"
#: editor/editor_about.cpp
msgid ""
@@ -760,338 +770,347 @@ msgid ""
"is an exhaustive list of all such thirdparty components with their "
"respective copyright statements and license terms."
msgstr ""
+"Motorul Godot se bazează pe un număr de biblioteci thirdparty gratis și "
+"opensource, toate compatibile cu termenii licenţei MIT ai lui. Mai jos este "
+"o listă exhaustivă a tuturor acestor componente de thirdparty cu declaraţii "
+"de autor respective şi termenii licenței."
#: editor/editor_about.cpp
msgid "All Components"
-msgstr ""
+msgstr "Toate Componentele"
#: editor/editor_about.cpp
msgid "Components"
-msgstr ""
+msgstr "Componente"
#: editor/editor_about.cpp
msgid "Licenses"
-msgstr ""
+msgstr "Licențe"
#: editor/editor_asset_installer.cpp editor/project_manager.cpp
msgid "Error opening package file, not in zip format."
-msgstr ""
+msgstr "Eroare la deschiderea fişierului pachet, nu este în format zip."
#: editor/editor_asset_installer.cpp
msgid "Uncompressing Assets"
-msgstr ""
+msgstr "Decompresez Active"
#: editor/editor_asset_installer.cpp editor/project_manager.cpp
msgid "Package Installed Successfully!"
-msgstr ""
+msgstr "Pachet Instalat cu Succes!"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Success!"
-msgstr ""
+msgstr "Succes!"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Install"
-msgstr ""
+msgstr "Instalați"
#: editor/editor_asset_installer.cpp
msgid "Package Installer"
-msgstr ""
+msgstr "Instalator de Pachet"
#: editor/editor_audio_buses.cpp
msgid "Speakers"
-msgstr ""
+msgstr "Difuzoare"
#: editor/editor_audio_buses.cpp
msgid "Add Effect"
-msgstr ""
+msgstr "Adaugă Efect"
#: editor/editor_audio_buses.cpp
msgid "Rename Audio Bus"
-msgstr ""
+msgstr "Redenumiţi Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Change Audio Bus Volume"
-msgstr ""
+msgstr "Schimbați Volumul Pistei Audio"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Solo"
-msgstr ""
+msgstr "Comutați Pista Audio Singură"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Mute"
-msgstr ""
+msgstr "Comutați Pista Audio Mută"
#: editor/editor_audio_buses.cpp
msgid "Toggle Audio Bus Bypass Effects"
-msgstr ""
+msgstr "Comutați Efecte de Ocolire Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Select Audio Bus Send"
-msgstr ""
+msgstr "Selectați Pista Audio Trimitere"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus Effect"
-msgstr ""
+msgstr "Adaugați Efect Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Move Bus Effect"
-msgstr ""
+msgstr "Mutați Pista Efect"
#: editor/editor_audio_buses.cpp
msgid "Delete Bus Effect"
-msgstr ""
+msgstr "Ștergeți Pista Efect"
#: editor/editor_audio_buses.cpp
msgid "Audio Bus, Drag and Drop to rearrange."
-msgstr ""
+msgstr "Pista Audio, Trageți și Plasați pentru a rearanja."
#: editor/editor_audio_buses.cpp
msgid "Solo"
-msgstr ""
+msgstr "Singură"
#: editor/editor_audio_buses.cpp
msgid "Mute"
-msgstr ""
+msgstr "Mut"
#: editor/editor_audio_buses.cpp
msgid "Bypass"
-msgstr ""
+msgstr "Ocolire"
#: editor/editor_audio_buses.cpp
msgid "Bus options"
-msgstr ""
+msgstr "Opțiuni Pistă Audio"
#: editor/editor_audio_buses.cpp editor/filesystem_dock.cpp
#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Duplicate"
-msgstr ""
+msgstr "Duplicați"
#: editor/editor_audio_buses.cpp
msgid "Reset Volume"
-msgstr ""
+msgstr "Resetați Volumul"
#: editor/editor_audio_buses.cpp
msgid "Delete Effect"
-msgstr ""
+msgstr "Ștergeți Efectul"
#: editor/editor_audio_buses.cpp
msgid "Audio"
-msgstr ""
+msgstr "Audio"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
-msgstr ""
+msgstr "Adaugă Pistă Audio"
#: editor/editor_audio_buses.cpp
msgid "Master bus can't be deleted!"
-msgstr ""
+msgstr "Imposibil de Șters Pistă Audio Master!"
#: editor/editor_audio_buses.cpp
msgid "Delete Audio Bus"
-msgstr ""
+msgstr "Ştergeţi Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Duplicate Audio Bus"
-msgstr ""
+msgstr "Duplicați Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Reset Bus Volume"
-msgstr ""
+msgstr "Resetați Volumul Pistei Audio"
#: editor/editor_audio_buses.cpp
msgid "Move Audio Bus"
-msgstr ""
+msgstr "Mutați Pista Audio"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Salvați Pista Audio Șablon Ca.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Locație pentru Noul Șablon..."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Deschideți Șablon Pistă Audio"
#: editor/editor_audio_buses.cpp
msgid "There is no 'res://default_bus_layout.tres' file."
-msgstr ""
+msgstr "Nu există nici un fişier 'res://default_bus_layout.tres'."
#: editor/editor_audio_buses.cpp
msgid "Invalid file, not an audio bus layout."
-msgstr ""
+msgstr "Fişier nevalid, nu un șablon de pistă audio."
#: editor/editor_audio_buses.cpp
msgid "Add Bus"
-msgstr ""
+msgstr "Adaugați Pistă Audio"
#: editor/editor_audio_buses.cpp
msgid "Create a new Bus Layout."
-msgstr ""
+msgstr "Creaţi un Șablon nou Pistă Audio."
#: editor/editor_audio_buses.cpp editor/property_editor.cpp
#: editor/script_create_dialog.cpp
msgid "Load"
-msgstr ""
+msgstr "Încărcați"
#: editor/editor_audio_buses.cpp
msgid "Load an existing Bus Layout."
-msgstr ""
+msgstr "Încărcaţi un Șablon de Pistă Audio existent."
#: editor/editor_audio_buses.cpp
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Save As"
-msgstr ""
+msgstr "Salvați Ca"
#: editor/editor_audio_buses.cpp
msgid "Save this Bus Layout to a file."
-msgstr ""
+msgstr "Salvaţi acest Șablon Pistă Audio într-un fişier."
#: editor/editor_audio_buses.cpp editor/import_dock.cpp
msgid "Load Default"
-msgstr ""
+msgstr "Încărcați Implicit"
#: editor/editor_audio_buses.cpp
msgid "Load the default Bus Layout."
-msgstr ""
+msgstr "Încărcat Șablonul Pistă Audio implicit."
#: editor/editor_autoload_settings.cpp
msgid "Invalid name."
-msgstr ""
+msgstr "Nume nevalid."
#: editor/editor_autoload_settings.cpp
msgid "Valid characters:"
-msgstr ""
+msgstr "Caractere valide:"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing engine class name."
msgstr ""
+"Nume nevalid. Nu trebuie să se lovească cu un nume de clasa deja existent în "
+"motor."
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing buit-in type name."
msgstr ""
+"Nume nevalid. Nu trebuie să se lovească cu un nume de tip deja existent în "
+"motor tip."
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing global constant name."
msgstr ""
+"Nume nevalid. Nu trebuie să se lovească cu un nume ce constante globale."
#: editor/editor_autoload_settings.cpp
msgid "Invalid Path."
-msgstr ""
+msgstr "Cale nevalidă."
#: editor/editor_autoload_settings.cpp
msgid "File does not exist."
-msgstr ""
+msgstr "Fișierul nu există."
#: editor/editor_autoload_settings.cpp
msgid "Not in resource path."
-msgstr ""
+msgstr "Nu în calea de resurse."
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
-msgstr ""
+msgstr "Adaugați AutoLoad"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
-msgstr ""
+msgstr "AutoLoad '%s' există deja!"
#: editor/editor_autoload_settings.cpp
msgid "Rename Autoload"
-msgstr ""
+msgstr "Redenumiţi Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Toggle AutoLoad Globals"
-msgstr ""
+msgstr "Comutați Globale AutoLoad"
#: editor/editor_autoload_settings.cpp
msgid "Move Autoload"
-msgstr ""
+msgstr "Mutați Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Remove Autoload"
-msgstr ""
+msgstr "Eliminați Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Enable"
-msgstr ""
+msgstr "Activați"
#: editor/editor_autoload_settings.cpp
msgid "Rearrange Autoloads"
-msgstr ""
+msgstr "Rearanjați Autoload-urile"
#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
msgid "Path:"
-msgstr ""
+msgstr "Cale:"
#: editor/editor_autoload_settings.cpp
msgid "Node Name:"
-msgstr ""
+msgstr "Nume Nod:"
#: editor/editor_autoload_settings.cpp editor/editor_profiler.cpp
#: editor/project_manager.cpp editor/settings_config_dialog.cpp
msgid "Name"
-msgstr ""
+msgstr "Nume"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
-msgstr ""
+msgstr "Singleton"
#: editor/editor_data.cpp
msgid "Updating Scene"
-msgstr ""
+msgstr "Scena se Actualizează"
#: editor/editor_data.cpp
msgid "Storing local changes.."
-msgstr ""
+msgstr "Modificările locale se stochează..."
#: editor/editor_data.cpp
msgid "Updating scene.."
-msgstr ""
+msgstr "Scena se Actualizează.."
#: editor/editor_data.cpp
msgid "[empty]"
-msgstr ""
+msgstr "[gol]"
#: editor/editor_data.cpp
msgid "[unsaved]"
-msgstr ""
+msgstr "[nesalvat]"
#: editor/editor_dir_dialog.cpp
msgid "Please select a base directory first"
-msgstr ""
+msgstr "Vă rugăm să selectaţi mai întâi un director de baza"
#: editor/editor_dir_dialog.cpp
msgid "Choose a Directory"
-msgstr ""
+msgstr "Alegeţi un Director"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp
msgid "Create Folder"
-msgstr ""
+msgstr "Creați Director"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp
#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
#: scene/gui/file_dialog.cpp
msgid "Name:"
-msgstr ""
+msgstr "Nume:"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp
msgid "Could not create folder."
-msgstr ""
+msgstr "Directorul nu a putut fi creat."
#: editor/editor_dir_dialog.cpp
msgid "Choose"
-msgstr ""
+msgstr "Alegeți"
#: editor/editor_export.cpp
msgid "Storing File:"
-msgstr ""
+msgstr "Fişierul se Stochează:"
#: editor/editor_export.cpp
msgid "Packing"
@@ -1371,6 +1390,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3590,6 +3613,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3875,6 +3906,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5536,6 +5571,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6011,7 +6054,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6155,10 +6200,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7197,6 +7238,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7833,10 +7878,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/ru.po b/editor/translations/ru.po
index 67e02b9ce8..9ddbc965e5 100644
--- a/editor/translations/ru.po
+++ b/editor/translations/ru.po
@@ -5,7 +5,9 @@
#
# Artem Varaksa <aymfst@gmail.com>, 2018.
# B10nicMachine <shumik1337@gmail.com>, 2017.
+# Chaosus89 <chaosus89@gmail.com>, 2018.
# DimOkGamer <dimokgamer@gmail.com>, 2016-2017.
+# Forest Swamp <sample1989@mail.ru>, 2018.
# Igor S <scorched@bk.ru>, 2017.
# ijet <my-ijet@mail.ru>, 2017-2018.
# Maxim Kim <habamax@gmail.com>, 2016.
@@ -13,13 +15,14 @@
# outbools <drag4e@yandex.ru>, 2017.
# pitchblack <pitchblack@mail.ru>, 2017.
# Sergey Agarkov <zorgsoft@gmail.com>, 2017.
+# Ðркадий ÐÐ²Ð°Ñ <savvot@gmail.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2018-02-23 20:40+0000\n"
-"Last-Translator: ijet <my-ijet@mail.ru>\n"
+"PO-Revision-Date: 2018-04-27 16:39+0000\n"
+"Last-Translator: Chaosus89 <chaosus89@gmail.com>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/"
"godot/ru/>\n"
"Language: ru\n"
@@ -28,7 +31,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -1288,11 +1291,11 @@ msgstr "Краткое опиÑание:"
#: editor/editor_help.cpp
msgid "Members"
-msgstr "УчаÑтники"
+msgstr "СвойÑтва"
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
msgid "Members:"
-msgstr "УчаÑтники:"
+msgstr "СвойÑтва:"
#: editor/editor_help.cpp
msgid "Public Methods"
@@ -1358,7 +1361,7 @@ msgstr "СвойÑтва"
#: editor/editor_help.cpp
msgid "Property Description:"
-msgstr "ОпиÑание ÑвойÑтва:"
+msgstr "ОпиÑание ÑвойÑтв:"
#: editor/editor_help.cpp
msgid ""
@@ -1407,6 +1410,10 @@ msgstr "ОчиÑтить"
msgid "Clear Output"
msgstr "ОчиÑтить вывод"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Ошибка при Ñохранении реÑурÑа!"
@@ -2011,7 +2018,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Visible Navigation"
-msgstr "Видимые облаÑти навигации"
+msgstr "Ð’Ð¸Ð´Ð¸Ð¼Ð°Ñ Ð½Ð°Ð²Ð¸Ð³Ð°Ñ†Ð¸Ñ"
#: editor/editor_node.cpp
msgid ""
@@ -2352,7 +2359,7 @@ msgstr "Включительно"
#: editor/editor_profiler.cpp
msgid "Self"
-msgstr "СущноÑÑ‚ÑŒ"
+msgstr "Self"
#: editor/editor_profiler.cpp
msgid "Frame #:"
@@ -3711,6 +3718,16 @@ msgid "Show Guides"
msgstr "Показывать направлÑющие"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Отображать начало координат"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Окно"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Центрировать на выбранном"
@@ -4000,6 +4017,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Полиcетка не имеет поверхноÑти Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ÐºÐ¾Ð½Ñ‚ÑƒÑ€Ð°!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Ðевозможно Ñоздать контур!"
@@ -4639,7 +4660,7 @@ msgstr "Сохранить вÑÑ‘"
#: editor/plugins/script_editor_plugin.cpp
msgid "Soft Reload Script"
-msgstr "ÐœÑгко перезагрузить Ñкрипты"
+msgstr "ÐœÑгко перезагрузить Ñкрипт"
#: editor/plugins/script_editor_plugin.cpp
msgid "Copy Script Path"
@@ -5536,18 +5557,16 @@ msgid "Move (After)"
msgstr "ПеремеÑтить (поÑле)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
-#, fuzzy
msgid "SpriteFrames"
-msgstr "Кадры cпрайта"
+msgstr "SpriteFrames"
#: editor/plugins/style_box_editor_plugin.cpp
msgid "StyleBox Preview:"
-msgstr "StyleBox предпроÑмотр:"
+msgstr "ПредпроÑмотр StyleBox:"
#: editor/plugins/style_box_editor_plugin.cpp
-#, fuzzy
msgid "StyleBox"
-msgstr "Стиль"
+msgstr "StyleBox"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Set Region Rect"
@@ -5670,6 +5689,16 @@ msgid "Checked Item"
msgstr "Отмеченный Ñлемент"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Добавить Ñлемент"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Отмеченный Ñлемент"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Имеет"
@@ -5923,7 +5952,7 @@ msgstr "Создать латку"
#: editor/project_export.cpp
msgid "Features"
-msgstr "СвойÑтва"
+msgstr "ОÑобенноÑти"
#: editor/project_export.cpp
msgid "Custom (comma-separated):"
@@ -6149,7 +6178,7 @@ msgstr ""
#: editor/project_settings_editor.cpp
msgid "Key "
-msgstr "Кнопка "
+msgstr "Ключ "
#: editor/project_settings_editor.cpp
msgid "Joy Button"
@@ -6164,8 +6193,10 @@ msgid "Mouse Button"
msgstr "Кнопка мыши"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "ÐедопуÑтимое название дейÑÑ‚Ð²Ð¸Ñ (подойдёт вÑÑ‘ кроме '/' или ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6308,10 +6339,6 @@ msgid "Delete Item"
msgstr "Удалить Ñлемент"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Ðе может Ñодержать '/' или ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Уже ÑущеÑтвует"
@@ -6968,7 +6995,7 @@ msgstr "Ð’Ñтроенный Скрипт"
#: editor/script_create_dialog.cpp
msgid "Attach Node Script"
-msgstr "Добавление Ñкрипта"
+msgstr "Прикрепить Ñкрипт"
#: editor/script_editor_debugger.cpp
msgid "Remote "
@@ -7370,6 +7397,10 @@ msgstr "GridMap Параметры"
msgid "Pick Distance:"
msgstr "РаÑÑтоÑние выбора:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñ€ÐµÑˆÐµÐ½Ð¸Ñ..."
@@ -7420,7 +7451,7 @@ msgstr "ПредупреждениÑ"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Конец траÑÑировки внутреннего Ñтека иÑключений"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7977,10 +8008,9 @@ msgstr "ARVROrigin требует дочерний узел ARVRCamera"
#: scene/3d/baked_lightmap.cpp
msgid "%d%%"
-msgstr ""
+msgstr "%d%%"
#: scene/3d/baked_lightmap.cpp
-#, fuzzy
msgid "(Time Left: %d:%02d s)"
msgstr "(ОÑталоÑÑŒ: %d:%02d Ñек)"
@@ -8080,12 +8110,22 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "СвойÑтво Path должно указывать на дейÑтвительный Spatial узел."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Только один WorldEnvironment допуÑкаетÑÑ Ð½Ð° Ñцену или ÑовокупноÑÑ‚ÑŒ "
"приведённых Ñцен."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8185,6 +8225,12 @@ msgstr "Ошибка загрузки шрифта."
msgid "Invalid font size."
msgstr "ÐедопуÑтимый размер шрифта."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "ÐедопуÑтимое название дейÑÑ‚Ð²Ð¸Ñ (подойдёт вÑÑ‘ кроме '/' или ':')."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Ðе может Ñодержать '/' или ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/sk.po b/editor/translations/sk.po
index c5fa76fb01..16f675df37 100644
--- a/editor/translations/sk.po
+++ b/editor/translations/sk.po
@@ -1385,6 +1385,10 @@ msgstr ""
msgid "Clear Output"
msgstr "Popis:"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3624,6 +3628,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3914,6 +3926,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5590,6 +5606,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6073,7 +6097,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6218,10 +6244,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7278,6 +7300,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7931,10 +7957,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/sl.po b/editor/translations/sl.po
index 04fb6d9816..74b469fc42 100644
--- a/editor/translations/sl.po
+++ b/editor/translations/sl.po
@@ -3,16 +3,17 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
-# matevž lapajne <sivar.lapajne@gmail.com>, 2016-2017.
-# Matjaž Vitas <matjaz.vitas@gmail.com>, 2017.
+# matevž lapajne <sivar.lapajne@gmail.com>, 2016-2018.
+# Matjaž Vitas <matjaz.vitas@gmail.com>, 2017-2018.
# Miha Komatar <miha.komatar@gmail.com>, 2018.
# Simon Å ander <simon.sand3r@gmail.com>, 2017.
+# Yahara Octanis <yaharao55@gmail.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-25 22:27+0000\n"
-"Last-Translator: Miha Komatar <miha.komatar@gmail.com>\n"
+"PO-Revision-Date: 2018-05-03 07:41+0000\n"
+"Last-Translator: matevž lapajne <sivar.lapajne@gmail.com>\n"
"Language-Team: Slovenian <https://hosted.weblate.org/projects/godot-engine/"
"godot/sl/>\n"
"Language: sl\n"
@@ -20,7 +21,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -28,130 +29,128 @@ msgstr "OnemogoÄen"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr "Vsa izbira"
+msgstr "Celotna izbira"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Time"
-msgstr ""
+msgstr "Animacija Spremeni Äas kljuÄne slike"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr "Anim spremeni prehod"
+msgstr "Animacija Spremeni prehod"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
-msgstr ""
+msgstr "Animacija Spremeni transformacijo"
#: editor/animation_editor.cpp
msgid "Anim Change Keyframe Value"
-msgstr ""
+msgstr "Animacija Spremeni vrednost kljuÄne slike"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
-msgstr "Anim izberi klic"
+msgstr "Animacija Spremeni klic"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
-msgstr ""
+msgstr "Animacija Dodaj sled"
#: editor/animation_editor.cpp
msgid "Anim Duplicate Keys"
-msgstr ""
+msgstr "Animacija Podvoji kljuÄe"
#: editor/animation_editor.cpp
msgid "Move Anim Track Up"
-msgstr ""
+msgstr "Premakni animacijsko sled gor"
#: editor/animation_editor.cpp
msgid "Move Anim Track Down"
-msgstr ""
+msgstr "Premakni animacijsko sled dol"
#: editor/animation_editor.cpp
msgid "Remove Anim Track"
-msgstr ""
+msgstr "Odstrani animacijsko sled"
#: editor/animation_editor.cpp
msgid "Set Transitions to:"
-msgstr "Nastavite Prehode na:"
+msgstr "Nastavi prehode na:"
#: editor/animation_editor.cpp
msgid "Anim Track Rename"
-msgstr ""
+msgstr "Animacija Preimenuj sled"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr ""
+msgstr "Animacija Spremeni interpolacijo sledi"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
-msgstr ""
+msgstr "Animacija Spremeni naÄin vrednosti sledi"
#: editor/animation_editor.cpp
msgid "Anim Track Change Wrap Mode"
-msgstr ""
+msgstr "Animacija Spremeni naÄin ovijanja sledi"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Edit Node Curve"
-msgstr "Uredi Node Krivuljo"
+msgstr "Uredi krivuljo vozliÅ¡Äa"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Edit Selection Curve"
-msgstr "Uredi Izbor Krivulje"
+msgstr "Uredi Krivulje izbora"
#: editor/animation_editor.cpp
msgid "Anim Delete Keys"
-msgstr ""
+msgstr "Animacija IzbriÅ¡i kljuÄe"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr "Podvoji Izbrano"
+msgstr "Podvoji izbrano"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr ""
+msgstr "Podvoji transponirano"
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr "Odstrani Izbiro"
+msgstr "Odstrani izbrano"
#: editor/animation_editor.cpp
msgid "Continuous"
-msgstr ""
+msgstr "Neprekinjeno"
#: editor/animation_editor.cpp
msgid "Discrete"
-msgstr ""
+msgstr "Diskretno"
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "Sprožilec"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr ""
+msgstr "Animacija Dodaj kljuÄ"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr ""
+msgstr "Animacija Premakni kljuÄ"
#: editor/animation_editor.cpp
msgid "Scale Selection"
-msgstr "PoveÄaj Izbiro"
+msgstr "PoveÄaj izbiro"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
-msgstr ""
+msgstr "PoveÄaj iz kazalca"
#: editor/animation_editor.cpp
msgid "Goto Next Step"
-msgstr "Pojdite na Naslednji Korak"
+msgstr "Pojdi na naslednji korak"
#: editor/animation_editor.cpp
msgid "Goto Prev Step"
-msgstr "Pojdite na Predhodni Korak"
+msgstr "Pojdi na prejšnji korak"
#: editor/animation_editor.cpp editor/plugins/curve_editor_plugin.cpp
#: editor/property_editor.cpp
@@ -160,7 +159,7 @@ msgstr "Linearno"
#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
msgid "Constant"
-msgstr ""
+msgstr "Konstanta"
#: editor/animation_editor.cpp
msgid "In"
@@ -192,7 +191,7 @@ msgstr "PoÄisti Animacijo"
#: editor/animation_editor.cpp
msgid "Create NEW track for %s and insert key?"
-msgstr ""
+msgstr "Ustvari NOVI trak za %s in vstavi kljuÄ?"
#: editor/animation_editor.cpp
msgid "Create %d NEW tracks and insert keys?"
@@ -244,7 +243,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Animation zoom."
-msgstr "Približaj Animacijo"
+msgstr "Približaj animacijo"
#: editor/animation_editor.cpp
msgid "Length (s):"
@@ -252,7 +251,7 @@ msgstr "Dolžina (s):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr ""
+msgstr "Dolžina animacije (v sekundah)."
#: editor/animation_editor.cpp
msgid "Step (s):"
@@ -443,7 +442,7 @@ msgstr ""
#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
#: editor/project_settings_editor.cpp
msgid "Remove"
-msgstr ""
+msgstr "Odstrani"
#: editor/connections_dialog.cpp
msgid "Add Extra Call Argument:"
@@ -530,7 +529,7 @@ msgstr "Ustvari"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
msgid "Favorites:"
-msgstr ""
+msgstr "Priljubljene:"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
msgid "Recent:"
@@ -588,7 +587,7 @@ msgstr ""
#: editor/project_manager.cpp editor/project_settings_editor.cpp
#: editor/script_create_dialog.cpp
msgid "Path"
-msgstr ""
+msgstr "Pot"
#: editor/dependency_editor.cpp
msgid "Dependencies:"
@@ -670,7 +669,7 @@ msgstr ""
#: editor/dependency_editor.cpp editor/editor_node.cpp
msgid "Orphan Resource Explorer"
-msgstr ""
+msgstr "Raziskovalec Osamljenih Virov"
#: editor/dependency_editor.cpp
msgid "Delete selected files?"
@@ -714,7 +713,7 @@ msgstr ""
#: editor/editor_about.cpp
msgid "Project Manager "
-msgstr ""
+msgstr "Upravljalnik Projekta "
#: editor/editor_about.cpp
msgid "Developers"
@@ -889,7 +888,7 @@ msgstr "Izbriši Izbrano"
#: editor/editor_audio_buses.cpp
msgid "Audio"
-msgstr ""
+msgstr "Zvok"
#: editor/editor_audio_buses.cpp
msgid "Add Audio Bus"
@@ -1045,7 +1044,7 @@ msgstr ""
#: editor/editor_autoload_settings.cpp editor/editor_profiler.cpp
#: editor/project_manager.cpp editor/settings_config_dialog.cpp
msgid "Name"
-msgstr ""
+msgstr "Ime"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
@@ -1053,7 +1052,7 @@ msgstr ""
#: editor/editor_data.cpp
msgid "Updating Scene"
-msgstr ""
+msgstr "Posodabljanje Scene"
#: editor/editor_data.cpp
msgid "Storing local changes.."
@@ -1061,11 +1060,11 @@ msgstr ""
#: editor/editor_data.cpp
msgid "Updating scene.."
-msgstr ""
+msgstr "Posodabljanje scene.."
#: editor/editor_data.cpp
msgid "[empty]"
-msgstr ""
+msgstr "[prazen]"
#: editor/editor_data.cpp
msgid "[unsaved]"
@@ -1082,7 +1081,7 @@ msgstr ""
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp
msgid "Create Folder"
-msgstr ""
+msgstr "Ustvarite Mapo"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp
@@ -1117,9 +1116,8 @@ msgid "File Exists, Overwrite?"
msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Select Current Folder"
-msgstr "Dodaj Setter Lastnost"
+msgstr "Izberite Trenutno Mapo"
#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
msgid "Copy Path"
@@ -1143,7 +1141,7 @@ msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "All Files (*)"
-msgstr ""
+msgstr "Vse Datoteke (*)"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Open a File"
@@ -1213,7 +1211,7 @@ msgstr ""
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Directories & Files:"
-msgstr ""
+msgstr "Mape & Datoteke:"
#: editor/editor_file_dialog.cpp
msgid "Preview:"
@@ -1222,7 +1220,7 @@ msgstr ""
#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
#: scene/gui/file_dialog.cpp
msgid "File:"
-msgstr ""
+msgstr "Datoteka:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Must use a valid extension."
@@ -1373,7 +1371,7 @@ msgstr ""
#: editor/editor_log.cpp
msgid "Output:"
-msgstr ""
+msgstr "Izhod:"
#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
#: editor/property_editor.cpp editor/script_editor_debugger.cpp
@@ -1386,6 +1384,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -1433,7 +1435,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Saving Scene"
-msgstr ""
+msgstr "Shranjevanje Scene"
#: editor/editor_node.cpp
msgid "Analyzing"
@@ -1594,19 +1596,19 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Open Scene"
-msgstr ""
+msgstr "Odpri Sceno"
#: editor/editor_node.cpp
msgid "Open Base Scene"
-msgstr ""
+msgstr "Odpri Osnovno Sceno"
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
-msgstr ""
+msgstr "Hitro Odpri Sceno.."
#: editor/editor_node.cpp
msgid "Quick Open Script.."
-msgstr ""
+msgstr "Hitro Odpri Skripto.."
#: editor/editor_node.cpp
msgid "Save & Close"
@@ -1618,7 +1620,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Save Scene As.."
-msgstr ""
+msgstr "Shrani Sceno Kot.."
#: editor/editor_node.cpp
msgid "No"
@@ -1670,11 +1672,11 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Quick Run Scene.."
-msgstr ""
+msgstr "Hitro Zaženi Sceno.."
#: editor/editor_node.cpp
msgid "Quit"
-msgstr ""
+msgstr "Zapri"
#: editor/editor_node.cpp
msgid "Exit the editor?"
@@ -1750,7 +1752,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Clear Recent Scenes"
-msgstr ""
+msgstr "PoÄisti Nedavne Scene"
#: editor/editor_node.cpp
msgid "Save Layout"
@@ -1795,15 +1797,15 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Add a new scene."
-msgstr ""
+msgstr "Dodaj novo Sceno."
#: editor/editor_node.cpp
msgid "Scene"
-msgstr ""
+msgstr "Scena"
#: editor/editor_node.cpp
msgid "Go to previously opened scene."
-msgstr ""
+msgstr "Pojdite na predhodno odprte scene."
#: editor/editor_node.cpp
msgid "Next tab"
@@ -1823,35 +1825,35 @@ msgstr ""
#: editor/editor_node.cpp
msgid "New Scene"
-msgstr ""
+msgstr "Nova Scena"
#: editor/editor_node.cpp
msgid "New Inherited Scene.."
-msgstr ""
+msgstr "Nova Podedovana Scena.."
#: editor/editor_node.cpp
msgid "Open Scene.."
-msgstr ""
+msgstr "Odpri Sceno.."
#: editor/editor_node.cpp
msgid "Save Scene"
-msgstr ""
+msgstr "Shrani Sceno"
#: editor/editor_node.cpp
msgid "Save all Scenes"
-msgstr ""
+msgstr "Shrani vse Scene"
#: editor/editor_node.cpp
msgid "Close Scene"
-msgstr ""
+msgstr "Zapri Sceno"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Open Recent"
-msgstr ""
+msgstr "Odpri Nedavno"
#: editor/editor_node.cpp
msgid "Convert To.."
-msgstr ""
+msgstr "Pretvori V.."
#: editor/editor_node.cpp
msgid "MeshLibrary.."
@@ -1864,16 +1866,16 @@ msgstr ""
#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp
msgid "Undo"
-msgstr ""
+msgstr "Razveljavi"
#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
#: scene/gui/line_edit.cpp
msgid "Redo"
-msgstr ""
+msgstr "Ponovi"
#: editor/editor_node.cpp
msgid "Revert Scene"
-msgstr ""
+msgstr "Povrni Sceno"
#: editor/editor_node.cpp
msgid "Miscellaneous project or scene-wide tools."
@@ -1881,11 +1883,11 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Project"
-msgstr ""
+msgstr "Projekt"
#: editor/editor_node.cpp
msgid "Project Settings"
-msgstr ""
+msgstr "Nastavitve Projekta"
#: editor/editor_node.cpp
msgid "Run Script"
@@ -1893,23 +1895,23 @@ msgstr ""
#: editor/editor_node.cpp editor/project_export.cpp
msgid "Export"
-msgstr ""
+msgstr "Izvozi"
#: editor/editor_node.cpp
msgid "Tools"
-msgstr ""
+msgstr "Orodja"
#: editor/editor_node.cpp
msgid "Quit to Project List"
-msgstr ""
+msgstr "Zapri na Seznam Projektov"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Debug"
-msgstr ""
+msgstr "RazhroÅ¡Äevalnik"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
-msgstr ""
+msgstr "Uvajanje z Oddaljenim RazhroÅ¡Äevanjem"
#: editor/editor_node.cpp
msgid ""
@@ -1919,7 +1921,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Small Deploy with Network FS"
-msgstr ""
+msgstr "Kratko Uvajanje z Omrežjem FS"
#: editor/editor_node.cpp
msgid ""
@@ -1976,9 +1978,8 @@ msgid ""
msgstr ""
#: editor/editor_node.cpp
-#, fuzzy
msgid "Editor"
-msgstr "Uredi"
+msgstr "Urejevalnik"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1998,7 +1999,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Help"
-msgstr ""
+msgstr "PomoÄ"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Classes"
@@ -2130,7 +2131,7 @@ msgstr ""
#: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp
#: editor/project_manager.cpp
msgid "Import"
-msgstr ""
+msgstr "Uvozi"
#: editor/editor_node.cpp
msgid "Node"
@@ -2138,11 +2139,11 @@ msgstr ""
#: editor/editor_node.cpp
msgid "FileSystem"
-msgstr ""
+msgstr "DatoteÄniSistem"
#: editor/editor_node.cpp
msgid "Output"
-msgstr ""
+msgstr "Izhod"
#: editor/editor_node.cpp
msgid "Don't Save"
@@ -2198,7 +2199,7 @@ msgstr ""
#: editor/editor_node.cpp editor/project_manager.cpp
msgid "Open Asset Library"
-msgstr ""
+msgstr "Odprite Asset Library"
#: editor/editor_node.cpp
msgid "Open the next Editor"
@@ -2664,12 +2665,12 @@ msgstr ""
#: editor/filesystem_dock.cpp
msgid "Move"
-msgstr ""
+msgstr "Premakni"
#: editor/filesystem_dock.cpp editor/plugins/animation_tree_editor_plugin.cpp
#: editor/project_manager.cpp
msgid "Rename"
-msgstr ""
+msgstr "Preimenuj"
#: editor/groups_editor.cpp
msgid "Add to Group"
@@ -3056,7 +3057,7 @@ msgstr ""
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Animation"
-msgstr ""
+msgstr "Animacija"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "New name:"
@@ -3292,24 +3293,24 @@ msgstr ""
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "first"
-msgstr ""
+msgstr "prvi"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "prev"
-msgstr ""
+msgstr "prejšnji"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "next"
-msgstr ""
+msgstr "naslednji"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "last"
-msgstr ""
+msgstr "zadnji"
#: editor/plugins/asset_library_editor_plugin.cpp
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "All"
-msgstr ""
+msgstr "Vse"
#: editor/plugins/asset_library_editor_plugin.cpp
#: editor/project_settings_editor.cpp
@@ -3318,7 +3319,7 @@ msgstr ""
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Sort:"
-msgstr ""
+msgstr "Razvrsti:"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Reverse"
@@ -3327,15 +3328,15 @@ msgstr ""
#: editor/plugins/asset_library_editor_plugin.cpp
#: editor/project_settings_editor.cpp
msgid "Category:"
-msgstr ""
+msgstr "Kategorija:"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Site:"
-msgstr ""
+msgstr "Stran:"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Support.."
-msgstr ""
+msgstr "Podpora.."
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Official"
@@ -3461,11 +3462,11 @@ msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Select Mode"
-msgstr ""
+msgstr "Izberite NaÄin"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Drag: Rotate"
-msgstr ""
+msgstr "Povlecite: Zavrti"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Alt+Drag: Move"
@@ -3477,15 +3478,15 @@ msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Alt+RMB: Depth list selection"
-msgstr ""
+msgstr "Alt+RMB: Izbira globine"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Move Mode"
-msgstr ""
+msgstr "NaÄin Premika"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Rotate Mode"
-msgstr ""
+msgstr "NaÄin Vrtenja"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -3493,6 +3494,8 @@ msgid ""
"Show a list of all objects at the position clicked\n"
"(same as Alt+RMB in select mode)."
msgstr ""
+"Ob kliku prikaži seznam vseh objektov na tem mestu.\n"
+"(isto kot Alt+RMB v naÄinu izbire)."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Click to change object's rotation pivot."
@@ -3562,12 +3565,12 @@ msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Lock the selected object in place (can't be moved)."
-msgstr ""
+msgstr "Izbrani predmet zaklenite na svoje mesto (ga ni mogoÄe premakniti)."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Unlock the selected object (can be moved)."
-msgstr ""
+msgstr "Odklenite izbrani predmet (ga lahko premaknete)."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Makes sure the object's children are not selectable."
@@ -3600,7 +3603,7 @@ msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View"
-msgstr ""
+msgstr "Pogled"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
@@ -3620,6 +3623,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3909,6 +3920,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -4370,7 +4385,7 @@ msgstr ""
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Ctrl: Rotate"
-msgstr ""
+msgstr "Ctrl: Vrtenje"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift: Move All"
@@ -4597,7 +4612,7 @@ msgstr ""
#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
msgid "Run"
-msgstr ""
+msgstr "Zaženi"
#: editor/plugins/script_editor_plugin.cpp
msgid "Toggle Scripts Panel"
@@ -4682,7 +4697,7 @@ msgstr ""
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Debugger"
-msgstr ""
+msgstr "RazhroÅ¡Äevalnik"
#: editor/plugins/script_editor_plugin.cpp
msgid ""
@@ -5170,9 +5185,8 @@ msgid "XForm Dialog"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
msgid "Select Mode (Q)"
-msgstr "Dodaj Setter Lastnost"
+msgstr "Izberite NaÄin (Q)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid ""
@@ -5180,18 +5194,21 @@ msgid ""
"Alt+Drag: Move\n"
"Alt+RMB: Depth list selection"
msgstr ""
+"Povlecite: Zavrtite\n"
+"Alt+Drag: Premaknite\n"
+"Alt+RMB: Izbira globine"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
-msgstr ""
+msgstr "NaÄin Premika (W)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Mode (E)"
-msgstr ""
+msgstr "NaÄin Vrtenja (E)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Mode (R)"
-msgstr ""
+msgstr "NaÄin Obsega (R)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Coords"
@@ -5199,11 +5216,11 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Space Mode (%s)"
-msgstr ""
+msgstr "Lokalno prostorski naÄin (%s)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Mode (%s)"
-msgstr ""
+msgstr "NaÄin Zaskoka (%s)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View"
@@ -5273,15 +5290,15 @@ msgstr "Preklopi na Zaustavitev"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform"
-msgstr ""
+msgstr "Preoblikovanje"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Configure Snap.."
-msgstr ""
+msgstr "Preoblikuj Zaskok.."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Dialog.."
-msgstr ""
+msgstr "Preoblikovanje Dialoga.."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "1 Viewport"
@@ -5326,11 +5343,11 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
-msgstr ""
+msgstr "Nastavitve ZaskoÄenja"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate Snap:"
-msgstr ""
+msgstr "Prestavi ZaskoÄenje:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Snap (deg.):"
@@ -5358,7 +5375,7 @@ msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Change"
-msgstr ""
+msgstr "Preoblikovanje Sprememb"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate:"
@@ -5466,7 +5483,7 @@ msgstr ""
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Snap Mode:"
-msgstr ""
+msgstr "NaÄin Postavljanja:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "<None>"
@@ -5583,6 +5600,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -5863,11 +5888,11 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Please choose a 'project.godot' file."
-msgstr ""
+msgstr "Izberite datoteko 'projekt.godot'."
#: editor/project_manager.cpp
msgid "Please choose an empty folder."
-msgstr ""
+msgstr "Izberite prazno mapo."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5914,11 +5939,11 @@ msgstr "Preimenuj Funkcijo"
#: editor/project_manager.cpp
msgid "New Game Project"
-msgstr ""
+msgstr "Novi Projekt Igre"
#: editor/project_manager.cpp
msgid "Import Existing Project"
-msgstr ""
+msgstr "Uvoz ObstojeÄega Projekta"
#: editor/project_manager.cpp
msgid "Import & Edit"
@@ -5926,12 +5951,11 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Create New Project"
-msgstr ""
+msgstr "Ustvarite Nov Projekt"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Create & Edit"
-msgstr "Ustvari"
+msgstr "Ustvari & Uredi"
#: editor/project_manager.cpp
msgid "Install Project:"
@@ -5943,19 +5967,19 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Project Name:"
-msgstr ""
+msgstr "Ime Projekta:"
#: editor/project_manager.cpp
msgid "Create folder"
-msgstr ""
+msgstr "Ustvarite mapo"
#: editor/project_manager.cpp
msgid "Project Path:"
-msgstr ""
+msgstr "Pot Projekta:"
#: editor/project_manager.cpp
msgid "Browse"
-msgstr ""
+msgstr "Brskaj"
#: editor/project_manager.cpp
msgid "Unnamed Project"
@@ -6004,32 +6028,31 @@ msgstr ""
#: editor/project_manager.cpp
msgid "Project Manager"
-msgstr ""
+msgstr "Upravljalnik Projekta"
#: editor/project_manager.cpp
msgid "Project List"
-msgstr ""
+msgstr "Seznam Projektov"
#: editor/project_manager.cpp
msgid "Scan"
-msgstr ""
+msgstr "Preglej"
#: editor/project_manager.cpp
msgid "Select a Folder to Scan"
-msgstr ""
+msgstr "Izberite Mapo za Skeniranje"
#: editor/project_manager.cpp
msgid "New Project"
-msgstr ""
+msgstr "Nov Projekt"
#: editor/project_manager.cpp
-#, fuzzy
msgid "Templates"
-msgstr "Odstrani Spremenljivko"
+msgstr "Predloge"
#: editor/project_manager.cpp
msgid "Exit"
-msgstr ""
+msgstr "Izhod"
#: editor/project_manager.cpp
msgid "Restart Now"
@@ -6044,6 +6067,8 @@ msgid ""
"You don't currently have any projects.\n"
"Would you like to explore the official example projects in the Asset Library?"
msgstr ""
+"Trenutno nimate projektov.\n"
+"Želite raziskovati uradne primere projektov v Asset Library?"
#: editor/project_settings_editor.cpp
msgid "Key "
@@ -6062,7 +6087,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6208,10 +6235,6 @@ msgid "Delete Item"
msgstr "Izbriši Izbrano"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -6434,7 +6457,7 @@ msgstr ""
#: editor/property_editor.cpp
msgid "[Empty]"
-msgstr ""
+msgstr "[Prazen]"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
@@ -7261,6 +7284,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7318,15 +7345,15 @@ msgid ""
"A node yielded without working memory, please read the docs on how to yield "
"properly!"
msgstr ""
-"Node je bil sprejet brez potrebnega pomnilnika, pravilen postopek je opisan "
-"v dokumentaciji!"
+"VozliÅ¡Äe se je ustavilo brez delovnega spomina! Prosimo preberite si v "
+"dokumentaciji, kako pravilno ustaviti vozliÅ¡Äe."
#: modules/visual_script/visual_script.cpp
msgid ""
"Node yielded, but did not return a function state in the first working "
"memory."
msgstr ""
-"Node pridobljen, vendar se ne vrne v funkcijalno stanje v prvem delavnem "
+"VozliÅ¡Äe se je ustavilo, vendar ni vrnilo stanje funkcije v prvem delovnem "
"spominu."
#: modules/visual_script/visual_script.cpp
@@ -7334,16 +7361,17 @@ msgid ""
"Return value must be assigned to first element of node working memory! Fix "
"your node please."
msgstr ""
-"Vrnjena vrednost mora biti dodeljena prvemu elementu v node-delavnemu "
-"spominu! Prosim, da popraviš node."
+"Vrnjena vrednost mora biti dodeljena prvemu elementu delovnega spomina "
+"vozliÅ¡Äa! Prosimo popravite vozliÅ¡Äe."
#: modules/visual_script/visual_script.cpp
msgid "Node returned an invalid sequence output: "
-msgstr "Node je vrnil napaÄno zaporedje na izhodu: "
+msgstr "VozliÅ¡Äe je vrnilo napaÄno sekvenco na izhodu: "
#: modules/visual_script/visual_script.cpp
msgid "Found sequence bit but not the node in the stack, report bug!"
-msgstr "Zaporedni bit najden, vendar ne node v skladu, prijavi napako!"
+msgstr ""
+"SekvenÄni bit je bil najden, vozliÅ¡Äe na skladu pa ne; prijavite napako!"
#: modules/visual_script/visual_script.cpp
msgid "Stack overflow with stack depth: "
@@ -7417,7 +7445,7 @@ msgstr ""
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Node"
-msgstr "Dodaj Node"
+msgstr "Dodaj vozliÅ¡Äe"
#: modules/visual_script/visual_script_editor.cpp
#, fuzzy
@@ -7453,13 +7481,13 @@ msgid "Hold Ctrl to drop a Variable Setter."
msgstr ""
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Preload Node"
-msgstr "Dodaj Node"
+msgstr "Dodaj prednaloženo vozliÅ¡Äe"
#: modules/visual_script/visual_script_editor.cpp
+#, fuzzy
msgid "Add Node(s) From Tree"
-msgstr "Dodaj Node(e) iz Drevesa"
+msgstr "Dodaj vozliÅ¡Äe(a) iz drevesa"
#: modules/visual_script/visual_script_editor.cpp
msgid "Add Getter Property"
@@ -7594,9 +7622,8 @@ msgid "Delete Selected"
msgstr "Izbriši Izbrano"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Find Node Type"
-msgstr "Najdi Node Type"
+msgstr "PoiÅ¡Äi tip vozliÅ¡Äa"
#: modules/visual_script/visual_script_editor.cpp
msgid "Copy Nodes"
@@ -7628,15 +7655,15 @@ msgstr "Neveljaven indeks lastnosti imena."
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Base object is not a Node!"
-msgstr "Osnovni objekt ni Node!"
+msgstr "ZaÄetni objekt ni vozliÅ¡Äe!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Path does not lead Node!"
-msgstr "Pot ne vodi do Node!"
+msgstr "Pot ne vodi do vozliÅ¡Äa!"
#: modules/visual_script/visual_script_func_nodes.cpp
msgid "Invalid index property name '%s' in node %s."
-msgstr "Neveljaven indeks lastnosti imena '%s' v node %s."
+msgstr "Neveljaven indeks lastnosti imena '%s' v vozliÅ¡Äu %s."
#: modules/visual_script/visual_script_nodes.cpp
msgid ": Invalid argument of type: "
@@ -7656,7 +7683,7 @@ msgstr "VariableSet ni najden v skripti: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "Custom node has no _step() method, can't process graph."
-msgstr "Custom node nima _step() metode, grafa ni mogoÄe obdelati."
+msgstr "VozliÅ¡Äe po meri nima metode _step(); grafa ni mogoÄe obdelati."
#: modules/visual_script/visual_script_nodes.cpp
msgid ""
@@ -7927,10 +7954,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -7945,20 +7982,19 @@ msgstr ""
#: scene/gui/color_picker.cpp
msgid "Raw Mode"
-msgstr ""
+msgstr "Neobdelan naÄin"
#: scene/gui/color_picker.cpp
msgid "Add current color as a preset"
-msgstr "Dodaj trenutno barvo za prednastavitev"
+msgstr "Dodaj trenutno barvo kot prednastavljeno"
#: scene/gui/dialogs.cpp
msgid "Alert!"
msgstr "Opozorilo!"
#: scene/gui/dialogs.cpp
-#, fuzzy
msgid "Please Confirm..."
-msgstr "Potrdite..."
+msgstr "Prosimo Potrdite..."
#: scene/gui/file_dialog.cpp
msgid "Select this Folder"
diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po
index e411ff2305..2c2b1eb001 100644
--- a/editor/translations/sr_Cyrl.po
+++ b/editor/translations/sr_Cyrl.po
@@ -1402,6 +1402,10 @@ msgstr "Обриши"
msgid "Clear Output"
msgstr "Излаз"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Грешка при чувању реÑурÑа!"
@@ -3710,6 +3714,16 @@ msgid "Show Guides"
msgstr "Покажи водиче"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Прикажи центар"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 прозор"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Центрирај одабрано"
@@ -3999,6 +4013,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Мрежа нема површине за прављење ивица!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "ÐеуÑпех при прављењу ивица!"
@@ -5685,6 +5703,16 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Додај Ñтвар"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "CheckBox Radio1"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Има"
@@ -6180,7 +6208,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6325,10 +6355,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7373,6 +7399,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -8022,10 +8052,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po
new file mode 100644
index 0000000000..d7cb85af1b
--- /dev/null
+++ b/editor/translations/sr_Latn.po
@@ -0,0 +1,7954 @@
+# Serbian (latin) translation of the Godot Engine editor
+# Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.
+# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
+# This file is distributed under the same license as the Godot source code.
+#
+# Milos Ponjavusic <brane@branegames.com>, 2018.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Godot Engine editor\n"
+"PO-Revision-Date: 2018-04-25 14:41+0000\n"
+"Last-Translator: Milos Ponjavusic <brane@branegames.com>\n"
+"Language-Team: Serbian (latin) <https://hosted.weblate.org/projects/godot-"
+"engine/godot/sr_Latn/>\n"
+"Language: sr_Latn\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 3.0-dev\n"
+
+#: editor/animation_editor.cpp
+msgid "Disabled"
+msgstr "Onemogućeno"
+
+#: editor/animation_editor.cpp
+msgid "All Selection"
+msgstr "Sve sekcije"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Keyframe Time"
+msgstr "Animacija Promjeni Vrijeme KljuÄnog Kadra"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transition"
+msgstr "Animacija Promjeni Tranziciju"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Transform"
+msgstr "Animacija Promjeni Transformaciju"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Keyframe Value"
+msgstr "Animacija Promjeni Vrijednost KljuÄnog Kadra"
+
+#: editor/animation_editor.cpp
+msgid "Anim Change Call"
+msgstr "Animacija Promjeni Poziv"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Track"
+msgstr "Animacija Dodaj Kanal"
+
+#: editor/animation_editor.cpp
+msgid "Anim Duplicate Keys"
+msgstr "Animacija Uduplaj KljuÄeve"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Up"
+msgstr "Pomjeri Kanal Animacije Gore"
+
+#: editor/animation_editor.cpp
+msgid "Move Anim Track Down"
+msgstr "Pomjeri Kanal Animacije Dole"
+
+#: editor/animation_editor.cpp
+msgid "Remove Anim Track"
+msgstr "Odstrani Kanal Animacije"
+
+#: editor/animation_editor.cpp
+msgid "Set Transitions to:"
+msgstr "Postavi tranzicije na:"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Rename"
+msgstr "Animacija Preimenuj Kanal"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Interpolation"
+msgstr "Animacija Promjeni Interpolaciju Kanala"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Value Mode"
+msgstr "Animacija Promjeni Vrijednosni Režim Kanala"
+
+#: editor/animation_editor.cpp
+msgid "Anim Track Change Wrap Mode"
+msgstr "Animacija Promjeni Režim Omotavanja Kanala"
+
+#: editor/animation_editor.cpp
+msgid "Edit Node Curve"
+msgstr "Izmjeni Krivulju ÄŒvora"
+
+#: editor/animation_editor.cpp
+msgid "Edit Selection Curve"
+msgstr "Izmjeni Selekciju Krivulje"
+
+#: editor/animation_editor.cpp
+msgid "Anim Delete Keys"
+msgstr "Animacija ObriÅ¡i KljuÄeve"
+
+#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Duplicate Selection"
+msgstr "Uduplaj Selekciju"
+
+#: editor/animation_editor.cpp
+msgid "Duplicate Transposed"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove Selection"
+msgstr "Obriši Selekciju"
+
+#: editor/animation_editor.cpp
+msgid "Continuous"
+msgstr "Neprekidna"
+
+#: editor/animation_editor.cpp
+msgid "Discrete"
+msgstr "Diskretna"
+
+#: editor/animation_editor.cpp
+msgid "Trigger"
+msgstr "OkidaÄ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Key"
+msgstr "Animacija Dodaj KljuÄ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Move Keys"
+msgstr "Animacija Pomjeri KljuÄeve"
+
+#: editor/animation_editor.cpp
+msgid "Scale Selection"
+msgstr "Skaliraj Selekciju"
+
+#: editor/animation_editor.cpp
+msgid "Scale From Cursor"
+msgstr "Skaliraj od Kursora"
+
+#: editor/animation_editor.cpp
+msgid "Goto Next Step"
+msgstr "Otiđi Na Sljedeći Korak"
+
+#: editor/animation_editor.cpp
+msgid "Goto Prev Step"
+msgstr "Otiđi Na Prethodni Korak"
+
+#: editor/animation_editor.cpp editor/plugins/curve_editor_plugin.cpp
+#: editor/property_editor.cpp
+msgid "Linear"
+msgstr "Linearna"
+
+#: editor/animation_editor.cpp editor/plugins/theme_editor_plugin.cpp
+msgid "Constant"
+msgstr "Kontanta"
+
+#: editor/animation_editor.cpp
+msgid "In"
+msgstr "U"
+
+#: editor/animation_editor.cpp
+msgid "Out"
+msgstr "Izvan"
+
+#: editor/animation_editor.cpp
+msgid "In-Out"
+msgstr "U-Izvan"
+
+#: editor/animation_editor.cpp
+msgid "Out-In"
+msgstr "Izvan-U"
+
+#: editor/animation_editor.cpp
+msgid "Transitions"
+msgstr "Tranzicije"
+
+#: editor/animation_editor.cpp
+msgid "Optimize Animation"
+msgstr "Optimizuj Animaciju"
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation"
+msgstr "PoÄisti Animaciju"
+
+#: editor/animation_editor.cpp
+msgid "Create NEW track for %s and insert key?"
+msgstr "Napravi Novi kanal za %s i dodaj kljuÄ?"
+
+#: editor/animation_editor.cpp
+msgid "Create %d NEW tracks and insert keys?"
+msgstr "Napravi %d novih kanala i dodaj kljuÄeve?"
+
+#: editor/animation_editor.cpp editor/create_dialog.cpp
+#: editor/editor_audio_buses.cpp editor/plugins/abstract_polygon_2d_editor.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp editor/script_create_dialog.cpp
+msgid "Create"
+msgstr "Napravi"
+
+#: editor/animation_editor.cpp
+msgid "Anim Create & Insert"
+msgstr "Animacija Napravi i Dodaj"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Track & Key"
+msgstr "Animacija Dodaj kanal i kljuÄ"
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert Key"
+msgstr "Animacija dodaj kljuÄ"
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Len"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Change Anim Loop"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Create Typed Value Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Insert"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Scale Keys"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim Add Call Track"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Animation zoom."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Length (s):"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Animation length (in seconds)."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Step (s):"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Cursor step snap (in seconds)."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Enable/Disable looping in animation."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Add new tracks."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Move current track up."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Move current track down."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove selected track."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Track tools"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Enable editing of individual keys by clicking them."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Anim. Optimizer"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Max. Linear Error:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Max. Angular Error:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Max Optimizable Angle:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Optimize"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Key"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Transition"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Scale Ratio:"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Call Functions in Which Node?"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove invalid keys"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Remove unresolved and empty tracks"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Clean-up all animations"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up Animation(s) (NO UNDO!)"
+msgstr ""
+
+#: editor/animation_editor.cpp
+msgid "Clean-Up"
+msgstr ""
+
+#: editor/array_property_edit.cpp
+msgid "Resize Array"
+msgstr ""
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value Type"
+msgstr ""
+
+#: editor/array_property_edit.cpp
+msgid "Change Array Value"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Go to Line"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Line Number:"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "No Matches"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Replaced %d occurrence(s)."
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Match Case"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Whole Words"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Replace"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Replace All"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Selection Only"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Zoom In"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Zoom Out"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Reset Zoom"
+msgstr ""
+
+#: editor/code_editor.cpp editor/script_editor_debugger.cpp
+msgid "Line:"
+msgstr ""
+
+#: editor/code_editor.cpp
+msgid "Col:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Method in target Node must be specified!"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid ""
+"Target method not found! Specify a valid method or attach a script to target "
+"Node."
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connect To Node:"
+msgstr ""
+
+#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
+#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp
+msgid "Add"
+msgstr ""
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings_editor.cpp
+msgid "Remove"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Add Extra Call Argument:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Extra Call Arguments:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Path to Node:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Make Function"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Deferred"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Oneshot"
+msgstr ""
+
+#: editor/connections_dialog.cpp editor/dependency_editor.cpp
+#: editor/export_template_manager.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/project_export.cpp
+#: editor/project_settings_editor.cpp editor/property_editor.cpp
+#: editor/run_settings_dialog.cpp editor/settings_config_dialog.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Close"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connect"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connect '%s' to '%s'"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connecting Signal:"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Disconnect '%s' from '%s'"
+msgstr ""
+
+#: editor/connections_dialog.cpp
+msgid "Connect.."
+msgstr ""
+
+#: editor/connections_dialog.cpp
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Disconnect"
+msgstr ""
+
+#: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp
+msgid "Signals"
+msgstr ""
+
+#: editor/create_dialog.cpp
+msgid "Change %s Type"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/project_settings_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change"
+msgstr ""
+
+#: editor/create_dialog.cpp
+msgid "Create New %s"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp
+msgid "Favorites:"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
+msgid "Recent:"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Search:"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp
+msgid "Matches:"
+msgstr ""
+
+#: editor/create_dialog.cpp editor/editor_help.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp editor/property_selector.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Description:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement For:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies For:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Scene '%s' is currently being edited.\n"
+"Changes will not take effect unless reloaded."
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid ""
+"Resource '%s' is in use.\n"
+"Changes will take effect when reloaded."
+msgstr ""
+
+#: editor/dependency_editor.cpp
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Dependencies"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Resource"
+msgstr ""
+
+#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
+#: editor/project_manager.cpp editor/project_settings_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Path"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Dependencies:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Fix Broken"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Dependency Editor"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Search Replacement Resource:"
+msgstr ""
+
+#: editor/dependency_editor.cpp editor/editor_file_dialog.cpp
+#: editor/editor_help.cpp editor/editor_node.cpp editor/filesystem_dock.cpp
+#: editor/plugins/script_editor_plugin.cpp editor/property_selector.cpp
+#: editor/quick_open.cpp scene/gui/file_dialog.cpp
+msgid "Open"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Owners Of:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Remove selected files from the project? (no undo)"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid ""
+"The files being removed are required by other resources in order for them to "
+"work.\n"
+"Remove them anyway? (no undo)"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Cannot remove:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Error loading:"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Scene failed to load due to missing dependencies:"
+msgstr ""
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Open Anyway"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Which action should be taken?"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Fix Dependencies"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Errors loading!"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Permanently delete %d item(s)? (No undo!)"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Owns"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Resources Without Explicit Ownership:"
+msgstr ""
+
+#: editor/dependency_editor.cpp editor/editor_node.cpp
+msgid "Orphan Resource Explorer"
+msgstr ""
+
+#: editor/dependency_editor.cpp
+msgid "Delete selected files?"
+msgstr ""
+
+#: editor/dependency_editor.cpp editor/editor_audio_buses.cpp
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/filesystem_dock.cpp editor/plugins/item_list_editor_plugin.cpp
+#: editor/project_export.cpp editor/project_settings_editor.cpp
+#: editor/scene_tree_dock.cpp
+msgid "Delete"
+msgstr ""
+
+#: editor/dictionary_property_edit.cpp
+msgid "Change Dictionary Key"
+msgstr ""
+
+#: editor/dictionary_property_edit.cpp
+msgid "Change Dictionary Value"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Thanks from the Godot community!"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Thanks!"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Godot Engine contributors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Project Founders"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Lead Developer"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Project Manager "
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Developers"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Authors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Platinum Sponsors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Gold Sponsors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Mini Sponsors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Gold Donors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Silver Donors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Bronze Donors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Donors"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "License"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Thirdparty License"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid ""
+"Godot Engine relies on a number of thirdparty free and open source "
+"libraries, all compatible with the terms of its MIT license. The following "
+"is an exhaustive list of all such thirdparty components with their "
+"respective copyright statements and license terms."
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "All Components"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Components"
+msgstr ""
+
+#: editor/editor_about.cpp
+msgid "Licenses"
+msgstr ""
+
+#: editor/editor_asset_installer.cpp editor/project_manager.cpp
+msgid "Error opening package file, not in zip format."
+msgstr ""
+
+#: editor/editor_asset_installer.cpp
+msgid "Uncompressing Assets"
+msgstr ""
+
+#: editor/editor_asset_installer.cpp editor/project_manager.cpp
+msgid "Package Installed Successfully!"
+msgstr ""
+
+#: editor/editor_asset_installer.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Success!"
+msgstr ""
+
+#: editor/editor_asset_installer.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Install"
+msgstr ""
+
+#: editor/editor_asset_installer.cpp
+msgid "Package Installer"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Speakers"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Effect"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Rename Audio Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Change Audio Bus Volume"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Toggle Audio Bus Solo"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Toggle Audio Bus Mute"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Toggle Audio Bus Bypass Effects"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Select Audio Bus Send"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Audio Bus Effect"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Move Bus Effect"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Delete Bus Effect"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Audio Bus, Drag and Drop to rearrange."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Solo"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Mute"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Bypass"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Bus options"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp editor/filesystem_dock.cpp
+#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Duplicate"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Reset Volume"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Delete Effect"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Audio"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Audio Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Master bus can't be deleted!"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Delete Audio Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Duplicate Audio Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Reset Bus Volume"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Move Audio Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Save Audio Bus Layout As.."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Location for New Layout.."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Open Audio Bus Layout"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "There is no 'res://default_bus_layout.tres' file."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Invalid file, not an audio bus layout."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Add Bus"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Create a new Bus Layout."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Load"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Load an existing Bus Layout."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save As"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Save this Bus Layout to a file."
+msgstr ""
+
+#: editor/editor_audio_buses.cpp editor/import_dock.cpp
+msgid "Load Default"
+msgstr ""
+
+#: editor/editor_audio_buses.cpp
+msgid "Load the default Bus Layout."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Valid characters:"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing engine class name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing buit-in type name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid name. Must not collide with an existing global constant name."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Invalid Path."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "File does not exist."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Not in resource path."
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Add AutoLoad"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Autoload '%s' already exists!"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rename Autoload"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Toggle AutoLoad Globals"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Move Autoload"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Remove Autoload"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Enable"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Rearrange Autoloads"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp editor/editor_file_dialog.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Path:"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Node Name:"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp editor/editor_profiler.cpp
+#: editor/project_manager.cpp editor/settings_config_dialog.cpp
+msgid "Name"
+msgstr ""
+
+#: editor/editor_autoload_settings.cpp
+msgid "Singleton"
+msgstr ""
+
+#: editor/editor_data.cpp
+msgid "Updating Scene"
+msgstr ""
+
+#: editor/editor_data.cpp
+msgid "Storing local changes.."
+msgstr ""
+
+#: editor/editor_data.cpp
+msgid "Updating scene.."
+msgstr ""
+
+#: editor/editor_data.cpp
+msgid "[empty]"
+msgstr ""
+
+#: editor/editor_data.cpp
+msgid "[unsaved]"
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp
+msgid "Please select a base directory first"
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose a Directory"
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp
+msgid "Create Folder"
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/editor_plugin_settings.cpp editor/filesystem_dock.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+#: scene/gui/file_dialog.cpp
+msgid "Name:"
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
+#: editor/filesystem_dock.cpp scene/gui/file_dialog.cpp
+msgid "Could not create folder."
+msgstr ""
+
+#: editor/editor_dir_dialog.cpp
+msgid "Choose"
+msgstr ""
+
+#: editor/editor_export.cpp
+msgid "Storing File:"
+msgstr ""
+
+#: editor/editor_export.cpp
+msgid "Packing"
+msgstr ""
+
+#: editor/editor_export.cpp platform/javascript/export/export.cpp
+msgid "Template file not found:"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "File Exists, Overwrite?"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Select Current Folder"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
+msgid "Copy Path"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp editor/filesystem_dock.cpp
+msgid "New Folder.."
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Refresh"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Recognized"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "All Files (*)"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Open a File"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Open File(s)"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Open a Directory"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Open a File or Directory"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp editor/editor_node.cpp
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp scene/gui/file_dialog.cpp
+msgid "Save"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Save a File"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Back"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Forward"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Go Up"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Hidden Files"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Favorite"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Toggle Mode"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Focus Path"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Up"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Move Favorite Down"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Go to parent folder"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Directories & Files:"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp
+msgid "Preview:"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp editor/script_editor_debugger.cpp
+#: scene/gui/file_dialog.cpp
+msgid "File:"
+msgstr ""
+
+#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
+msgid "Must use a valid extension."
+msgstr ""
+
+#: editor/editor_file_system.cpp
+msgid "ScanSources"
+msgstr ""
+
+#: editor/editor_file_system.cpp
+msgid "(Re)Importing Assets"
+msgstr ""
+
+#: editor/editor_help.cpp editor/editor_node.cpp
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search Help"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Class List:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Search Classes"
+msgstr ""
+
+#: editor/editor_help.cpp editor/plugins/spatial_editor_plugin.cpp
+msgid "Top"
+msgstr ""
+
+#: editor/editor_help.cpp editor/property_editor.cpp
+msgid "Class:"
+msgstr ""
+
+#: editor/editor_help.cpp editor/scene_tree_editor.cpp
+msgid "Inherits:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Inherited by:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Brief Description:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Members"
+msgstr ""
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Members:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Public Methods"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Public Methods:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "GUI Theme Items"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "GUI Theme Items:"
+msgstr ""
+
+#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Signals:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Enumerations"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Enumerations:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "enum "
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Constants"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Constants:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Description"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Online Tutorials:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid ""
+"There are currently no tutorials for this class, you can [color=$color][url="
+"$url]contribute one[/url][/color] or [color=$color][url=$url2]request one[/"
+"url][/color]."
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Properties"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Property Description:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid ""
+"There is currently no description for this property. Please help us by "
+"[color=$color][url=$url]contributing one[/url][/color]!"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Methods"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Method Description:"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid ""
+"There is currently no description for this method. Please help us by [color="
+"$color][url=$url]contributing one[/url][/color]!"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Search Text"
+msgstr ""
+
+#: editor/editor_help.cpp
+msgid "Find"
+msgstr ""
+
+#: editor/editor_log.cpp
+msgid "Output:"
+msgstr ""
+
+#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/property_editor.cpp editor/script_editor_debugger.cpp
+#: modules/gdnative/gdnative_library_editor_plugin.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Clear"
+msgstr ""
+
+#: editor/editor_log.cpp
+msgid "Clear Output"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+msgid "Error saving resource!"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save Resource As.."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/spatial_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp
+msgid "I see.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't open file for writing:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Requested file format unknown:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error while saving."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't open '%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error while parsing '%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Unexpected end of file '%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Missing '%s' or its dependencies."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error while loading '%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Saving Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Analyzing"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Creating Thumbnail"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This operation can't be done without a tree root."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Couldn't save scene. Likely dependencies (instances or inheritance) couldn't "
+"be satisfied."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Failed to load resource."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't load MeshLibrary for merging!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error saving MeshLibrary!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't load TileSet for merging!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error saving TileSet!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Error trying to save layout!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Default editor layout overridden."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Layout name not found!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Restored default layout to base settings."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This resource belongs to a scene that was imported, so it's not editable.\n"
+"Please read the documentation relevant to importing scenes to better "
+"understand this workflow."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This resource belongs to a scene that was instanced or inherited.\n"
+"Changes to it will not be kept when saving the current scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This resource was imported, so it's not editable. Change its settings in the "
+"import panel and then re-import."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This scene was imported, so changes to it will not be kept.\n"
+"Instancing it or inheriting will allow making changes to it.\n"
+"Please read the documentation relevant to importing scenes to better "
+"understand this workflow."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This is a remote object so changes to it will not be kept.\n"
+"Please read the documentation relevant to debugging to better understand "
+"this workflow."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Expand all properties"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Collapse all properties"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Copy Params"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Paste Params"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Paste Resource"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Copy Resource"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Make Built-In"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Make Sub-Resources Unique"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open in Help"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "There is no defined scene to run."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"No main scene has ever been defined, select one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' does not exist, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Selected scene '%s' is not a scene file, select a valid one?\n"
+"You can change it later in \"Project Settings\" under the 'application' "
+"category."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Current scene was never saved, please save it prior to running."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Could not start subprocess!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Base Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Open Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Open Script.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save & Close"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save changes to '%s' before closing?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Scene As.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "No"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Yes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This scene has never been saved. Save before running?"
+msgstr ""
+
+#: editor/editor_node.cpp editor/scene_tree_dock.cpp
+msgid "This operation can't be done without a scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Mesh Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This operation can't be done without a root node."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Tile Set"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This operation can't be done without a selected node."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Current scene not saved. Open anyway?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Can't reload a scene that was never saved."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Revert"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "This action cannot be undone. Revert anyway?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quick Run Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quit"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Exit the editor?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Project Manager?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save & Quit"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save changes to the following scene(s) before quitting?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save changes the following scene(s) before opening Project Manager?"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"This option is deprecated. Situations where refresh must be forced are now "
+"considered a bug. Please report."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pick a Main Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Unable to enable addon plugin at: '%s' parsing of config failed."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Unable to find script field for addon plugin at: 'res://addons/%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Unable to load addon script from path: '%s'."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Unable to load addon script from path: '%s' Base type is not EditorPlugin."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Unable to load addon script from path: '%s' Script is not in tool mode."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Scene '%s' was automatically imported, so it can't be modified.\n"
+"To make changes to it, a new inherited scene can be created."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Ugh"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Error loading scene, it must be inside the project path. Use 'Import' to "
+"open the scene, then save it inside the project path."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Scene '%s' has broken dependencies:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Clear Recent Scenes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Layout"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Delete Layout"
+msgstr ""
+
+#: editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
+msgid "Default"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Switch Scene Tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "%d more files or folders"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "%d more folders"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "%d more files"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Dock Position"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Distraction Free Mode"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Toggle distraction-free mode."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Add a new scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to previously opened scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Next tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Previous tab"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Filter Files.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Operations with scene files."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Inherited Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Scene.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save all Scenes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Close Scene"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Open Recent"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Convert To.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "MeshLibrary.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "TileSet.."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Undo"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
+#: scene/gui/line_edit.cpp
+msgid "Redo"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Revert Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Miscellaneous project or scene-wide tools."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Project"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Project Settings"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Run Script"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Tools"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Quit to Project List"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Deploy with Remote Debug"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When exporting or deploying, the resulting executable will attempt to "
+"connect to the IP of this computer in order to be debugged."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Small Deploy with Network FS"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is enabled, export or deploy will produce a minimal "
+"executable.\n"
+"The filesystem will be provided from the project by the editor over the "
+"network.\n"
+"On Android, deploy will use the USB cable for faster performance. This "
+"option speeds up testing for games with a large footprint."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Collision Shapes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Collision shapes and raycast nodes (for 2D and 3D) will be visible on the "
+"running game if this option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Visible Navigation"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"Navigation meshes and polygons will be visible on the running game if this "
+"option is turned on."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Scene Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any changes made to the scene in the editor "
+"will be replicated in the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Sync Script Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid ""
+"When this option is turned on, any script that is saved will be reloaded on "
+"the running game.\n"
+"When used remotely on a device, this is more efficient with network "
+"filesystem."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Editor"
+msgstr ""
+
+#: editor/editor_node.cpp editor/settings_config_dialog.cpp
+msgid "Editor Settings"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Editor Layout"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Toggle Fullscreen"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Manage Export Templates"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Help"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Classes"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_settings_editor.cpp
+msgid "Search"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Online Docs"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Q&A"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Issue Tracker"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp
+msgid "Community"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "About"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the project."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause the scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Pause Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop the scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Stop"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play the edited scene."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play custom scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Play Custom Scene"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Spins when the editor window repaints!"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Update Always"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Update Changes"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Disable Update Spinner"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Inspector"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Create a new resource in memory and edit it."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Load an existing resource from disk and edit it."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Save the currently edited resource."
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Save As.."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to the previous edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Go to the next edited object in history."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "History of recently edited objects."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Object properties."
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Changes may be lost!"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/asset_library_editor_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Import"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Node"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "FileSystem"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Output"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Don't Save"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Import Templates From ZIP File"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_export.cpp
+msgid "Export Project"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Export Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Merge With Existing"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Password:"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open & Run a Script"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "New Inherited"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Load Errors"
+msgstr ""
+
+#: editor/editor_node.cpp editor/plugins/tile_map_editor_plugin.cpp
+msgid "Select"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 2D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open 3D Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open Script Editor"
+msgstr ""
+
+#: editor/editor_node.cpp editor/project_manager.cpp
+msgid "Open Asset Library"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the next Editor"
+msgstr ""
+
+#: editor/editor_node.cpp
+msgid "Open the previous Editor"
+msgstr ""
+
+#: editor/editor_plugin.cpp
+msgid "Creating Mesh Previews"
+msgstr ""
+
+#: editor/editor_plugin.cpp
+msgid "Thumbnail.."
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Installed Plugins:"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Update"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Version:"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Author:"
+msgstr ""
+
+#: editor/editor_plugin_settings.cpp
+msgid "Status:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Stop Profiling"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Start Profiling"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Measure:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame Time (sec)"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Average Time (sec)"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame %"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Physics Frame %"
+msgstr ""
+
+#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
+msgid "Time:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Inclusive"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Self"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Frame #:"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Time"
+msgstr ""
+
+#: editor/editor_profiler.cpp
+msgid "Calls"
+msgstr ""
+
+#: editor/editor_run_native.cpp
+msgid "Select device from the list"
+msgstr ""
+
+#: editor/editor_run_native.cpp
+msgid ""
+"No runnable export preset found for this platform.\n"
+"Please add a runnable preset in the export menu."
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Write your logic in the _run() method."
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "There is an edited scene already."
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't instance script:"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the 'tool' keyword?"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Couldn't run script:"
+msgstr ""
+
+#: editor/editor_run_script.cpp
+msgid "Did you forget the '_run' method?"
+msgstr ""
+
+#: editor/editor_settings.cpp
+msgid "Default (Same as Editor)"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Select Node(s) to Import"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Scene Path:"
+msgstr ""
+
+#: editor/editor_sub_scene.cpp
+msgid "Import From Node:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Re-Download"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Uninstall"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Installed)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Download"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Missing)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "(Current)"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Retrieving mirrors, please wait.."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Remove template version '%s'?"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Can't open export templates zip."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Invalid version.txt format inside templates."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "No version.txt found inside templates."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Error creating path for templates:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Extracting Export Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Importing:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid ""
+"No download links found for this version. Direct download is only available "
+"for official releases."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Can't resolve."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Can't connect."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "No response."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Request Failed."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Redirect Loop."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Failed:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Download Complete."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Error requesting url: "
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Connecting to Mirror.."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Disconnected"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Resolving"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Can't Resolve"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Connecting.."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Can't Connect"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Connected"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Requesting.."
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Downloading"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Connection Error"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "SSL Handshake Error"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Current Version:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Installed Versions:"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Install From File"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Remove Template"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Select template file"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Export Template Manager"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Download Templates"
+msgstr ""
+
+#: editor/export_template_manager.cpp
+msgid "Select mirror from list: "
+msgstr ""
+
+#: editor/file_type_cache.cpp
+msgid "Can't open file_type_cache.cch for writing, not saving file type cache!"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot navigate to '%s' as it has not been found in the file system!"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "View items as a grid of thumbnails"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "View items as a list"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Status: Import of file failed. Please fix file and reimport manually."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot move/rename resources root."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Cannot move a folder into itself."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Error moving:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Error duplicating:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Unable to update dependencies:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "No name provided"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Provided name contains invalid characters"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "No name provided."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Name contains invalid characters."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "A file or folder with this name already exists."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Renaming file:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Renaming folder:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Duplicating file:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Duplicating folder:"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Expand all"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Collapse all"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Rename.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Move To.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Open Scene(s)"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Instance"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Edit Dependencies.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "View Owners.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Duplicate.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Previous Directory"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Next Directory"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Re-Scan Filesystem"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Toggle folder status as Favorite"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Instance the selected scene(s) as child of the selected node."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid ""
+"Scanning Files,\n"
+"Please Wait.."
+msgstr ""
+
+#: editor/filesystem_dock.cpp
+msgid "Move"
+msgstr ""
+
+#: editor/filesystem_dock.cpp editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/project_manager.cpp
+msgid "Rename"
+msgstr ""
+
+#: editor/groups_editor.cpp
+msgid "Add to Group"
+msgstr ""
+
+#: editor/groups_editor.cpp
+msgid "Remove from Group"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import as Single Scene"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Animations"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Materials"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Objects"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Objects+Materials"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Objects+Animations"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Materials+Animations"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import with Separate Objects+Materials+Animations"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import as Multiple Scenes"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Import as Multiple Scenes+Materials"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import Scene"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Importing Scene.."
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Generating Lightmaps"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Generating for Mesh: "
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Running Custom Script.."
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Couldn't load post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Invalid/broken script for post-import (check console):"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Error running post-import script:"
+msgstr ""
+
+#: editor/import/resource_importer_scene.cpp
+msgid "Saving.."
+msgstr ""
+
+#: editor/import_dock.cpp
+msgid "Set as Default for '%s'"
+msgstr ""
+
+#: editor/import_dock.cpp
+msgid "Clear Default for '%s'"
+msgstr ""
+
+#: editor/import_dock.cpp
+msgid " Files"
+msgstr ""
+
+#: editor/import_dock.cpp
+msgid "Import As:"
+msgstr ""
+
+#: editor/import_dock.cpp editor/property_editor.cpp
+msgid "Preset.."
+msgstr ""
+
+#: editor/import_dock.cpp
+msgid "Reimport"
+msgstr ""
+
+#: editor/multi_node_edit.cpp
+msgid "MultiNode Set"
+msgstr ""
+
+#: editor/node_dock.cpp
+msgid "Groups"
+msgstr ""
+
+#: editor/node_dock.cpp
+msgid "Select a Node to edit Signals and Groups."
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Poly"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Edit Poly"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+msgid "Insert Point"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Edit Poly (Remove Point)"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+msgid "Remove Poly And Point"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+msgid "Create a new polygon from scratch"
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+msgid ""
+"Edit existing polygon:\n"
+"LMB: Move Point.\n"
+"Ctrl+LMB: Split Segment.\n"
+"RMB: Erase Point."
+msgstr ""
+
+#: editor/plugins/abstract_polygon_2d_editor.cpp
+msgid "Delete points"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Toggle Autoplay"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "New Anim"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Delete Animation?"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Remove Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Invalid animation name!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: Animation name already exists!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Rename Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Next Changed"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Change Blend Time"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Duplicate Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to copy!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation resource on clipboard!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Pasted Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Paste Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "ERROR: No animation to edit!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from current pos. (A)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation backwards from end. (Shift+A)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Stop animation playback. (S)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from start. (Shift+D)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Play selected animation from current pos. (D)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation position (in seconds)."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Scale animation playback globally for the node."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create new animation in player."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load animation from disk."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Load an animation from disk."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Save the current animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Display list of animations in player."
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Autoplay on Load"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Edit Target Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Tools"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Copy Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Onion Skinning"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Enable Onion Skinning"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Directions"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Past"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Future"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Depth"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "1 step"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "2 steps"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "3 steps"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Differences Only"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Force White Modulate"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Include Gizmos (3D)"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Create New Animation"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Animation Name:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: editor/script_create_dialog.cpp
+msgid "Error!"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Blend Times:"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Next (Auto Queue):"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+msgid "Cross-Animation Blend Times"
+msgstr ""
+
+#: editor/plugins/animation_player_editor_plugin.cpp
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Animation"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "New name:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Filters"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Scale:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade In (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Fade Out (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Auto Restart:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Random Restart (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Start!"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Amount:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 0:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend 1:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "X-Fade Time (s):"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Current:"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Add Input"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Clear Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Set Auto-Advance"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Delete Input"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is valid."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation tree is invalid."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Animation Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "OneShot Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Mix Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend2 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend3 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Blend4 Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeScale Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "TimeSeek Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Transition Node"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Import Animations.."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Edit Node Filters"
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "Filters.."
+msgstr ""
+
+#: editor/plugins/animation_tree_editor_plugin.cpp
+msgid "AnimationTree"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Free"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Contents:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "View Files"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Can't resolve hostname:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Connection error, please try again."
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Can't connect to host:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "No response from host:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Request failed, return code:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Request failed, too many redirects"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Bad download hash, assuming file has been tampered with."
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Expected:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Got:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Failed sha256 hash check"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Asset Download Error:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Fetching:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Resolving.."
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Error making request"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Idle"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Retry"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Download Error"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Download for this asset is already in progress!"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "first"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "prev"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "next"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "last"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "All"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+#: editor/project_settings_editor.cpp
+msgid "Plugins"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Sort:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Reverse"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+#: editor/project_settings_editor.cpp
+msgid "Category:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Site:"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Support.."
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Official"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Testing"
+msgstr ""
+
+#: editor/plugins/asset_library_editor_plugin.cpp
+msgid "Assets ZIP File"
+msgstr ""
+
+#: editor/plugins/baked_lightmap_editor_plugin.cpp
+msgid ""
+"Can't determine a save path for lightmap images.\n"
+"Save your scene (for images to be saved in the same dir), or pick a save "
+"path from the BakedLightmap properties."
+msgstr ""
+
+#: editor/plugins/baked_lightmap_editor_plugin.cpp
+msgid ""
+"No meshes to bake. Make sure they contain an UV2 channel and that the 'Bake "
+"Light' flag is on."
+msgstr ""
+
+#: editor/plugins/baked_lightmap_editor_plugin.cpp
+msgid "Failed creating lightmap images, make sure path is writable."
+msgstr ""
+
+#: editor/plugins/baked_lightmap_editor_plugin.cpp
+msgid "Bake Lightmaps"
+msgstr ""
+
+#: editor/plugins/camera_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Preview"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Offset:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotation Step:"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Pivot"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Action"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move vertical guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Create new vertical guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Remove vertical guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move horizontal guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Create new horizontal guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Remove horizontal guide"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Create new horizontal and vertical guides"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Edit CanvasItem"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Anchors only"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change Anchors and Margins"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change Anchors"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Paste Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Select Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag: Rotate"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+Drag: Move"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Alt+RMB: Depth list selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Move Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Rotate Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Show a list of all objects at the position clicked\n"
+"(same as Alt+RMB in select mode)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Click to change object's rotation pivot."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Pan Mode"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Toggles snapping"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snapping options"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to grid"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Rotation Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Configure Snap..."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap Relative"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Use Pixel Snap"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Smart snapping"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to parent"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to node anchor"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to node sides"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to other nodes"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Snap to guides"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Lock the selected object in place (can't be moved)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Unlock the selected object (can be moved)."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Makes sure the object's children are not selectable."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Restores the object's children's ability to be selected."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Bones"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Make IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear IK Chain"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Show Grid"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Helpers"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Rulers"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Guides"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Center Selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Frame Selection"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Layout"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Keys"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Insert Key (Existing Tracks)"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Copy Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Clear Pose"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Drag pivot from mouse position"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Set pivot at mouse position"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Multiply grid step by 2"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Divide grid step by 2"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Add %s"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Adding %s..."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Ok"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Cannot instantiate multiple nodes without root."
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Create Node"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "Error instancing scene from %s"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Change default type"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid ""
+"Drag & drop + Shift : Add node as sibling\n"
+"Drag & drop + Alt : Change node type"
+msgstr ""
+
+#: editor/plugins/collision_polygon_editor_plugin.cpp
+msgid "Create Poly3D"
+msgstr ""
+
+#: editor/plugins/collision_shape_2d_editor_plugin.cpp
+msgid "Set Handle"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove item %d?"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Add Item"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Remove Selected Item"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Import from Scene"
+msgstr ""
+
+#: editor/plugins/cube_grid_theme_editor_plugin.cpp
+msgid "Update from Scene"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Flat0"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Flat1"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Ease in"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Ease out"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Smoothstep"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve Point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Modify Curve Tangent"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load Curve Preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Add point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Remove point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Left linear"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Right linear"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Load preset"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Remove Curve Point"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Toggle Curve Linear Tangent"
+msgstr ""
+
+#: editor/plugins/curve_editor_plugin.cpp
+msgid "Hold Shift to edit tangents individually"
+msgstr ""
+
+#: editor/plugins/gi_probe_editor_plugin.cpp
+msgid "Bake GI Probe"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+msgid "Add/Remove Color Ramp Point"
+msgstr ""
+
+#: editor/plugins/gradient_editor_plugin.cpp
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Color Ramp"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item %d"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Items"
+msgstr ""
+
+#: editor/plugins/item_list_editor_plugin.cpp
+msgid "Item List Editor"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid ""
+"No OccluderPolygon2D resource on this node.\n"
+"Create and assign one?"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create Occluder Polygon"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Create a new polygon from scratch."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Edit existing polygon:"
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "LMB: Move Point."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "Ctrl+LMB: Split Segment."
+msgstr ""
+
+#: editor/plugins/light_occluder_2d_editor_plugin.cpp
+msgid "RMB: Erase Point."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh is empty!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Trimesh Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Static Convex Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "This doesn't work on scene root!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Shape"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Navigation Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Contained Mesh is not of type ArrayMesh."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "UV Unwrap failed, mesh may not be manifold?"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "No mesh to debug."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Model has no UV in this layer"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "MeshInstance lacks a Mesh!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh has not surface to create outlines from!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Could not create outline!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Static Body"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Trimesh Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Convex Collision Sibling"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh.."
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "View UV1"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "View UV2"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Unwrap UV2 for Lightmap/AO"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Create Outline Mesh"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Outline Size:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and no MultiMesh set in node)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No mesh source specified (and MultiMesh contains no Mesh)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (invalid path)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (not a MeshInstance)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh source is invalid (contains no Mesh resource)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "No surface source specified."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (invalid path)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no geometry)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Surface source is invalid (no faces)."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Parent has no solid faces to populate."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Couldn't map area."
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Select a Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate Surface"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate MultiMesh"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Target Surface:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Source Mesh:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "X-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Y-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Z-Axis"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Mesh Up Axis:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Rotation:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Tilt:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Random Scale:"
+msgstr ""
+
+#: editor/plugins/multimesh_editor_plugin.cpp
+msgid "Populate"
+msgstr ""
+
+#: editor/plugins/navigation_mesh_editor_plugin.cpp
+msgid "Bake!"
+msgstr ""
+
+#: editor/plugins/navigation_mesh_editor_plugin.cpp
+msgid "Bake the navigation mesh."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_editor_plugin.cpp
+msgid "Clear the navigation mesh."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Setting up Configuration..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Calculating grid size..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Creating heightfield..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Marking walkable triangles..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Constructing compact heightfield..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Eroding walkable area..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Partitioning..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Creating contours..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Creating polymesh..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Converting to native navigation mesh..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Navigation Mesh Generator Setup:"
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Parsing Geometry..."
+msgstr ""
+
+#: editor/plugins/navigation_mesh_generator.cpp
+msgid "Done!"
+msgstr ""
+
+#: editor/plugins/navigation_polygon_editor_plugin.cpp
+msgid "Create Navigation Polygon"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generating AABB"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Can only set point into a ParticlesMaterial process material"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Error loading image:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "No pixels with transparency > 128 in image.."
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generate Visibility Rect"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Load Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Clear Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Particles"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Generated Point Count:"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generation Time (sec):"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Mask"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Capture from Pixel"
+msgstr ""
+
+#: editor/plugins/particles_2d_editor_plugin.cpp
+msgid "Emission Colors"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Node does not contain geometry (faces)."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "A processor material of type 'ParticlesMaterial' is required."
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Faces contain no area!"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "No faces!"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate AABB"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Mesh"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emission Points From Node"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Create Emitter"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Points:"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Surface Points+Normal (Directed)"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Volume"
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Emission Source: "
+msgstr ""
+
+#: editor/plugins/particles_editor_plugin.cpp
+msgid "Generate Visibility AABB"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Out-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove In-Control from Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point to Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Point in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move In-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Move Out-Control in Curve"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Select Points"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Shift+Drag: Select Control Points"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Click: Add Point"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Right Click: Delete Point"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Select Control Points (Shift+Drag)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Add Point (in empty space)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Segment (in curve)"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Delete Point"
+msgstr ""
+
+#: editor/plugins/path_2d_editor_plugin.cpp
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Close Curve"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Curve Point #"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Point Position"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve In Position"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Set Curve Out Position"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Split Path"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Path Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove Out-Control Point"
+msgstr ""
+
+#: editor/plugins/path_editor_plugin.cpp
+msgid "Remove In-Control Point"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Create UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Transform UV Map"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon 2D UV Editor"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Point"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Ctrl: Rotate"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift: Move All"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Shift+Ctrl: Scale"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Move Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Rotate Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Scale Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/shader_editor_plugin.cpp editor/project_manager.cpp
+#: editor/project_settings_editor.cpp editor/property_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Polygon->UV"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "UV->Polygon"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Clear UV"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Enable Snap"
+msgstr ""
+
+#: editor/plugins/polygon_2d_editor_plugin.cpp
+msgid "Grid"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ERROR: Couldn't load resource!"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Add Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Rename Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Delete Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "Resource clipboard is empty!"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/scene_tree_dock.cpp editor/scene_tree_editor.cpp
+msgid "Open in Editor"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/scene_tree_editor.cpp
+msgid "Instance:"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/theme_editor_plugin.cpp editor/project_settings_editor.cpp
+#: editor/scene_tree_editor.cpp editor/script_editor_debugger.cpp
+msgid "Type:"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Load Resource"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Paste"
+msgstr ""
+
+#: editor/plugins/resource_preloader_editor_plugin.cpp
+msgid "ResourcePreloader"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Clear Recent Files"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close and save changes?"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error while saving theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error saving"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Error importing"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Import Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As.."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid " Class Reference"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Sort"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Move Up"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Move Down"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Next script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Previous script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "File"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "New"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save All"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Soft Reload Script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Copy Script Path"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Show In File System"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Prev"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "History Next"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Save Theme As"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Docs"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close All"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Close Other Tabs"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
+msgid "Run"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Toggle Scripts Panel"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+msgid "Find.."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+#: editor/plugins/script_text_editor.cpp
+msgid "Find Next"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Over"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Step Into"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Break"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp
+#: editor/script_editor_debugger.cpp
+msgid "Continue"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Keep Debugger Open"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Debug with external editor"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Open Godot online documentation"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the class hierarchy."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Search the reference documentation."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to previous edited document."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Go to next edited document."
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Discard"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Create Script"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"The following files are newer on disk.\n"
+"What action should be taken?:"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Reload"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid "Resave"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Debugger"
+msgstr ""
+
+#: editor/plugins/script_editor_plugin.cpp
+msgid ""
+"Built-in scripts can only be edited when the scene they belong to is loaded"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Only resources from filesystem can be dropped."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Pick Color"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Case"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Capitalize"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Cut"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
+#: scene/gui/line_edit.cpp scene/gui/text_edit.cpp
+msgid "Copy"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp scene/gui/line_edit.cpp
+#: scene/gui/text_edit.cpp
+msgid "Select All"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Delete Line"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Left"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Indent Right"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Toggle Comment"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Fold/Unfold Line"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Fold All Lines"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Unfold All Lines"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Clone Down"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Complete Symbol"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Trim Trailing Whitespace"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Spaces"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert Indent To Tabs"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Auto Indent"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Toggle Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Remove All Breakpoints"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Next Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Previous Breakpoint"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Uppercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Convert To Lowercase"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Find Previous"
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Replace.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Function.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Goto Line.."
+msgstr ""
+
+#: editor/plugins/script_text_editor.cpp
+msgid "Contextual Help"
+msgstr ""
+
+#: editor/plugins/shader_editor_plugin.cpp
+msgid "Shader"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Constant"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Scalar Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Operator"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Toggle Rot Only"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Function"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Scalar Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Vec Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change RGB Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Default Value"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change XForm Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Texture Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Cubemap Uniform"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Comment"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Color Ramp"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add/Remove to Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Modify Curve Map"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Change Input Name"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Connect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Disconnect Graph Nodes"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Remove Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Move Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Duplicate Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Delete Shader Graph Node(s)"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Cyclic Connection Link"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Error: Missing Input Connections"
+msgstr ""
+
+#: editor/plugins/shader_graph_editor_plugin.cpp
+msgid "Add Shader Graph Node"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Orthogonal"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Aborted."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "X-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Y-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Z-Axis Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Plane Transform."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scaling: "
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translating: "
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotating %s degrees."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Keying is disabled (no key inserted)."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Animation Key Inserted."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Objects Drawn"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Material Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Shader Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Surface Changes"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Draw Calls"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Vertices"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "FPS"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align with view"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "OK :("
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "No parent to instance a child at."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp editor/scene_tree_dock.cpp
+msgid "This operation requires a single selected node."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Normal"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Wireframe"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Overdraw"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Display Unshaded"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Environment"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Gizmos"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View FPS"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Half Resolution"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Audio Listener"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Doppler Enable"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Left"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Right"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Forward"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Backwards"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Down"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "XForm Dialog"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Select Mode (Q)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid ""
+"Drag: Rotate\n"
+"Alt+Drag: Move\n"
+"Alt+RMB: Depth list selection"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Move Mode (W)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Mode (E)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Mode (R)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Local Space Mode (%s)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Mode (%s)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Bottom View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Top View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rear View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Front View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Left View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Right View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Switch Perspective/Orthogonal view"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Insert Animation Key"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Origin"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Focus Selection"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Align Selection With View"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Select"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Move"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Rotate"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Tool Scale"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Toggle Freelook"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Configure Snap.."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "1 Viewport"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "2 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "3 Viewports (Alt)"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "4 Viewports"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Origin"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Grid"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Skeleton Gizmo visibility"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Snap Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate Snap:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate Snap (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale Snap (%):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Viewport Settings"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Perspective FOV (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Near:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "View Z-Far:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Change"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Translate:"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Rotate (deg.):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Scale (ratio):"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Type"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Pre"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Post"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "ERROR: Couldn't load frame resource!"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Frame"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Resource clipboard is empty or not a texture!"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Paste Frame"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Add Empty"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation Loop"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Change Animation FPS"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "(empty)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animations"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Speed (FPS):"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Loop"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Animation Frames"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (Before)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Insert Empty (After)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Move (Before)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "Move (After)"
+msgstr ""
+
+#: editor/plugins/sprite_frames_editor_plugin.cpp
+msgid "SpriteFrames"
+msgstr ""
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox Preview:"
+msgstr ""
+
+#: editor/plugins/style_box_editor_plugin.cpp
+msgid "StyleBox"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Set Region Rect"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Snap Mode:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "<None>"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Pixel Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Grid Snap"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Auto Slice"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Offset:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Step:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Separation:"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region"
+msgstr ""
+
+#: editor/plugins/texture_region_editor_plugin.cpp
+msgid "Texture Region Editor"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Can't save theme to file:"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add All"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Remove Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove All Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove All"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Edit theme.."
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme editing menu."
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Add Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Remove Class Items"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Template"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create Empty Editor Template"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Create From Current Editor Theme"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio1"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "CheckBox Radio2"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Check Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Has"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Many"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
+msgid "Options"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Have,Many,Several,Options!"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 1"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 2"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Tab 3"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Data Type:"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Icon"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Style"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Font"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Color"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Theme"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase Selection"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Line Draw"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rectangle Paint"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Bucket Fill"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase TileMap"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Erase selection"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Find tile"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Transpose"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror X"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Mirror Y"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Paint Tile"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Pick Tile"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 0 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 90 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 180 degrees"
+msgstr ""
+
+#: editor/plugins/tile_map_editor_plugin.cpp
+msgid "Rotate 270 degrees"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Could not find tile:"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Item name or ID:"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from scene?"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from scene?"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Tile Set"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Create from Scene"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Merge from Scene"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
+msgid "Error"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Autotiles"
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid ""
+"Select sub-tile to use as icon, this will be also used on invalid autotile "
+"bindings."
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid ""
+"LMB: set bit on.\n"
+"RMB: set bit off."
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Select current edited sub-tile."
+msgstr ""
+
+#: editor/plugins/tile_set_editor_plugin.cpp
+msgid "Select sub-tile to change its priority."
+msgstr ""
+
+#: editor/progress_dialog.cpp scene/gui/dialogs.cpp
+msgid "Cancel"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Runnable"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Delete patch '%s' from list?"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Delete preset '%s'?"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing/corrupted: "
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Presets"
+msgstr ""
+
+#: editor/project_export.cpp editor/project_settings_editor.cpp
+msgid "Add.."
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Resources"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export all resources in the project"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export selected scenes (and dependencies)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export selected resources (and dependencies)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export Mode:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Resources to export:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid ""
+"Filters to exclude files from project (comma separated, e.g: *.json, *.txt)"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Patches"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Make Patch"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Features"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Custom (comma-separated):"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Feature List:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export PCK/Zip"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export templates for this platform are missing/corrupted:"
+msgstr ""
+
+#: editor/project_export.cpp
+msgid "Export With Debug"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "The path does not exist."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Please choose a 'project.godot' file."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Please choose an empty folder."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Imported Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Couldn't create folder."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "There is already a folder in this path with the specified name."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "It would be a good idea to name your project."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Invalid project path (changed anything?)."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"Couldn't load project.godot in project path (error %d). It may be missing or "
+"corrupted."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Couldn't edit project.godot in project path."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Couldn't create project.godot in project path."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "The following files failed extraction from package:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Rename Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "New Game Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Import Existing Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Import & Edit"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Create New Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Create & Edit"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Install Project:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Install & Edit"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Name:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Create folder"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Path:"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Browse"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Unnamed Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Can't open project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Are you sure to open more than one project?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"Can't run project: no main scene defined.\n"
+"Please edit the project and set the main scene in \"Project Settings\" under "
+"the \"Application\" category."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"Can't run project: Assets need to be imported.\n"
+"Please edit the project to trigger the initial import."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Are you sure to run more than one project?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Remove project from the list? (Folder contents will not be modified)"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"Language changed.\n"
+"The UI will update next time the editor or project manager starts."
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"You are about the scan %s folders for existing Godot projects. Do you "
+"confirm?"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project Manager"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Project List"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Scan"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Select a Folder to Scan"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "New Project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Templates"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Exit"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Restart Now"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid "Can't run project"
+msgstr ""
+
+#: editor/project_manager.cpp
+msgid ""
+"You don't currently have any projects.\n"
+"Would you like to explore the official example projects in the Asset Library?"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Key "
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Joy Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Joy Axis"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Mouse Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Action '%s' already exists!"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Rename Input Action Event"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Input Action Event"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
+msgid "Shift+"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
+msgid "Alt+"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
+msgid "Control+"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
+msgid "Press a Key.."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Mouse Button Index:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Left Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Right Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Middle Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Wheel Up Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Wheel Down Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Button 6"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Button 7"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Button 8"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Button 9"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Joypad Axis Index:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Axis"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Joypad Button Index:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Erase Input Action"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Erase Input Action Event"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Event"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Device"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Button"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Left Button."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Right Button."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Middle Button."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Wheel Up."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Wheel Down."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Global Property"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Select a setting item first!"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "No property '%s' exists."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Setting '%s' is internal, and it can't be deleted."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Delete Item"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Already existing"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Input Action"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Error saving settings."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Settings saved OK."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Override for Feature"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Translation"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Remove Translation"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Add Remapped Path"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Resource Remap Add Remap"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Change Resource Remap Language"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Remove Resource Remap"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Remove Resource Remap Option"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Changed Locale Filter"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Changed Locale Filter Mode"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Project Settings (project.godot)"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
+msgid "General"
+msgstr ""
+
+#: editor/project_settings_editor.cpp editor/property_editor.cpp
+msgid "Property:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Override For.."
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Input Map"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Action:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Device:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Index:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Localization"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Translations"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Translations:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Remaps"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Resources:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Remaps by Locale:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Locale"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Locales Filter"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Show all locales"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Show only selected locales"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Filter mode:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "Locales:"
+msgstr ""
+
+#: editor/project_settings_editor.cpp
+msgid "AutoLoad"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Pick a Viewport"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Ease Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Zero"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing In-Out"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Easing Out-In"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "File.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Dir.."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Assign"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Select Node"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "New Script"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "New %s"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Make Unique"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Show in File System"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Convert To %s"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Error loading file: Not a resource!"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Selected node is not a Viewport!"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Pick a Node"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Bit %d, val %d."
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "On"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "[Empty]"
+msgstr ""
+
+#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
+msgid "Set"
+msgstr ""
+
+#: editor/property_editor.cpp
+msgid "Properties:"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Property"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Virtual Method"
+msgstr ""
+
+#: editor/property_selector.cpp
+msgid "Select Method"
+msgstr ""
+
+#: editor/pvrtc_compress.cpp
+msgid "Could not execute PVRTC tool:"
+msgstr ""
+
+#: editor/pvrtc_compress.cpp
+msgid "Can't load back converted image using PVRTC tool:"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent Node"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Reparent Location (Select new Parent):"
+msgstr ""
+
+#: editor/reparent_dialog.cpp
+msgid "Keep Global Transform"
+msgstr ""
+
+#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
+msgid "Reparent"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Run Mode:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Current Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Main Scene Arguments:"
+msgstr ""
+
+#: editor/run_settings_dialog.cpp
+msgid "Scene Run Settings"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp editor/script_create_dialog.cpp
+#: scene/gui/dialogs.cpp
+msgid "OK"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "No parent to instance the scenes at."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error loading scene from %s"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Cannot instance the scene '%s' because the current scene exists within one "
+"of its nodes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Scene(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on the tree root."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Node In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Move Nodes In Parent"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Duplicate Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)?"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can not perform with the root node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "This operation can't be done on instanced scenes."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Save New Scene As.."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Editable Children"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Load As Placeholder"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Discard Instancing"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Makes Sense!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes from a foreign scene!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Can't operate on nodes the current scene inherits from!"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Remove Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Couldn't save new scene. Likely dependencies (instances) couldn't be "
+"satisfied."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error saving scene."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Error duplicating scene to save it."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Sub-Resources"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Inheritance"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete Node(s)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Add Child Node"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Instance Child Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Change Type"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach Script"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Script"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Merge From Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Save Branch as Scene"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Copy Node Path"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Delete (No Confirm)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Add/Create a New Node"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid ""
+"Instance a scene file as a Node. Creates an inherited scene if no root node "
+"exists."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Filter nodes"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Attach a new or existing script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear a script for the selected node."
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Remote"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Local"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear Inheritance? (No Undo!)"
+msgstr ""
+
+#: editor/scene_tree_dock.cpp
+msgid "Clear!"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Spatial Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle CanvasItem Visible"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Node configuration warning:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connection(s) and group(s)\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node has connections.\n"
+"Click to show signals dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is in group(s).\n"
+"Click to show groups dock."
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Open script"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Node is locked.\n"
+"Click to unlock"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid ""
+"Children are not selectable.\n"
+"Click to make selectable"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Toggle Visibility"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Invalid node name, the following characters are not allowed:"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Rename Node"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Scene Tree (Nodes):"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Node Configuration Warning!"
+msgstr ""
+
+#: editor/scene_tree_editor.cpp
+msgid "Select a Node"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading template '%s'"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Error - Could not create script in filesystem."
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Error loading script from %s"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "N/A"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Path is empty"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Path is not local"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid base path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Directory of the same name exists"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "File exists, will be reused"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid extension"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Wrong extension chosen"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid Path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid class name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Invalid inherited parent name or path"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Script valid"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Allowed: a-z, A-Z, 0-9 and _"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in script (into scene file)"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Create new script file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Load existing script file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Language"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Inherits"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Class Name"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Template"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+msgid "Attach Node Script"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Remote "
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Bytes:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Warning"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Error:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Source:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Function:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Pick one or more items from the list to display the graph."
+msgstr ""
+
+#: editor/script_editor_debugger.cpp modules/mono/editor/mono_bottom_panel.cpp
+msgid "Errors"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Child Process Connected"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Copy Error"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Previous Instance"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Inspect Next Instance"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Frames"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Variable"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Errors:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Stack Trace (if applicable):"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Profiler"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitor"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Value"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Monitors"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "List of Video Memory Usage by Resource:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Total:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Video Mem"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Resource Path"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Type"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Format"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Usage"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Misc"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Clicked Control Type:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Live Edit Root:"
+msgstr ""
+
+#: editor/script_editor_debugger.cpp
+msgid "Set From Tree"
+msgstr ""
+
+#: editor/settings_config_dialog.cpp
+msgid "Shortcuts"
+msgstr ""
+
+#: editor/settings_config_dialog.cpp
+msgid "Binding"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Light Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change AudioStreamPlayer3D Emission Angle"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera FOV"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Camera Size"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Sphere Shape Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Box Shape Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Radius"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Capsule Shape Height"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Ray Shape Length"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Notifier Extents"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Particles AABB"
+msgstr ""
+
+#: editor/spatial_editor_gizmos.cpp
+msgid "Change Probe Extents"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Select the dynamic library for this entry"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Select dependencies of the library for this entry"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Remove current entry"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Double click to create a new entry"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Platform:"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Platform"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Dynamic Library"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "Add an architecture entry"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_editor_plugin.cpp
+msgid "GDNativeLibrary"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_singleton_editor.cpp
+msgid "Library"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_singleton_editor.cpp
+msgid "Status"
+msgstr ""
+
+#: modules/gdnative/gdnative_library_singleton_editor.cpp
+msgid "Libraries: "
+msgstr ""
+
+#: modules/gdnative/register_types.cpp
+msgid "GDNative"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Invalid type argument to convert(), use TYPE_* constants."
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp modules/mono/glue/glue_header.h
+#: modules/visual_script/visual_script_builtin_funcs.cpp
+msgid "Not enough bytes for decoding bytes, or invalid format."
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "step argument is zero!"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Not a script with an instance"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Not based on a script"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Not based on a resource file"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Invalid instance dictionary format (missing @path)"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Invalid instance dictionary format (can't load script at @path)"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Invalid instance dictionary format (invalid script at @path)"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Invalid instance dictionary (invalid subclasses)"
+msgstr ""
+
+#: modules/gdscript/gdscript_functions.cpp
+msgid "Object can't provide a length."
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Next Plane"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Previous Plane"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Plane:"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Next Floor"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Previous Floor"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Floor:"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "GridMap Delete Selection"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "GridMap Duplicate Selection"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Grid Map"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Snap View"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Clip Disabled"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Clip Above"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Clip Below"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Edit X Axis"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Edit Y Axis"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Edit Z Axis"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Rotate X"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Rotate Y"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Rotate Z"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Back Rotate X"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Back Rotate Y"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Back Rotate Z"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Cursor Clear Rotation"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Create Area"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Create Exterior Connector"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Erase Area"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Clear Selection"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "GridMap Settings"
+msgstr ""
+
+#: modules/gridmap/grid_map_editor_plugin.cpp
+msgid "Pick Distance:"
+msgstr ""
+
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Generating solution..."
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Generating C# project..."
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Failed to create solution."
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Failed to save solution."
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Done"
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Failed to create C# project."
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Mono"
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "About C# support"
+msgstr ""
+
+#: modules/mono/editor/godotsharp_editor.cpp
+msgid "Create C# solution"
+msgstr ""
+
+#: modules/mono/editor/mono_bottom_panel.cpp
+msgid "Builds"
+msgstr ""
+
+#: modules/mono/editor/mono_bottom_panel.cpp
+msgid "Build Project"
+msgstr ""
+
+#: modules/mono/editor/mono_bottom_panel.cpp
+msgid "Warnings"
+msgstr ""
+
+#: modules/mono/mono_gd/gd_mono_utils.cpp
+msgid "End of inner exception stack trace"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"A node yielded without working memory, please read the docs on how to yield "
+"properly!"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Node yielded, but did not return a function state in the first working "
+"memory."
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid ""
+"Return value must be assigned to first element of node working memory! Fix "
+"your node please."
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Node returned an invalid sequence output: "
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Found sequence bit but not the node in the stack, report bug!"
+msgstr ""
+
+#: modules/visual_script/visual_script.cpp
+msgid "Stack overflow with stack depth: "
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Signal Arguments"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Argument Type"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Argument name"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Set Variable Default Value"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Set Variable Type"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Functions:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Variables:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name is not a valid identifier:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Name already in use by another func/var/signal:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Function"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Variable"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Rename Signal"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Function"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Variable"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Signal"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Expression"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove VisualScript Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Duplicate VisualScript Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold %s to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold %s to drop a simple reference to the node."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a simple reference to the node."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold %s to drop a Variable Setter."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Hold Ctrl to drop a Variable Setter."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Preload Node"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Node(s) From Tree"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Getter Property"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Add Setter Property"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Base Type"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Move Node(s)"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove VisualScript Node"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Connect Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Condition"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Sequence"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Switch"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Iterator"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "While"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Return"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Call"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Get"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Script already has function '%s'"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Change Input Value"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Can't copy the function node."
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Clipboard is empty!"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste VisualScript Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Function"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Variable"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Remove Signal"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Variable:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Editing Signal:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Base Type:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Available Nodes:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Select or create a function to edit graph"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Signal Arguments:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Edit Variable:"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Delete Selected"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Find Node Type"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Copy Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Cut Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_editor.cpp
+msgid "Paste Nodes"
+msgstr ""
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Input type not iterable: "
+msgstr ""
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid"
+msgstr ""
+
+#: modules/visual_script/visual_script_flow_control.cpp
+msgid "Iterator became invalid: "
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name."
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Base object is not a Node!"
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Path does not lead Node!"
+msgstr ""
+
+#: modules/visual_script/visual_script_func_nodes.cpp
+msgid "Invalid index property name '%s' in node %s."
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid argument of type: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ": Invalid arguments: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableGet not found in script: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "VariableSet not found in script: "
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid "Custom node has no _step() method, can't process graph."
+msgstr ""
+
+#: modules/visual_script/visual_script_nodes.cpp
+msgid ""
+"Invalid return value from _step(), must be integer (seq out), or string "
+"(error)."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run in Browser"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Run exported HTML in the system's default browser."
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not write file:"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not open template for export:"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Invalid export template:"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read custom HTML shell:"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Could not read boot splash image file:"
+msgstr ""
+
+#: platform/javascript/export/export.cpp
+msgid "Using default boot splash image."
+msgstr ""
+
+#: scene/2d/animated_sprite.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite to display frames."
+msgstr ""
+
+#: scene/2d/canvas_modulate.cpp
+msgid ""
+"Only one visible CanvasModulate is allowed per scene (or set of instanced "
+"scenes). The first created one will work, while the rest will be ignored."
+msgstr ""
+
+#: scene/2d/collision_object_2d.cpp
+msgid ""
+"This node has no children shapes, so it can't interact with the space.\n"
+"Consider adding CollisionShape2D or CollisionPolygon2D children nodes to "
+"define its shape."
+msgstr ""
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid ""
+"CollisionPolygon2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+
+#: scene/2d/collision_polygon_2d.cpp
+msgid "An empty CollisionPolygon2D has no effect on collision."
+msgstr ""
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"CollisionShape2D only serves to provide a collision shape to a "
+"CollisionObject2D derived node. Please only use it as a child of Area2D, "
+"StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape."
+msgstr ""
+
+#: scene/2d/collision_shape_2d.cpp
+msgid ""
+"A shape must be provided for CollisionShape2D to function. Please create a "
+"shape resource for it!"
+msgstr ""
+
+#: scene/2d/light_2d.cpp
+msgid ""
+"A texture with the shape of the light must be supplied to the 'texture' "
+"property."
+msgstr ""
+
+#: scene/2d/light_occluder_2d.cpp
+msgid ""
+"An occluder polygon must be set (or drawn) for this occluder to take effect."
+msgstr ""
+
+#: scene/2d/light_occluder_2d.cpp
+msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
+msgstr ""
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"A NavigationPolygon resource must be set or created for this node to work. "
+"Please set a property or draw a polygon."
+msgstr ""
+
+#: scene/2d/navigation_polygon.cpp
+msgid ""
+"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
+"node. It only provides navigation data."
+msgstr ""
+
+#: scene/2d/parallax_layer.cpp
+msgid ""
+"ParallaxLayer node only works when set as child of a ParallaxBackground node."
+msgstr ""
+
+#: scene/2d/particles_2d.cpp scene/3d/particles.cpp
+msgid ""
+"A material to process the particles is not assigned, so no behavior is "
+"imprinted."
+msgstr ""
+
+#: scene/2d/path_2d.cpp
+msgid "PathFollow2D only works when set as a child of a Path2D node."
+msgstr ""
+
+#: scene/2d/physics_body_2d.cpp
+msgid ""
+"Size changes to RigidBody2D (in character or rigid modes) will be overridden "
+"by the physics engine when running.\n"
+"Change the size in children collision shapes instead."
+msgstr ""
+
+#: scene/2d/remote_transform_2d.cpp
+msgid "Path property must point to a valid Node2D node to work."
+msgstr ""
+
+#: scene/2d/visibility_notifier_2d.cpp
+msgid ""
+"VisibilityEnable2D works best when used with the edited scene root directly "
+"as parent."
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid "ARVRCamera must have an ARVROrigin node as its parent"
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid "ARVRController must have an ARVROrigin node as its parent"
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid ""
+"The controller id must not be 0 or this controller will not be bound to an "
+"actual controller"
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid "ARVRAnchor must have an ARVROrigin node as its parent"
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid ""
+"The anchor id must not be 0 or this anchor will not be bound to an actual "
+"anchor"
+msgstr ""
+
+#: scene/3d/arvr_nodes.cpp
+msgid "ARVROrigin requires an ARVRCamera child node"
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp
+msgid "%d%%"
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp
+msgid "(Time Left: %d:%02d s)"
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp
+msgid "Plotting Meshes: "
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp
+msgid "Plotting Lights:"
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp
+msgid "Finishing Plot"
+msgstr ""
+
+#: scene/3d/baked_lightmap.cpp
+msgid "Lighting Meshes: "
+msgstr ""
+
+#: scene/3d/collision_object.cpp
+msgid ""
+"This node has no children shapes, so it can't interact with the space.\n"
+"Consider adding CollisionShape or CollisionPolygon children nodes to define "
+"its shape."
+msgstr ""
+
+#: scene/3d/collision_polygon.cpp
+msgid ""
+"CollisionPolygon only serves to provide a collision shape to a "
+"CollisionObject derived node. Please only use it as a child of Area, "
+"StaticBody, RigidBody, KinematicBody, etc. to give them a shape."
+msgstr ""
+
+#: scene/3d/collision_polygon.cpp
+msgid "An empty CollisionPolygon has no effect on collision."
+msgstr ""
+
+#: scene/3d/collision_shape.cpp
+msgid ""
+"CollisionShape only serves to provide a collision shape to a CollisionObject "
+"derived node. Please only use it as a child of Area, StaticBody, RigidBody, "
+"KinematicBody, etc. to give them a shape."
+msgstr ""
+
+#: scene/3d/collision_shape.cpp
+msgid ""
+"A shape must be provided for CollisionShape to function. Please create a "
+"shape resource for it!"
+msgstr ""
+
+#: scene/3d/gi_probe.cpp
+msgid "Plotting Meshes"
+msgstr ""
+
+#: scene/3d/navigation_mesh.cpp
+msgid "A NavigationMesh resource must be set or created for this node to work."
+msgstr ""
+
+#: scene/3d/navigation_mesh.cpp
+msgid ""
+"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
+"It only provides navigation data."
+msgstr ""
+
+#: scene/3d/particles.cpp
+msgid ""
+"Nothing is visible because meshes have not been assigned to draw passes."
+msgstr ""
+
+#: scene/3d/physics_body.cpp
+msgid ""
+"Size changes to RigidBody (in character or rigid modes) will be overridden "
+"by the physics engine when running.\n"
+"Change the size in children collision shapes instead."
+msgstr ""
+
+#: scene/3d/remote_transform.cpp
+msgid "Path property must point to a valid Spatial node to work."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
+#: scene/3d/sprite_3d.cpp
+msgid ""
+"A SpriteFrames resource must be created or set in the 'Frames' property in "
+"order for AnimatedSprite3D to display frames."
+msgstr ""
+
+#: scene/3d/vehicle_body.cpp
+msgid ""
+"VehicleWheel serves to provide a wheel system to a VehicleBody. Please use "
+"it as a child of a VehicleBody."
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Raw Mode"
+msgstr ""
+
+#: scene/gui/color_picker.cpp
+msgid "Add current color as a preset"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Alert!"
+msgstr ""
+
+#: scene/gui/dialogs.cpp
+msgid "Please Confirm..."
+msgstr ""
+
+#: scene/gui/file_dialog.cpp
+msgid "Select this Folder"
+msgstr ""
+
+#: scene/gui/popup.cpp
+msgid ""
+"Popups will hide by default unless you call popup() or any of the popup*() "
+"functions. Making them visible for editing is fine though, but they will "
+"hide upon running."
+msgstr ""
+
+#: scene/gui/scroll_container.cpp
+msgid ""
+"ScrollContainer is intended to work with a single child control.\n"
+"Use a container as child (VBox,HBox,etc), or a Control and set the custom "
+"minimum size manually."
+msgstr ""
+
+#: scene/gui/tree.cpp
+msgid "(Other)"
+msgstr ""
+
+#: scene/main/scene_tree.cpp
+msgid ""
+"Default Environment as specified in Project Settings (Rendering -> "
+"Environment -> Default Environment) could not be loaded."
+msgstr ""
+
+#: scene/main/viewport.cpp
+msgid ""
+"This viewport is not set as render target. If you intend for it to display "
+"its contents directly to the screen, make it a child of a Control so it can "
+"obtain a size. Otherwise, make it a RenderTarget and assign its internal "
+"texture to some node for display."
+msgstr ""
+
+#: scene/resources/dynamic_font.cpp
+msgid "Error initializing FreeType."
+msgstr ""
+
+#: scene/resources/dynamic_font.cpp
+msgid "Unknown font format."
+msgstr ""
+
+#: scene/resources/dynamic_font.cpp
+msgid "Error loading font."
+msgstr ""
+
+#: scene/resources/dynamic_font.cpp
+msgid "Invalid font size."
+msgstr ""
diff --git a/editor/translations/sv.po b/editor/translations/sv.po
index 64a268a7bc..4a861d1b76 100644
--- a/editor/translations/sv.po
+++ b/editor/translations/sv.po
@@ -1568,6 +1568,10 @@ msgstr "Rensa"
msgid "Clear Output"
msgstr "Output:"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
msgid "Error saving resource!"
@@ -3989,6 +3993,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -4284,6 +4296,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -6032,6 +6048,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6547,7 +6571,9 @@ msgid "Mouse Button"
msgstr "Musknapp"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6694,10 +6720,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7816,6 +7838,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
#, fuzzy
msgid "Generating solution..."
@@ -8517,10 +8543,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/ta.po b/editor/translations/ta.po
index 4be5e8b832..e7269ffa0e 100644
--- a/editor/translations/ta.po
+++ b/editor/translations/ta.po
@@ -1372,6 +1372,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3592,6 +3596,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3877,6 +3889,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5538,6 +5554,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6013,7 +6037,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6157,10 +6183,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7199,6 +7221,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7835,10 +7861,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/th.po b/editor/translations/th.po
index b31fba186a..74e2270f2c 100644
--- a/editor/translations/th.po
+++ b/editor/translations/th.po
@@ -9,7 +9,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-02-25 04:41+0000\n"
+"PO-Revision-Date: 2018-03-10 03:46+0000\n"
"Last-Translator: Poommetee Ketson <poommetee@protonmail.com>\n"
"Language-Team: Thai <https://hosted.weblate.org/projects/godot-engine/godot/"
"th/>\n"
@@ -1382,6 +1382,10 @@ msgstr "ลบ"
msgid "Clear Output"
msgstr "ลบข้อความ"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "บันทึà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸œà¸´à¸”พลาด!"
@@ -3641,6 +3645,16 @@ msgid "Show Guides"
msgstr "à¹à¸ªà¸”งเส้นนำ"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "à¹à¸ªà¸”งจุดà¸à¸³à¹€à¸™à¸´à¸”"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 มุมมอง"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "ให้สิ่งที่เลือà¸à¸­à¸¢à¸¹à¹ˆà¸à¸¥à¸²à¸‡à¸ˆà¸­"
@@ -3930,6 +3944,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Mesh ไม่มีพื้นผิวให้สร้างเส้นขอบได้!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "สร้างเส้นรอบรูปไม่ได้!"
@@ -5596,6 +5614,16 @@ msgid "Checked Item"
msgstr "ไอเทมมีเครื่องหมาย"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "เพิ่มไอเทม"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "ไอเทมมีเครื่องหมาย"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "มี"
@@ -6082,8 +6110,10 @@ msgid "Mouse Button"
msgstr "ปุ่มเมาส์"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "ใช้ชื่อนี้ไม่ได้ (มี '/' หรือ ':')"
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6226,10 +6256,6 @@ msgid "Delete Item"
msgstr "ลบไอเทม"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "ต้องไม่มี '/' หรือ ':'"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "มีอยู่à¸à¹ˆà¸­à¸™à¹à¸¥à¹‰à¸§"
@@ -7278,6 +7304,10 @@ msgstr "à¸à¸²à¸£à¸•à¸±à¹‰à¸‡à¸„่า GridMap"
msgid "Pick Distance:"
msgstr "ระยะà¸à¸²à¸£à¹€à¸¥à¸·à¸­à¸:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ solution..."
@@ -7328,7 +7358,7 @@ msgstr "คำเตือน"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "สิ้นสุดสà¹à¸•à¸„ข้อผิดพลาดภายใน"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7940,10 +7970,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Spatial จึงจะทำงานได้"
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr "จะมี WorldEnvironment ได้เพียงโหนดเดียวในฉาภ(หรือà¸à¸¥à¸¸à¹ˆà¸¡à¸‚องฉาà¸à¸—ี่เป็นอินสà¹à¸•à¸™à¸‹à¹Œ)"
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8034,6 +8074,12 @@ msgstr "ผิดพลาดขณะโหลดฟอนต์"
msgid "Invalid font size."
msgstr "ขนาดฟอนต์ผิดพลาด"
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "ใช้ชื่อนี้ไม่ได้ (มี '/' หรือ ':')"
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "ต้องไม่มี '/' หรือ ':'"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/tr.po b/editor/translations/tr.po
index bb485dc603..5e4a18ce28 100644
--- a/editor/translations/tr.po
+++ b/editor/translations/tr.po
@@ -9,6 +9,7 @@
# Enescan Yerlikaya <enescanyerlikaya@gmail.com>, 2017.
# Fatih Mert DoÄŸancan <fatihmertdogancan@hotmail.com>, 2017.
# hubbyist <hub@legrud.net>, 2017.
+# H.Hüseyin CİHANGİR <hashusfb@gmail.com>, 2018.
# M. Yavuz Uzun <myavuzuzun@yandex.com>, 2016.
# Orkun Turan <holygatestudio@yandex.com>, 2016-2017.
# razah <icnikerazah@gmail.com>, 2017-2018.
@@ -18,15 +19,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-24 23:40+0000\n"
-"Last-Translator: razah <icnikerazah@gmail.com>\n"
+"PO-Revision-Date: 2018-04-19 12:41+0000\n"
+"Last-Translator: H.Hüseyin CİHANGİR <hashusfb@gmail.com>\n"
"Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/"
"godot/tr/>\n"
"Language: tr\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -1401,6 +1402,10 @@ msgstr "Temizle"
msgid "Clear Output"
msgstr "Çıktıyı Temizle"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Kaynak kaydedilirken hata!"
@@ -1961,8 +1966,9 @@ msgid "Debug"
msgstr "Hata Ayıklama"
#: editor/editor_node.cpp
+#, fuzzy
msgid "Deploy with Remote Debug"
-msgstr "Uzaktan Hata Ayıklama ile Dağıt"
+msgstr "Uzaktan Hata Ayıklama ile Aç"
#: editor/editor_node.cpp
msgid ""
@@ -2017,7 +2023,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Scene Changes"
-msgstr "Sahne DeÄŸiÅŸikliklerini EÅŸzamanla"
+msgstr "Sahne DeÄŸiÅŸikliklerini EÅŸ Zamanla"
#: editor/editor_node.cpp
msgid ""
@@ -2033,7 +2039,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Script Changes"
-msgstr "Betik DeÄŸiÅŸikliklerini EÅŸzamanla"
+msgstr "Betik DeÄŸiÅŸikliklerini EÅŸ Zamanla"
#: editor/editor_node.cpp
msgid ""
@@ -3704,6 +3710,16 @@ msgid "Show Guides"
msgstr "Kılavuzları göster"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "Başlatım Görünümü"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 Görüntükapısı"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "İçre Seçimi"
@@ -3993,6 +4009,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Örüntü anahat oluşturmak için bir yüzeye sahip değil!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Anahat oluşturulamadı!"
@@ -5277,7 +5297,7 @@ msgstr "Ölçek Biçimi (R)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Coords"
-msgstr "Yerel Koordlar"
+msgstr "Yerel Kordinatlar"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Local Space Mode (%s)"
@@ -5661,6 +5681,16 @@ msgid "Checked Item"
msgstr "Denetlenen Öğe"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Öğe Ekle"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Denetlenen Öğe"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Var"
@@ -5975,11 +6005,11 @@ msgid "Invalid project path (changed anything?)."
msgstr "Geçersiz proje yolu (bir şey değişti mi?)."
#: editor/project_manager.cpp
-#, fuzzy
msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
-msgstr "proje yolundaki proje.godot düzenlenemedi."
+msgstr ""
+"Proje yolundaki proje.godot düzenlenemedi.Eksik veya bozulmuş olabilir."
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
@@ -6157,8 +6187,10 @@ msgid "Mouse Button"
msgstr "Fare Düğmesi"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Geçersiz işlem (her şey ancak şu '/' ya da şuna ':' gider)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6301,10 +6333,6 @@ msgid "Delete Item"
msgstr "Öğeyi Sil"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "'/' veya ':' içeremez"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Zaten mevcut"
@@ -6442,7 +6470,7 @@ msgstr "Yereller:"
#: editor/project_settings_editor.cpp
msgid "AutoLoad"
-msgstr "KendindenYükle"
+msgstr "Otomatik Yükle"
#: editor/property_editor.cpp
msgid "Pick a Viewport"
@@ -7050,7 +7078,7 @@ msgstr "Toplam:"
#: editor/script_editor_debugger.cpp
msgid "Video Mem"
-msgstr "Ä°zleti BelleÄŸi"
+msgstr "Görüntü Belleği"
#: editor/script_editor_debugger.cpp
msgid "Resource Path"
@@ -7070,7 +7098,7 @@ msgstr "Kullanım"
#: editor/script_editor_debugger.cpp
msgid "Misc"
-msgstr "Türlü"
+msgstr "Çeşitli"
#: editor/script_editor_debugger.cpp
msgid "Clicked Control:"
@@ -7244,18 +7272,16 @@ msgid "Object can't provide a length."
msgstr "Nesne bir uzunluk saÄŸlayamaz."
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Next Plane"
msgstr "Sonraki sekme"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Plane"
msgstr "Önceki sekme"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Plane:"
-msgstr ""
+msgstr "Sekme:"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Next Floor"
@@ -7361,6 +7387,10 @@ msgstr "IzgaraHaritası Ayarları"
msgid "Pick Distance:"
msgstr "Uzaklık Seç:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "solü oluşturuluyor..."
@@ -7390,8 +7420,9 @@ msgid "Mono"
msgstr "Tekli"
#: modules/mono/editor/godotsharp_editor.cpp
+#, fuzzy
msgid "About C# support"
-msgstr ""
+msgstr "C# hakkında destek"
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Create C# solution"
@@ -7595,7 +7626,7 @@ msgstr "Dizi"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
-msgstr "DeÄŸiÅŸtir"
+msgstr "Anahtar"
#: modules/visual_script/visual_script_editor.cpp
msgid "Iterator"
@@ -7967,8 +7998,9 @@ msgid "%d%%"
msgstr ""
#: scene/3d/baked_lightmap.cpp
+#, fuzzy
msgid "(Time Left: %d:%02d s)"
-msgstr ""
+msgstr "(Kalan Zaman:%d:%02d s)"
#: scene/3d/baked_lightmap.cpp
msgid "Plotting Meshes: "
@@ -8069,12 +8101,22 @@ msgstr ""
"Yol özelliği, çalışmak için geçerli bir Spatial düğümüne işaret etmelidir."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"Her sahne başına (ya da örneklenmiş sahneler dizisine) sadece bir tane "
"WorldEnvironment 'a izin verilir."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8171,6 +8213,12 @@ msgstr "Yazıtipi yükleme hatası."
msgid "Invalid font size."
msgstr "Geçersiz yazıtipi boyutu."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Geçersiz işlem (her şey ancak şu '/' ya da şuna ':' gider)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "'/' veya ':' içeremez"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/uk.po b/editor/translations/uk.po
index 685812f2d4..45138cd5de 100644
--- a/editor/translations/uk.po
+++ b/editor/translations/uk.po
@@ -4,16 +4,17 @@
# This file is distributed under the same license as the Godot source code.
#
# Aleksandr <XpycT.TOP@gmail.com>, 2017.
+# Yuri Chornoivan <yurchor@ukr.net>, 2018.
# Ðндрій Бандура <andriykopanytsia@gmail.com>, 2018.
# Гидеон Теон <t.kudely94@gmail.com>, 2017.
+# МакÑим Якимчук <xpinovo@gmail.com>, 2018.
# ÐœÐ°Ñ€Ñ Ð¯Ð¼Ð±Ð°Ñ€ <mjambarmeta@gmail.com>, 2017-2018.
# ОлекÑандр Пилипчук <pilipchukap@rambler.ru>, 2018.
-# Yuri Chornoivan <yurchor@ukr.net>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Ukrainian (Godot Engine)\n"
-"PO-Revision-Date: 2018-02-22 18:08+0000\n"
+"PO-Revision-Date: 2018-04-20 18:42+0000\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/"
"godot/uk/>\n"
@@ -22,7 +23,7 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-"X-Generator: Weblate 2.20-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -300,11 +301,11 @@ msgstr "МакÑимальна лінійна похибка:"
#: editor/animation_editor.cpp
msgid "Max. Angular Error:"
-msgstr "МакÑ. Кутові похибки:"
+msgstr "МакÑ. кутова похибка:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr "МакÑимальний оптимізований кут:"
+msgstr "МакÑ. оптимізований кут:"
#: editor/animation_editor.cpp
msgid "Optimize"
@@ -1400,6 +1401,10 @@ msgstr "ОчиÑтити"
msgid "Clear Output"
msgstr "ОчиÑтити вивід"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "Помилка Ð·Ð±ÐµÑ€ÐµÐ¶ÐµÐ½Ð½Ñ Ñ€ÐµÑурÑу!"
@@ -1961,7 +1966,7 @@ msgstr "Вийти в ÑпиÑок проектів"
#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
msgid "Debug"
-msgstr "ÐалагодженнÑ"
+msgstr "ДіагноÑтика"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
@@ -2103,7 +2108,7 @@ msgstr "Спільнота"
#: editor/editor_node.cpp
msgid "About"
-msgstr "Про"
+msgstr "Про програму"
#: editor/editor_node.cpp
msgid "Play the project."
@@ -3394,7 +3399,7 @@ msgstr "Ð’Ñе"
#: editor/plugins/asset_library_editor_plugin.cpp
#: editor/project_settings_editor.cpp
msgid "Plugins"
-msgstr "Плагіни"
+msgstr "Плаґіни"
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Sort:"
@@ -3708,6 +3713,16 @@ msgid "Show Guides"
msgstr "Показати напрÑмні"
#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "ПереглÑд центра"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1 панель переглÑду"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr "Центрувати на вибраному"
@@ -3998,6 +4013,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Сітка не має поверхні, щоб Ñтворити контури!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "Ðе вдалоÑÑ Ñтворити контур!"
@@ -5667,6 +5686,16 @@ msgid "Checked Item"
msgstr "Позначений елемент"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "Додати елемент"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "Позначений елемент"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "Має"
@@ -6166,8 +6195,10 @@ msgid "Mouse Button"
msgstr "Кнопка миші"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Ðекоректна Ð´Ñ–Ñ (можна уÑе, окрім «/» або «:»)."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6310,10 +6341,6 @@ msgid "Delete Item"
msgstr "Вилучити елемент"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "Ðе може міÑтити «/» або «:»"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "Вже Ñ–Ñнує"
@@ -6539,7 +6566,7 @@ msgstr "[Порожньо]"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr "Ð’Ñтановити"
+msgstr "Множина"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -7372,6 +7399,10 @@ msgstr "Параметри GridMap"
msgid "Pick Distance:"
msgstr "ВідÑтань вибору:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr "Ð¡Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ñ€Ð¾Ð·Ð²'Ñзку..."
@@ -7422,7 +7453,7 @@ msgstr "ПопередженнÑ"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "Кінець траÑÑƒÐ²Ð°Ð½Ð½Ñ Ñтека Ð´Ð»Ñ Ð²Ð½ÑƒÑ‚Ñ€Ñ–ÑˆÐ½ÑŒÐ¾Ð³Ð¾ виключеннÑ"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -8082,12 +8113,22 @@ msgstr ""
"коректний вузол Spatial."
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
"У Ñцені (або наборі екземплÑрів Ñцен) може бути лише один елемент "
"WorldEnvironment."
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8185,6 +8226,12 @@ msgstr "Помилка Ð·Ð°Ð²Ð°Ð½Ñ‚Ð°Ð¶ÐµÐ½Ð½Ñ ÑˆÑ€Ð¸Ñ„Ñ‚Ñƒ."
msgid "Invalid font size."
msgstr "Ðекоректний розмір шрифту."
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Ðекоректна Ð´Ñ–Ñ (можна уÑе, окрім «/» або «:»)."
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "Ðе може міÑтити «/» або «:»"
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po
index 96fbfbeee6..4f03e8a387 100644
--- a/editor/translations/ur_PK.po
+++ b/editor/translations/ur_PK.po
@@ -1382,6 +1382,10 @@ msgstr ""
msgid "Clear Output"
msgstr "سب سکریپشن بنائیں"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3611,6 +3615,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3900,6 +3912,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5573,6 +5589,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6053,7 +6077,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6198,10 +6224,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7255,6 +7277,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7897,10 +7923,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/vi.po b/editor/translations/vi.po
index c39ccc4db9..d6284d640e 100644
--- a/editor/translations/vi.po
+++ b/editor/translations/vi.po
@@ -3,6 +3,7 @@
# Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)
# This file is distributed under the same license as the Godot source code.
#
+# 01lifeleft <01lifeleft@gmail.com>, 2018.
# Dlean Jeans <dleanjeans@gmail.com>, 2018.
# Hai Le <dark.hades.1102@gmail.com>, 2017.
# Nguyễn Tuấn Anh <anhnt.fami@gmail.com>, 2017.
@@ -11,15 +12,15 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2018-01-24 12:35+0000\n"
-"Last-Translator: Dlean Jeans <dleanjeans@gmail.com>\n"
+"PO-Revision-Date: 2018-04-18 15:44+0000\n"
+"Last-Translator: 01lifeleft <01lifeleft@gmail.com>\n"
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/godot-engine/"
"godot/vi/>\n"
"Language: vi\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -79,7 +80,7 @@ msgstr "Äổi tên Anim Track"
#: editor/animation_editor.cpp
msgid "Anim Track Change Interpolation"
-msgstr ""
+msgstr "Äổi phép ná»™i suy Anim Track"
#: editor/animation_editor.cpp
msgid "Anim Track Change Value Mode"
@@ -112,31 +113,31 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr ""
+msgstr "Bá» lá»±a chá»n"
#: editor/animation_editor.cpp
msgid "Continuous"
-msgstr ""
+msgstr "Liên tục"
#: editor/animation_editor.cpp
msgid "Discrete"
-msgstr ""
+msgstr "Äứt Ä‘oạn"
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "Kích hoạt"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
-msgstr ""
+msgstr "Thêm Key Anim"
#: editor/animation_editor.cpp
msgid "Anim Move Keys"
-msgstr ""
+msgstr "Di chuyển các Key Anim"
#: editor/animation_editor.cpp
msgid "Scale Selection"
-msgstr ""
+msgstr "Chá»n Scale"
#: editor/animation_editor.cpp
msgid "Scale From Cursor"
@@ -165,15 +166,15 @@ msgstr "Trong"
#: editor/animation_editor.cpp
msgid "Out"
-msgstr ""
+msgstr "Ngoài"
#: editor/animation_editor.cpp
msgid "In-Out"
-msgstr ""
+msgstr "Trong-Ngoài"
#: editor/animation_editor.cpp
msgid "Out-In"
-msgstr ""
+msgstr "Ngoài-Trong"
#: editor/animation_editor.cpp
msgid "Transitions"
@@ -185,7 +186,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Clean-Up Animation"
-msgstr ""
+msgstr "Dá»n dẹp Animation"
#: editor/animation_editor.cpp
msgid "Create NEW track for %s and insert key?"
@@ -205,7 +206,7 @@ msgstr "Tạo"
#: editor/animation_editor.cpp
msgid "Anim Create & Insert"
-msgstr ""
+msgstr "Tạo & Chèn Anim"
#: editor/animation_editor.cpp
msgid "Anim Insert Track & Key"
@@ -221,7 +222,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr ""
+msgstr "Äổi vòng lặp Anim"
#: editor/animation_editor.cpp
msgid "Anim Create Typed Value Key"
@@ -229,7 +230,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr ""
+msgstr "Chèn Anim"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
@@ -249,7 +250,7 @@ msgstr "Äá»™ dài (giây):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr ""
+msgstr "Äá»™ dài Animation (giây)."
#: editor/animation_editor.cpp
msgid "Step (s):"
@@ -261,7 +262,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
-msgstr ""
+msgstr "Mở/Tắt lặp animation."
#: editor/animation_editor.cpp
msgid "Add new tracks."
@@ -1373,6 +1374,10 @@ msgstr ""
msgid "Clear Output"
msgstr ""
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -3596,6 +3601,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3881,6 +3894,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5542,6 +5559,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6019,7 +6044,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6163,10 +6190,6 @@ msgid "Delete Item"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7112,7 +7135,7 @@ msgstr ""
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Floor:"
-msgstr ""
+msgstr "Tầng:"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "GridMap Delete Selection"
@@ -7206,6 +7229,10 @@ msgstr ""
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7842,10 +7869,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po
index 9c55ece6db..45d2d81505 100644
--- a/editor/translations/zh_CN.po
+++ b/editor/translations/zh_CN.po
@@ -10,23 +10,26 @@
# å´äº®å¼Ÿ <wu@liangdi.me>, 2017.
# ageazrael <ageazrael@gmail.com>, 2016.
# Bruce Guo <guoboism@hotmail.com>, 2016.
-# dragonandy <dragonandy@foxmail.com>, 2017.
+# dragonandy <dragonandy@foxmail.com>, 2017-2018.
# Geequlim <geequlim@gmail.com>, 2016-2018.
# lalalaring <783482203@qq.com>, 2017.
# Luo Jun <vipsbpig@gmail.com>, 2016-2017.
# oberon-tonya <360119124@qq.com>, 2016.
# Qichunren <whyruby@gmail.com>, 2017.
-# sersoong <seraphim945@qq.com>, 2017.
+# seanfy <everxiao@qq.com>, 2018.
+# sersoong <seraphim945@qq.com>, 2017-2018.
# wanfang liu <wanfang.liu@gmail.com>, 2016.
# WeiXiong Huang <wx_Huang@sina.com>, 2017.
# Youmu <konpaku.w@gmail.com>, 2017.
+# yuetian <18829280955@163.com>, 2018.
+# Zae Chao <zae.vito@live.com>, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: Chinese (Simplified) (Godot Engine)\n"
"POT-Creation-Date: 2018-01-20 12:15+0200\n"
-"PO-Revision-Date: 2018-02-03 05:35+0000\n"
-"Last-Translator: 360119124 <360119124@qq.com>\n"
+"PO-Revision-Date: 2018-05-03 08:59+0000\n"
+"Last-Translator: Geequlim <geequlim@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"godot-engine/godot/zh_Hans/>\n"
"Language: zh_CN\n"
@@ -34,7 +37,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.19-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -328,7 +331,7 @@ msgstr "在场景树中选择一个AnimationPlayeræ¥ç¼–辑动画。"
#: editor/animation_editor.cpp
msgid "Key"
-msgstr "é”®"
+msgstr "关键帧"
#: editor/animation_editor.cpp
msgid "Transition"
@@ -807,7 +810,7 @@ msgstr "软件包安装æˆåŠŸï¼"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Success!"
-msgstr "完æˆï¼"
+msgstr "æˆåŠŸï¼"
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -1154,7 +1157,7 @@ msgstr "所有文件(*)"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Open a File"
-msgstr "打开文件"
+msgstr "打开å•ä¸ªæ–‡ä»¶"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
msgid "Open File(s)"
@@ -1383,7 +1386,7 @@ msgstr "查找"
#: editor/editor_log.cpp
msgid "Output:"
-msgstr "输出:"
+msgstr "日志:"
#: editor/editor_log.cpp editor/plugins/animation_tree_editor_plugin.cpp
#: editor/property_editor.cpp editor/script_editor_debugger.cpp
@@ -1396,6 +1399,10 @@ msgstr "清除"
msgid "Clear Output"
msgstr "清空输出"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr "ä¿å­˜èµ„æºå‡ºé”™ï¼"
@@ -1668,7 +1675,7 @@ msgstr "导出网格库(Mesh Library)"
#: editor/editor_node.cpp
msgid "This operation can't be done without a root node."
-msgstr "æ­¤æ“作必须有一个根节点(root node)æ‰èƒ½æ‰§è¡Œã€‚"
+msgstr "需è¦æœ‰æ ¹èŠ‚点æ‰èƒ½å®Œæˆæ­¤æ“作。"
#: editor/editor_node.cpp
msgid "Export Tile Set"
@@ -1824,7 +1831,7 @@ msgstr "切æ¢æ— å¹²æ‰°æ¨¡å¼ã€‚"
#: editor/editor_node.cpp
msgid "Add a new scene."
-msgstr "新建场景"
+msgstr "添加新场景。"
#: editor/editor_node.cpp
msgid "Scene"
@@ -1926,7 +1933,7 @@ msgstr "导出"
#: editor/editor_node.cpp
msgid "Tools"
-msgstr "工具"
+msgstr "工具(tools)"
#: editor/editor_node.cpp
msgid "Quit to Project List"
@@ -1938,7 +1945,7 @@ msgstr "调试"
#: editor/editor_node.cpp
msgid "Deploy with Remote Debug"
-msgstr "部署远程调试"
+msgstr "使用远程调试部署"
#: editor/editor_node.cpp
msgid ""
@@ -1949,7 +1956,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Small Deploy with Network FS"
-msgstr "å‘布基于网络文件系统的最å°åº”用包"
+msgstr "å°åž‹éƒ¨ç½²ä¸Žç½‘络文件系统"
#: editor/editor_node.cpp
msgid ""
@@ -1967,7 +1974,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Visible Collision Shapes"
-msgstr "碰撞区域å¯è§"
+msgstr "å¯è§ç¢°æ’žåŒºåŸŸ"
#: editor/editor_node.cpp
msgid ""
@@ -1977,7 +1984,7 @@ msgstr "如果å¯ç”¨æ­¤é¡¹ï¼ŒèŠ‚点的碰撞区域和raycast将在游æˆè¿è¡Œæ—
#: editor/editor_node.cpp
msgid "Visible Navigation"
-msgstr "Navigationå¯è§"
+msgstr "å¯è§å¯¼èˆª"
#: editor/editor_node.cpp
msgid ""
@@ -2179,7 +2186,7 @@ msgstr "文件系统"
#: editor/editor_node.cpp
msgid "Output"
-msgstr "输出"
+msgstr "日志"
#: editor/editor_node.cpp
msgid "Don't Save"
@@ -2404,7 +2411,7 @@ msgstr "(当å‰)"
#: editor/export_template_manager.cpp
msgid "Retrieving mirrors, please wait.."
-msgstr "正在链接镜åƒåœ°å€ï¼Œè¯·ç¨åŽ.."
+msgstr "检索镜åƒï¼Œè¯·ç­‰å¾…..."
#: editor/export_template_manager.cpp
msgid "Remove template version '%s'?"
@@ -2438,7 +2445,7 @@ msgstr "导入:"
msgid ""
"No download links found for this version. Direct download is only available "
"for official releases."
-msgstr "当å‰ç‰ˆæœ¬æ²¡æœ‰ä¸‹è½½é“¾æŽ¥ã€‚åªèƒ½é€šè¿‡å®˜æ–¹å‘布下载。"
+msgstr "当å‰ç‰ˆæœ¬æ²¡æœ‰ä¸‹è½½é“¾æŽ¥ã€‚直链下载åªæ供官方正å¼ç‰ˆã€‚"
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
@@ -2472,7 +2479,7 @@ msgstr "失败:"
#: editor/export_template_manager.cpp
msgid "Download Complete."
-msgstr "下载完æˆ"
+msgstr "下载完æˆã€‚"
#: editor/export_template_manager.cpp
msgid "Error requesting url: "
@@ -2480,7 +2487,7 @@ msgstr "请求链接错误: "
#: editor/export_template_manager.cpp
msgid "Connecting to Mirror.."
-msgstr "正在连接镜åƒâ€¦â€¦"
+msgstr "正在连接镜åƒç½‘站。。"
#: editor/export_template_manager.cpp
msgid "Disconnected"
@@ -2510,7 +2517,7 @@ msgstr "已连接"
#: editor/export_template_manager.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Requesting.."
-msgstr "正在请求……"
+msgstr "正在请求。。"
#: editor/export_template_manager.cpp
msgid "Downloading"
@@ -2719,7 +2726,7 @@ msgstr "导入为独立场景"
#: editor/import/resource_importer_scene.cpp
msgid "Import with Separate Animations"
-msgstr "导入独立的动画"
+msgstr "与独立的动画一åŒå¯¼å…¥"
#: editor/import/resource_importer_scene.cpp
msgid "Import with Separate Materials"
@@ -2735,15 +2742,15 @@ msgstr "导入独立物体 + æè´¨"
#: editor/import/resource_importer_scene.cpp
msgid "Import with Separate Objects+Animations"
-msgstr "导入独立物体+动画"
+msgstr "导入独立的物体和动画"
#: editor/import/resource_importer_scene.cpp
msgid "Import with Separate Materials+Animations"
-msgstr "导入独立æè´¨+动画"
+msgstr "导入独立的æ质和动画"
#: editor/import/resource_importer_scene.cpp
msgid "Import with Separate Objects+Materials+Animations"
-msgstr "导入独立物体+æè´¨+动画"
+msgstr "导入独立的物体ã€æ质和动画"
#: editor/import/resource_importer_scene.cpp
msgid "Import as Multiple Scenes"
@@ -2768,7 +2775,7 @@ msgstr "正在生æˆå…‰ç…§è´´å›¾"
#: editor/import/resource_importer_scene.cpp
msgid "Generating for Mesh: "
-msgstr "正在生æˆMesh"
+msgstr "正在生æˆMesh: "
#: editor/import/resource_importer_scene.cpp
msgid "Running Custom Script.."
@@ -3056,7 +3063,7 @@ msgstr "ä»…ä¸åŒ"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Force White Modulate"
-msgstr ""
+msgstr "强制用白色调和"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Include Gizmos (3D)"
@@ -3651,7 +3658,17 @@ msgstr "显示标尺"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Show Guides"
-msgstr "显示标尺 "
+msgstr "显示引导"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Origin"
+msgstr "显示原点"
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+#, fuzzy
+msgid "Show Viewport"
+msgstr "1个视å£"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
@@ -3770,13 +3787,12 @@ msgid "Update from Scene"
msgstr "从场景中更新"
#: editor/plugins/curve_editor_plugin.cpp
-#, fuzzy
msgid "Flat0"
msgstr "Flat0"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Flat1"
-msgstr ""
+msgstr "Flat1"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Ease in"
@@ -3788,7 +3804,7 @@ msgstr "æ¸å‡º"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Smoothstep"
-msgstr "圆滑级别 "
+msgstr "平滑æ’值"
#: editor/plugins/curve_editor_plugin.cpp
msgid "Modify Curve Point"
@@ -3944,6 +3960,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr "Mesh(网格)没有表é¢æ¥åˆ›å»ºè½®å»“(outlines)ï¼"
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr "无法创建轮廓(outlines)ï¼"
@@ -4125,7 +4145,7 @@ msgstr "标记å¯ç§»åŠ¨ä¸‰è§’å½¢..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Constructing compact heightfield..."
-msgstr "构建紧凑高度图... "
+msgstr "构建紧凑高度图..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Eroding walkable area..."
@@ -4133,11 +4153,11 @@ msgstr "正在计算å¯è¡ŒåŒºåŸŸ..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Partitioning..."
-msgstr "分区中... "
+msgstr "分区中..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Creating contours..."
-msgstr "正在创建轮廓... "
+msgstr "正在创建轮廓..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Creating polymesh..."
@@ -4145,7 +4165,7 @@ msgstr "创建多边形网格..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Converting to native navigation mesh..."
-msgstr "转æ¢ä¸ºå¯¼èˆªç½‘æ ¼(mesh)... "
+msgstr "转æ¢ä¸ºå¯¼èˆªç½‘æ ¼(mesh)..."
#: editor/plugins/navigation_mesh_generator.cpp
msgid "Navigation Mesh Generator Setup:"
@@ -4361,7 +4381,7 @@ msgstr "设置曲线的顶点åæ ‡"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve In Position"
-msgstr "设置曲线的内控制点"
+msgstr "设置的曲线åˆå§‹ä½ç½®ï¼ˆPos)"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve Out Position"
@@ -4590,9 +4610,8 @@ msgid "Copy Script Path"
msgstr "æ‹·è´è„šæœ¬è·¯å¾„"
#: editor/plugins/script_editor_plugin.cpp
-#, fuzzy
msgid "Show In File System"
-msgstr "在资æºç®¡ç†å™¨ä¸­å±•ç¤º"
+msgstr "在资æºç®¡ç†å™¨ä¸­æ˜¾ç¤º"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Prev"
@@ -5021,7 +5040,7 @@ msgstr "缩放: "
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translating: "
-msgstr "语言:"
+msgstr "移动: "
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
@@ -5588,7 +5607,7 @@ msgstr "创建空编辑器主题模æ¿"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create From Current Editor Theme"
-msgstr "从当å‰ç¼–辑器主题创建"
+msgstr "从当å‰ç¼–辑器主题模æ¿åˆ›å»º"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio1"
@@ -5611,6 +5630,16 @@ msgid "Checked Item"
msgstr "已选项目(Checked Item)"
#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Radio Item"
+msgstr "添加项目"
+
+#: editor/plugins/theme_editor_plugin.cpp
+#, fuzzy
+msgid "Checked Radio Item"
+msgstr "已选项目(Checked Item)"
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr "有(Has)"
@@ -5778,8 +5807,8 @@ msgid ""
"LMB: set bit on.\n"
"RMB: set bit off."
msgstr ""
-"鼠标左键: å¯ç”¨bit.\n"
-"é¼ æ ‡å³é”®ï¼š ç¦ç”¨bit"
+"鼠标左键: å¯ç”¨è¯¥bit。\n"
+"é¼ æ ‡å³é”®ï¼š ç¦ç”¨è¯¥bit。"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Select current edited sub-tile."
@@ -5799,7 +5828,7 @@ msgstr "å¯æ‰§è¡Œçš„"
#: editor/project_export.cpp
msgid "Delete patch '%s' from list?"
-msgstr "确认è¦ä»Žåˆ—表中删除Patch '%s' å—?"
+msgstr "从列表中删除补ä¸''%s'?"
#: editor/project_export.cpp
msgid "Delete preset '%s'?"
@@ -5920,11 +5949,11 @@ msgid "Invalid project path (changed anything?)."
msgstr "项目路径éžæ³•ï¼ˆè¢«å¤–部修改?)。"
#: editor/project_manager.cpp
-#, fuzzy
msgid ""
"Couldn't load project.godot in project path (error %d). It may be missing or "
"corrupted."
-msgstr "无法在项目目录下编辑project.godot文件。"
+msgstr ""
+"无法在项目路径中加载 project.godot 文件(错误 %d)。该文件å¯èƒ½ç¼ºå¤±æˆ–å·²æŸå。"
#: editor/project_manager.cpp
msgid "Couldn't edit project.godot in project path."
@@ -6098,8 +6127,10 @@ msgid "Mouse Button"
msgstr "鼠标按键"
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "Actionåéžæ³•(ä¸å¾—包å«'/'或':')。"
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
+msgstr ""
#: editor/project_settings_editor.cpp
msgid "Action '%s' already exists!"
@@ -6231,7 +6262,7 @@ msgstr "请先选择一个设置项目 ï¼"
#: editor/project_settings_editor.cpp
msgid "No property '%s' exists."
-msgstr "属性 '%s' ä¸å­˜åœ¨"
+msgstr "ä¸å­˜åœ¨å±žæ€§ '%s'。"
#: editor/project_settings_editor.cpp
msgid "Setting '%s' is internal, and it can't be deleted."
@@ -6242,10 +6273,6 @@ msgid "Delete Item"
msgstr "删除æ¡ç›®"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr "ä¸èƒ½åŒ…å« \"/\" 或 \":\""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr "å·²ç»å­˜åœ¨"
@@ -6307,7 +6334,7 @@ msgstr "项目设置(project.godot)"
#: editor/project_settings_editor.cpp editor/settings_config_dialog.cpp
msgid "General"
-msgstr "一般"
+msgstr "常规"
#: editor/project_settings_editor.cpp editor/property_editor.cpp
msgid "Property:"
@@ -6466,13 +6493,12 @@ msgid "On"
msgstr "å¯ç”¨"
#: editor/property_editor.cpp
-#, fuzzy
msgid "[Empty]"
-msgstr "添加空白帧"
+msgstr "[空]"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
-msgstr "设置"
+msgstr "Set"
#: editor/property_editor.cpp
msgid "Properties:"
@@ -6831,7 +6857,7 @@ msgstr "存在åŒå目录"
#: editor/script_create_dialog.cpp
msgid "File exists, will be reused"
-msgstr "文件存在,将被é‡ç”¨"
+msgstr "文件已存在, 将被é‡ç”¨"
#: editor/script_create_dialog.cpp
msgid "Invalid extension"
@@ -6898,7 +6924,6 @@ msgid "Attach Node Script"
msgstr "设置节点的脚本"
#: editor/script_editor_debugger.cpp
-#, fuzzy
msgid "Remote "
msgstr "远程 "
@@ -6968,7 +6993,7 @@ msgstr "性能分æž"
#: editor/script_editor_debugger.cpp
msgid "Monitor"
-msgstr "显示"
+msgstr "监视"
#: editor/script_editor_debugger.cpp
msgid "Value"
@@ -7008,7 +7033,7 @@ msgstr "用é‡"
#: editor/script_editor_debugger.cpp
msgid "Misc"
-msgstr "æ‚项"
+msgstr "其他"
#: editor/script_editor_debugger.cpp
msgid "Clicked Control:"
@@ -7181,18 +7206,16 @@ msgid "Object can't provide a length."
msgstr "对象无法æ供长度。"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Next Plane"
-msgstr "下一项"
+msgstr "下一个平é¢"
#: modules/gridmap/grid_map_editor_plugin.cpp
-#, fuzzy
msgid "Previous Plane"
-msgstr "上一个目录"
+msgstr "上一个平é¢"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Plane:"
-msgstr ""
+msgstr "å¹³é¢ï¼š"
#: modules/gridmap/grid_map_editor_plugin.cpp
msgid "Next Floor"
@@ -7298,9 +7321,13 @@ msgstr "GridMap设置"
msgid "Pick Distance:"
msgstr "拾å–è·ç¦»:"
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
-msgstr "正在创生æˆå†³æ–¹æ¡ˆ... "
+msgstr "正在创生æˆå†³æ–¹æ¡ˆ..."
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating C# project..."
@@ -7328,7 +7355,7 @@ msgstr "Mono"
#: modules/mono/editor/godotsharp_editor.cpp
msgid "About C# support"
-msgstr ""
+msgstr "关于C#支æŒ"
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Create C# solution"
@@ -7348,7 +7375,7 @@ msgstr "警告"
#: modules/mono/mono_gd/gd_mono_utils.cpp
msgid "End of inner exception stack trace"
-msgstr ""
+msgstr "内部异常堆栈追朔结æŸ"
#: modules/visual_script/visual_script.cpp
msgid ""
@@ -7515,11 +7542,11 @@ msgstr "连接节点"
#: modules/visual_script/visual_script_editor.cpp
msgid "Condition"
-msgstr "æ¡ä»¶ï¼ˆCondition)"
+msgstr "æ¡ä»¶"
#: modules/visual_script/visual_script_editor.cpp
msgid "Sequence"
-msgstr "åºåˆ—(Sequence)"
+msgstr "åºåˆ—"
#: modules/visual_script/visual_script_editor.cpp
msgid "Switch"
@@ -7868,11 +7895,11 @@ msgstr "ARVROrigin 必须拥有 ARVRCamera å­èŠ‚点"
#: scene/3d/baked_lightmap.cpp
msgid "%d%%"
-msgstr ""
+msgstr "%d%%"
#: scene/3d/baked_lightmap.cpp
msgid "(Time Left: %d:%02d s)"
-msgstr ""
+msgstr "(剩余时间:%d:%02d 秒)"
#: scene/3d/baked_lightmap.cpp
msgid "Plotting Meshes: "
@@ -7964,10 +7991,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr "path属性必须指å‘一个åˆæ³•çš„Spatial节点æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr "æ¯ä¸ªåœºæ™¯ä¸­åªå…许有一个WorldEnvironment类型的节点。"
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8059,6 +8096,12 @@ msgstr "加载字体出错。"
msgid "Invalid font size."
msgstr "字体大å°éžæ³•ã€‚"
+#~ msgid "Invalid action (anything goes but '/' or ':')."
+#~ msgstr "Actionåéžæ³•(ä¸å¾—包å«'/'或':')。"
+
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "ä¸èƒ½åŒ…å« \"/\" 或 \":\""
+
#~ msgid ""
#~ "Invalid version.txt format inside templates. Revision is not a valid "
#~ "identifier."
diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po
index 6e2e5ac502..f4c6a39788 100644
--- a/editor/translations/zh_HK.po
+++ b/editor/translations/zh_HK.po
@@ -1471,6 +1471,10 @@ msgstr "清空"
msgid "Clear Output"
msgstr "下一個腳本"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#, fuzzy
msgid "Error saving resource!"
@@ -3793,6 +3797,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -4085,6 +4097,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5783,6 +5799,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6278,7 +6302,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6425,11 +6451,6 @@ msgid "Delete Item"
msgstr "刪除"
#: editor/project_settings_editor.cpp
-#, fuzzy
-msgid "Can't contain '/' or ':'"
-msgstr "ä¸èƒ½é€£åˆ°ä¸»æ©Ÿï¼š"
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -7508,6 +7529,10 @@ msgstr "設定"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -8171,10 +8196,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8257,6 +8292,10 @@ msgid "Invalid font size."
msgstr "無效字型"
#, fuzzy
+#~ msgid "Can't contain '/' or ':'"
+#~ msgstr "ä¸èƒ½é€£åˆ°ä¸»æ©Ÿï¼š"
+
+#, fuzzy
#~ msgid "Can't write file."
#~ msgstr "無法新增資料夾"
diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po
index 2d67ef98c1..ccbd45bf31 100644
--- a/editor/translations/zh_TW.po
+++ b/editor/translations/zh_TW.po
@@ -4,24 +4,27 @@
# This file is distributed under the same license as the Godot source code.
#
# Allen H <w84miracle@gmail.com>, 2017.
+# Billy SU <g4691821@gmail.com>, 2018.
# Chao Yu <casd82@gmail.com>, 2017.
# Cliffs Dover <bottle@dancingbottle.com>, 2017.
+# Kisaragi Hiu <mail@kisaragi-hiu.com>, 2018.
# Matt <chchwy@gmail.com>, 2017.
# popcade <popcade@gmail.com>, 2016.
+# Qing <icinriiq@gmail.com>, 2018.
# Sam Pan <sampan66@gmail.com>, 2016.
#
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-11-24 10:45+0000\n"
-"Last-Translator: Matt <chchwy@gmail.com>\n"
+"PO-Revision-Date: 2018-04-24 09:35+0000\n"
+"Last-Translator: Qing <icinriiq@gmail.com>\n"
"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
"godot-engine/godot/zh_Hant/>\n"
"Language: zh_TW\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 2.18-dev\n"
+"X-Generator: Weblate 3.0-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -38,20 +41,20 @@ msgstr "動畫更改座標"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
-msgstr ""
+msgstr "動畫更改轉場效果"
#: editor/animation_editor.cpp
msgid "Anim Change Transform"
msgstr "動畫更改座標"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Change Keyframe Value"
-msgstr "動畫更改座標"
+msgstr "動畫更改關éµå¹€æ•¸å€¼"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Change Call"
-msgstr ""
+msgstr "動畫改變呼å«"
#: editor/animation_editor.cpp
msgid "Anim Add Track"
@@ -90,8 +93,9 @@ msgid "Anim Track Change Value Mode"
msgstr "動畫軌改變模å¼"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr ""
+msgstr "動畫軌é“更改環繞模å¼"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
@@ -112,7 +116,7 @@ msgstr "複製所é¸"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr ""
+msgstr "é‡è¤‡è½‰ç½®"
#: editor/animation_editor.cpp
msgid "Remove Selection"
@@ -177,7 +181,7 @@ msgstr "進出"
#: editor/animation_editor.cpp
msgid "Out-In"
-msgstr ""
+msgstr "外-內"
#: editor/animation_editor.cpp
msgid "Transitions"
@@ -212,28 +216,30 @@ msgid "Anim Create & Insert"
msgstr "動畫建立與æ’å…¥"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Insert Track & Key"
-msgstr ""
+msgstr "動畫新增軌跡與按éµ"
#: editor/animation_editor.cpp
msgid "Anim Insert Key"
-msgstr ""
+msgstr "動畫新增按éµ"
#: editor/animation_editor.cpp
msgid "Change Anim Len"
-msgstr ""
+msgstr "變更動畫長度"
#: editor/animation_editor.cpp
msgid "Change Anim Loop"
-msgstr ""
+msgstr "變更動畫迴圈"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim Create Typed Value Key"
-msgstr ""
+msgstr "動畫新增具類別之éµå€¼"
#: editor/animation_editor.cpp
msgid "Anim Insert"
-msgstr ""
+msgstr "æ’入動畫"
#: editor/animation_editor.cpp
msgid "Anim Scale Keys"
@@ -241,19 +247,19 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Add Call Track"
-msgstr ""
+msgstr "動畫新增呼å«è»Œè·¡"
#: editor/animation_editor.cpp
msgid "Animation zoom."
-msgstr ""
+msgstr "動畫空間。"
#: editor/animation_editor.cpp
msgid "Length (s):"
-msgstr ""
+msgstr "長度(s):"
#: editor/animation_editor.cpp
msgid "Animation length (in seconds)."
-msgstr "動畫長度 (秒)"
+msgstr "動畫長度 (秒)。"
#: editor/animation_editor.cpp
msgid "Step (s):"
@@ -265,75 +271,77 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
-msgstr ""
+msgstr "啟用/åœç”¨ 動畫迴圈。"
#: editor/animation_editor.cpp
msgid "Add new tracks."
-msgstr ""
+msgstr "新增動畫軌。"
#: editor/animation_editor.cpp
msgid "Move current track up."
-msgstr ""
+msgstr "上移當å‰å‹•ç•«è»Œã€‚"
#: editor/animation_editor.cpp
msgid "Move current track down."
-msgstr ""
+msgstr "下移當å‰å‹•ç•«è»Œã€‚"
#: editor/animation_editor.cpp
msgid "Remove selected track."
-msgstr ""
+msgstr "移除é¸æ“‡çš„動畫軌。"
#: editor/animation_editor.cpp
msgid "Track tools"
-msgstr ""
+msgstr "軌跡工具"
#: editor/animation_editor.cpp
msgid "Enable editing of individual keys by clicking them."
-msgstr ""
+msgstr "啟用å¯ä½¿ç”¨é»žæ“Šä¾†æ›´æ”¹å„個éµã€‚"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Anim. Optimizer"
-msgstr ""
+msgstr "動畫. 最佳化"
#: editor/animation_editor.cpp
msgid "Max. Linear Error:"
-msgstr ""
+msgstr "最大線性錯誤:"
#: editor/animation_editor.cpp
msgid "Max. Angular Error:"
-msgstr ""
+msgstr "最大角度錯誤:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr ""
+msgstr "最大å¯å„ªåŒ–角度:"
#: editor/animation_editor.cpp
msgid "Optimize"
-msgstr ""
+msgstr "最佳化"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Select an AnimationPlayer from the Scene Tree to edit animations."
-msgstr ""
+msgstr "從場景樹中é¸æ“‡ä¸€å€‹ AnimationPlayer 來編輯動畫。"
#: editor/animation_editor.cpp
msgid "Key"
-msgstr ""
+msgstr "éµ"
#: editor/animation_editor.cpp
msgid "Transition"
-msgstr ""
+msgstr "轉場"
#: editor/animation_editor.cpp
msgid "Scale Ratio:"
-msgstr ""
+msgstr "縮放比例:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr ""
+msgstr "呼å«å“ªå€‹ç¯€é»žè£¡çš„函å¼?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
-msgstr ""
+msgstr "移除無效按éµ"
#: editor/animation_editor.cpp
msgid "Remove unresolved and empty tracks"
@@ -341,27 +349,27 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Clean-up all animations"
-msgstr ""
+msgstr "清除所有動畫"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation(s) (NO UNDO!)"
-msgstr ""
+msgstr "清除動畫 (無法復原!)"
#: editor/animation_editor.cpp
msgid "Clean-Up"
-msgstr ""
+msgstr "清除"
#: editor/array_property_edit.cpp
msgid "Resize Array"
-msgstr ""
+msgstr "調整陣列大å°"
#: editor/array_property_edit.cpp
msgid "Change Array Value Type"
-msgstr ""
+msgstr "調整陣列資料型態"
#: editor/array_property_edit.cpp
msgid "Change Array Value"
-msgstr ""
+msgstr "調整陣列資料"
#: editor/code_editor.cpp
msgid "Go to Line"
@@ -385,7 +393,7 @@ msgstr "符åˆå¤§å°å¯«"
#: editor/code_editor.cpp
msgid "Whole Words"
-msgstr ""
+msgstr "整個字"
#: editor/code_editor.cpp
msgid "Replace"
@@ -421,17 +429,17 @@ msgstr "列:"
#: editor/connections_dialog.cpp
msgid "Method in target Node must be specified!"
-msgstr ""
+msgstr "需指定在目標節點上的方法!"
#: editor/connections_dialog.cpp
msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
-msgstr ""
+msgstr "找ä¸åˆ°ç›®æ¨™æ–¹æ³•! 指定一個å°çš„方法或附加一個腳本到目標的節點上。"
#: editor/connections_dialog.cpp
msgid "Connect To Node:"
-msgstr ""
+msgstr "連接到節點:"
#: editor/connections_dialog.cpp editor/editor_autoload_settings.cpp
#: editor/groups_editor.cpp editor/plugins/item_list_editor_plugin.cpp
@@ -448,15 +456,15 @@ msgstr "移除"
#: editor/connections_dialog.cpp
msgid "Add Extra Call Argument:"
-msgstr ""
+msgstr "新增é¡å¤–呼å«åƒæ•¸:"
#: editor/connections_dialog.cpp
msgid "Extra Call Arguments:"
-msgstr ""
+msgstr "é¡å¤–呼å«åƒæ•¸:"
#: editor/connections_dialog.cpp
msgid "Path to Node:"
-msgstr ""
+msgstr "節點路徑:"
#: editor/connections_dialog.cpp
msgid "Make Function"
@@ -469,7 +477,7 @@ msgstr "延é²"
#: editor/connections_dialog.cpp
msgid "Oneshot"
-msgstr ""
+msgstr "一次性"
#: editor/connections_dialog.cpp editor/dependency_editor.cpp
#: editor/export_template_manager.cpp
@@ -483,23 +491,23 @@ msgstr ""
#: editor/run_settings_dialog.cpp editor/settings_config_dialog.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Close"
-msgstr ""
+msgstr "關閉"
#: editor/connections_dialog.cpp
msgid "Connect"
-msgstr ""
+msgstr "連接"
#: editor/connections_dialog.cpp
msgid "Connect '%s' to '%s'"
-msgstr ""
+msgstr "連接 '%s' 到 '%s'"
#: editor/connections_dialog.cpp
msgid "Connecting Signal:"
-msgstr ""
+msgstr "連çµè¨Šè™Ÿ:"
#: editor/connections_dialog.cpp
msgid "Disconnect '%s' from '%s'"
-msgstr ""
+msgstr "將 '%s' 從 '%s' 中斷連接"
#: editor/connections_dialog.cpp
msgid "Connect.."
@@ -512,7 +520,7 @@ msgstr "æ–·ç·š"
#: editor/connections_dialog.cpp editor/editor_help.cpp editor/node_dock.cpp
msgid "Signals"
-msgstr ""
+msgstr "信號"
#: editor/create_dialog.cpp
#, fuzzy
@@ -522,7 +530,7 @@ msgstr "變更é¡é ­å°ºå¯¸"
#: editor/create_dialog.cpp editor/project_settings_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
msgid "Change"
-msgstr ""
+msgstr "æ›´æ›"
#: editor/create_dialog.cpp
#, fuzzy
@@ -559,11 +567,11 @@ msgstr "æè¿°:"
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
-msgstr ""
+msgstr "尋找å–代目標:"
#: editor/dependency_editor.cpp
msgid "Dependencies For:"
-msgstr ""
+msgstr "相ä¾æ–¼:"
#: editor/dependency_editor.cpp
msgid ""
@@ -578,15 +586,17 @@ msgid ""
"Resource '%s' is in use.\n"
"Changes will take effect when reloaded."
msgstr ""
+"'%s' 資æºæ­£åœ¨ä½¿ç”¨ä¸­ã€‚\n"
+"變更會在é‡æ–°è¼‰å…¥æ™‚套用。"
#: editor/dependency_editor.cpp
#: modules/gdnative/gdnative_library_editor_plugin.cpp
msgid "Dependencies"
-msgstr ""
+msgstr "相ä¾"
#: editor/dependency_editor.cpp
msgid "Resource"
-msgstr ""
+msgstr "資æº"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings_editor.cpp
@@ -596,15 +606,15 @@ msgstr "路徑"
#: editor/dependency_editor.cpp
msgid "Dependencies:"
-msgstr ""
+msgstr "相ä¾:"
#: editor/dependency_editor.cpp
msgid "Fix Broken"
-msgstr ""
+msgstr "修復æ壞的"
#: editor/dependency_editor.cpp
msgid "Dependency Editor"
-msgstr ""
+msgstr "相ä¾æ€§ç·¨è¼¯å™¨"
#: editor/dependency_editor.cpp
msgid "Search Replacement Resource:"
@@ -619,7 +629,7 @@ msgstr "é–‹å•Ÿ"
#: editor/dependency_editor.cpp
msgid "Owners Of:"
-msgstr ""
+msgstr "æ“有者:"
#: editor/dependency_editor.cpp
msgid "Remove selected files from the project? (no undo)"
@@ -636,7 +646,7 @@ msgstr ""
#: editor/dependency_editor.cpp
msgid "Cannot remove:"
-msgstr ""
+msgstr "無法移除:"
#: editor/dependency_editor.cpp
msgid "Error loading:"
@@ -656,7 +666,7 @@ msgstr "該執行什麼æ“作呢?"
#: editor/dependency_editor.cpp
msgid "Fix Dependencies"
-msgstr ""
+msgstr "修復相ä¾æ€§"
#: editor/dependency_editor.cpp
msgid "Errors loading!"
@@ -704,7 +714,7 @@ msgstr ""
#: editor/editor_about.cpp
msgid "Thanks!"
-msgstr ""
+msgstr "è¬è¬!"
#: editor/editor_about.cpp
msgid "Godot Engine contributors"
@@ -725,7 +735,7 @@ msgstr "專案創始人"
#: editor/editor_about.cpp
msgid "Developers"
-msgstr ""
+msgstr "開發者"
#: editor/editor_about.cpp
msgid "Authors"
@@ -761,7 +771,7 @@ msgstr ""
#: editor/editor_about.cpp
msgid "License"
-msgstr ""
+msgstr "授權"
#: editor/editor_about.cpp
msgid "Thirdparty License"
@@ -785,7 +795,7 @@ msgstr ""
#: editor/editor_about.cpp
msgid "Licenses"
-msgstr ""
+msgstr "授權"
#: editor/editor_asset_installer.cpp editor/project_manager.cpp
msgid "Error opening package file, not in zip format."
@@ -808,7 +818,7 @@ msgstr ""
#: editor/editor_asset_installer.cpp
#: editor/plugins/asset_library_editor_plugin.cpp
msgid "Install"
-msgstr ""
+msgstr "安è£"
#: editor/editor_asset_installer.cpp
msgid "Package Installer"
@@ -869,7 +879,7 @@ msgstr ""
#: editor/editor_audio_buses.cpp
msgid "Mute"
-msgstr ""
+msgstr "éœéŸ³"
#: editor/editor_audio_buses.cpp
msgid "Bypass"
@@ -981,11 +991,11 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Invalid name."
-msgstr ""
+msgstr "ä¸èƒ½ä½¿ç”¨çš„å稱。"
#: editor/editor_autoload_settings.cpp
msgid "Valid characters:"
-msgstr ""
+msgstr "åˆæ³•å­—å…ƒ:"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name. Must not collide with an existing engine class name."
@@ -1059,7 +1069,7 @@ msgstr "å稱"
#: editor/editor_autoload_settings.cpp
msgid "Singleton"
-msgstr ""
+msgstr "單例"
#: editor/editor_data.cpp
msgid "Updating Scene"
@@ -1196,7 +1206,7 @@ msgstr "往上"
#: editor/editor_file_dialog.cpp
msgid "Toggle Hidden Files"
-msgstr ""
+msgstr "切æ›é¡¯ç¤ºéš±è—檔案"
#: editor/editor_file_dialog.cpp
msgid "Toggle Favorite"
@@ -1396,6 +1406,10 @@ msgstr "清除"
msgid "Clear Output"
msgstr "輸出:"
+#: editor/editor_node.cpp
+msgid "Project export failed with error code %d."
+msgstr ""
+
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
msgid "Error saving resource!"
msgstr ""
@@ -1536,7 +1550,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Expand all properties"
-msgstr ""
+msgstr "展開所有屬性"
#: editor/editor_node.cpp
msgid "Collapse all properties"
@@ -1653,17 +1667,17 @@ msgid "Export Mesh Library"
msgstr ""
#: editor/editor_node.cpp
-#, fuzzy
msgid "This operation can't be done without a root node."
-msgstr "æ­¤æ“作無法復原, 確定è¦é‚„原嗎?"
+msgstr "æ­¤æ“作無法在沒有根節點的情æ³ä¸‹é€²è¡Œã€‚"
#: editor/editor_node.cpp
msgid "Export Tile Set"
msgstr ""
#: editor/editor_node.cpp
+#, fuzzy
msgid "This operation can't be done without a selected node."
-msgstr ""
+msgstr "æ­¤æ“作需è¦æœ‰é¸æ“‡è‘—節點æ‰èƒ½é€²è¡Œã€‚"
#: editor/editor_node.cpp
msgid "Current scene not saved. Open anyway?"
@@ -2152,8 +2166,9 @@ msgid "Import"
msgstr ""
#: editor/editor_node.cpp
+#, fuzzy
msgid "Node"
-msgstr ""
+msgstr "節點"
#: editor/editor_node.cpp
msgid "FileSystem"
@@ -3652,6 +3667,14 @@ msgid "Show Guides"
msgstr ""
#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Origin"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
+msgid "Show Viewport"
+msgstr ""
+
+#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
msgstr ""
@@ -3942,6 +3965,10 @@ msgid "Mesh has not surface to create outlines from!"
msgstr ""
#: editor/plugins/mesh_instance_editor_plugin.cpp
+msgid "Mesh primitive type is not PRIMITIVE_TRIANGLES!"
+msgstr ""
+
+#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
msgstr ""
@@ -5625,6 +5652,14 @@ msgid "Checked Item"
msgstr ""
#: editor/plugins/theme_editor_plugin.cpp
+msgid "Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
+msgid "Checked Radio Item"
+msgstr ""
+
+#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
msgstr ""
@@ -6112,7 +6147,9 @@ msgid "Mouse Button"
msgstr ""
#: editor/project_settings_editor.cpp
-msgid "Invalid action (anything goes but '/' or ':')."
+msgid ""
+"Invalid action name. it cannot be empty nor contain '/', ':', '=', '\\' or "
+"'\"'"
msgstr ""
#: editor/project_settings_editor.cpp
@@ -6258,10 +6295,6 @@ msgid "Delete Item"
msgstr "刪除"
#: editor/project_settings_editor.cpp
-msgid "Can't contain '/' or ':'"
-msgstr ""
-
-#: editor/project_settings_editor.cpp
msgid "Already existing"
msgstr ""
@@ -6800,7 +6833,7 @@ msgstr ""
#: editor/scene_tree_editor.cpp
msgid "Scene Tree (Nodes):"
-msgstr ""
+msgstr "場景樹 (節點):"
#: editor/scene_tree_editor.cpp
msgid "Node Configuration Warning!"
@@ -7334,6 +7367,10 @@ msgstr "專案設定"
msgid "Pick Distance:"
msgstr ""
+#: modules/mono/csharp_script.cpp
+msgid "Class name can't be a reserved keyword"
+msgstr ""
+
#: modules/mono/editor/godotsharp_editor.cpp
msgid "Generating solution..."
msgstr ""
@@ -7987,10 +8024,20 @@ msgid "Path property must point to a valid Spatial node to work."
msgstr ""
#: scene/3d/scenario_fx.cpp
+msgid "WorldEnvironment needs an Environment resource."
+msgstr ""
+
+#: scene/3d/scenario_fx.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr ""
+#: scene/3d/scenario_fx.cpp
+msgid ""
+"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
+"this environment's Background Mode to Canvas (for 2D scenes)."
+msgstr ""
+
#: scene/3d/sprite_3d.cpp
msgid ""
"A SpriteFrames resource must be created or set in the 'Frames' property in "
@@ -8009,20 +8056,19 @@ msgstr ""
#: scene/gui/color_picker.cpp
msgid "Add current color as a preset"
-msgstr ""
+msgstr "將目å‰é¡è‰²è¨­ç‚ºé è¨­"
#: scene/gui/dialogs.cpp
msgid "Alert!"
-msgstr ""
+msgstr "警告!"
#: scene/gui/dialogs.cpp
msgid "Please Confirm..."
-msgstr ""
+msgstr "請確èª..."
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Select this Folder"
-msgstr "僅é¸æ“‡å€åŸŸ"
+msgstr "é¸æ“‡æ­¤è³‡æ–™å¤¾"
#: scene/gui/popup.cpp
msgid ""
@@ -8040,13 +8086,15 @@ msgstr ""
#: scene/gui/tree.cpp
msgid "(Other)"
-msgstr ""
+msgstr "(其它)"
#: scene/main/scene_tree.cpp
msgid ""
"Default Environment as specified in Project Settings (Rendering -> "
"Environment -> Default Environment) could not be loaded."
msgstr ""
+"在專案設定中的é è¨­ç’°å¢ƒ(Rendering -> Environment -> Default Environment)ä¸èƒ½è¢«"
+"載入"
#: scene/main/viewport.cpp
msgid ""
diff --git a/main/main.cpp b/main/main.cpp
index ffc02d8823..92b4e31679 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -262,8 +262,8 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print("Standalone tools:\n");
OS::get_singleton()->print(" -s, --script <script> Run a script.\n");
#ifdef TOOLS_ENABLED
- OS::get_singleton()->print(" --export <target> Export the project using the given export target.\n");
- OS::get_singleton()->print(" --export-debug Use together with --export, enables debug mode for the template.\n");
+ OS::get_singleton()->print(" --export <target> Export the project using the given export target. Export only main pack if path ends with .pck or .zip'.\n");
+ OS::get_singleton()->print(" --export-debug <target> Like --export, but use debug template.\n");
OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n");
OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
OS::get_singleton()->print(" --build-solutions Build the scripting solutions (e.g. for C# projects).\n");
@@ -337,7 +337,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String video_driver = "";
String audio_driver = "";
- String game_path = ".";
+ String project_path = ".";
bool upwards = false;
String debug_mode;
String debug_host;
@@ -553,7 +553,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (OS::get_singleton()->set_cwd(p) == OK) {
//nothing
} else {
- game_path = I->next()->get(); //use game_path instead
+ project_path = I->next()->get(); //use project_path instead
}
N = I->next()->next();
} else {
@@ -576,7 +576,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (OS::get_singleton()->set_cwd(path) == OK) {
// path already specified, don't override
} else {
- game_path = path;
+ project_path = path;
}
#ifdef TOOLS_ENABLED
editor = true;
@@ -672,35 +672,20 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "--disable-crash-handler") {
OS::get_singleton()->disable_crash_handler();
} else {
-
- //test for game path
- bool gpfound = false;
-
- if (!I->get().begins_with("-") && game_path == "") {
- DirAccess *da = DirAccess::open(I->get());
- if (da != NULL) {
- game_path = I->get();
- gpfound = true;
- memdelete(da);
- }
- }
-
- if (!gpfound) {
- main_args.push_back(I->get());
- }
+ main_args.push_back(I->get());
}
I = N;
}
- if (globals->setup(game_path, main_pack, upwards) == OK) {
+ if (globals->setup(project_path, main_pack, upwards) == OK) {
found_project = true;
} else {
#ifdef TOOLS_ENABLED
editor = false;
#else
- OS::get_singleton()->print("Error: Could not load game path '%s'.\n", game_path.ascii().get_data());
+ OS::get_singleton()->print("Error: Could not load game path '%s'.\n", project_path.ascii().get_data());
goto error;
#endif
@@ -730,6 +715,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (debug_mode == "local") {
script_debugger = memnew(ScriptDebuggerLocal);
+ OS::get_singleton()->initialize_debugging();
}
FileAccessNetwork::configure();
@@ -874,7 +860,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->_allow_hidpi = GLOBAL_DEF("display/window/dpi/allow_hidpi", false);
}
+ OS::get_singleton()->_allow_layered = GLOBAL_DEF("display/window/allow_per_pixel_transparency", false);
+
video_mode.use_vsync = GLOBAL_DEF("display/window/vsync/use_vsync", true);
+ video_mode.layered = GLOBAL_DEF("display/window/per_pixel_transparency", false);
+ video_mode.layered_splash = GLOBAL_DEF("display/window/per_pixel_transparency_splash", false);
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation", 2);
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_allocation.mobile", 3);
@@ -882,6 +872,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (editor || project_manager) {
// The editor and project manager always detect and use hiDPI if needed
OS::get_singleton()->_allow_hidpi = true;
+ OS::get_singleton()->_allow_layered = false;
}
Engine::get_singleton()->_pixel_snap = GLOBAL_DEF("rendering/quality/2d/use_pixel_snap", false);
@@ -955,6 +946,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
Engine::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/common/physics_fps", 60));
+ Engine::get_singleton()->set_physics_jitter_fix(GLOBAL_DEF("physics/common/physics_jitter_fix", 0.5));
Engine::get_singleton()->set_target_fps(GLOBAL_DEF("debug/settings/fps/force_fps", 0));
GLOBAL_DEF("debug/settings/stdout/print_fps", false);
@@ -984,7 +976,7 @@ error:
video_driver = "";
audio_driver = "";
- game_path = "";
+ project_path = "";
args.clear();
main_args.clear();
@@ -1143,14 +1135,14 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton());
if (id) {
- if (bool(GLOBAL_DEF("input/pointing_devices/emulate_touch_from_mouse", false)) && !(editor || project_manager)) {
+ if (bool(GLOBAL_DEF("input_devices/pointing/emulate_touch_from_mouse", false)) && !(editor || project_manager)) {
if (!OS::get_singleton()->has_touchscreen_ui_hint()) {
//only if no touchscreen ui hint, set emulation
id->set_emulate_touch_from_mouse(true);
}
}
- id->set_emulate_mouse_from_touch(bool(GLOBAL_DEF("input/pointing_devices/emulate_mouse_from_touch", true)));
+ id->set_emulate_mouse_from_touch(bool(GLOBAL_DEF("input_devices/pointing/emulate_mouse_from_touch", true)));
}
MAIN_PRINT("Main: Load Remaps");
@@ -1228,6 +1220,229 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
return OK;
}
+// everything the main loop needs to know about frame timings
+struct _FrameTime {
+ float animation_step; // time to advance animations for (argument to process())
+ int physics_steps; // number of times to iterate the physics engine
+
+ void clamp_animation(float min_animation_step, float max_animation_step) {
+ if (animation_step < min_animation_step) {
+ animation_step = min_animation_step;
+ } else if (animation_step > max_animation_step) {
+ animation_step = max_animation_step;
+ }
+ }
+};
+
+class _TimerSync {
+ // wall clock time measured on the main thread
+ uint64_t last_cpu_ticks_usec;
+ uint64_t current_cpu_ticks_usec;
+
+ // logical game time since last physics timestep
+ float time_accum;
+
+ // current difference between wall clock time and reported sum of animation_steps
+ float time_deficit;
+
+ // number of frames back for keeping accumulated physics steps roughly constant.
+ // value of 12 chosen because that is what is required to make 144 Hz monitors
+ // behave well with 60 Hz physics updates. The only worse commonly available refresh
+ // would be 85, requiring CONTROL_STEPS = 17.
+ static const int CONTROL_STEPS = 12;
+
+ // sum of physics steps done over the last (i+1) frames
+ int accumulated_physics_steps[CONTROL_STEPS];
+
+ // typical value for accumulated_physics_steps[i] is either this or this plus one
+ int typical_physics_steps[CONTROL_STEPS];
+
+protected:
+ // returns the fraction of p_frame_slice required for the timer to overshoot
+ // before advance_core considers changing the physics_steps return from
+ // the typical values as defined by typical_physics_steps
+ float get_physics_jitter_fix() {
+ return Engine::get_singleton()->get_physics_jitter_fix();
+ }
+
+ // gets our best bet for the average number of physics steps per render frame
+ // return value: number of frames back this data is consistent
+ int get_average_physics_steps(float &p_min, float &p_max) {
+ p_min = typical_physics_steps[0];
+ p_max = p_min + 1;
+
+ for (int i = 1; i < CONTROL_STEPS; ++i) {
+ const float typical_lower = typical_physics_steps[i];
+ const float current_min = typical_lower / (i + 1);
+ if (current_min > p_max)
+ return i; // bail out of further restrictions would void the interval
+ else if (current_min > p_min)
+ p_min = current_min;
+ const float current_max = (typical_lower + 1) / (i + 1);
+ if (current_max < p_min)
+ return i;
+ else if (current_max < p_max)
+ p_max = current_max;
+ }
+
+ return CONTROL_STEPS;
+ }
+
+ // advance physics clock by p_animation_step, return appropriate number of steps to simulate
+ _FrameTime advance_core(float p_frame_slice, int p_iterations_per_second, float p_animation_step) {
+ _FrameTime ret;
+
+ ret.animation_step = p_animation_step;
+
+ // simple determination of number of physics iteration
+ time_accum += ret.animation_step;
+ ret.physics_steps = floor(time_accum * p_iterations_per_second);
+
+ int min_typical_steps = typical_physics_steps[0];
+ int max_typical_steps = min_typical_steps + 1;
+
+ // given the past recorded steps and typcial steps to match, calculate bounds for this
+ // step to be typical
+ bool update_typical = false;
+
+ for (int i = 0; i < CONTROL_STEPS - 1; ++i) {
+ int steps_left_to_match_typical = typical_physics_steps[i + 1] - accumulated_physics_steps[i];
+ if (steps_left_to_match_typical > max_typical_steps ||
+ steps_left_to_match_typical + 1 < min_typical_steps) {
+ update_typical = true;
+ break;
+ }
+
+ if (steps_left_to_match_typical > min_typical_steps)
+ min_typical_steps = steps_left_to_match_typical;
+ if (steps_left_to_match_typical + 1 < max_typical_steps)
+ max_typical_steps = steps_left_to_match_typical + 1;
+ }
+
+ // try to keep it consistent with previous iterations
+ if (ret.physics_steps < min_typical_steps) {
+ const int max_possible_steps = floor((time_accum)*p_iterations_per_second + get_physics_jitter_fix());
+ if (max_possible_steps < min_typical_steps) {
+ ret.physics_steps = max_possible_steps;
+ update_typical = true;
+ } else {
+ ret.physics_steps = min_typical_steps;
+ }
+ } else if (ret.physics_steps > max_typical_steps) {
+ const int min_possible_steps = floor((time_accum)*p_iterations_per_second - get_physics_jitter_fix());
+ if (min_possible_steps > max_typical_steps) {
+ ret.physics_steps = min_possible_steps;
+ update_typical = true;
+ } else {
+ ret.physics_steps = max_typical_steps;
+ }
+ }
+
+ time_accum -= ret.physics_steps * p_frame_slice;
+
+ // keep track of accumulated step counts
+ for (int i = CONTROL_STEPS - 2; i >= 0; --i) {
+ accumulated_physics_steps[i + 1] = accumulated_physics_steps[i] + ret.physics_steps;
+ }
+ accumulated_physics_steps[0] = ret.physics_steps;
+
+ if (update_typical) {
+ for (int i = CONTROL_STEPS - 1; i >= 0; --i) {
+ if (typical_physics_steps[i] > accumulated_physics_steps[i]) {
+ typical_physics_steps[i] = accumulated_physics_steps[i];
+ } else if (typical_physics_steps[i] < accumulated_physics_steps[i] - 1) {
+ typical_physics_steps[i] = accumulated_physics_steps[i] - 1;
+ }
+ }
+ }
+
+ return ret;
+ }
+
+ // calls advance_core, keeps track of deficit it adds to animaption_step, make sure the deficit sum stays close to zero
+ _FrameTime advance_checked(float p_frame_slice, int p_iterations_per_second, float p_animation_step) {
+ if (fixed_fps != -1)
+ p_animation_step = 1.0 / fixed_fps;
+
+ // compensate for last deficit
+ p_animation_step += time_deficit;
+
+ _FrameTime ret = advance_core(p_frame_slice, p_iterations_per_second, p_animation_step);
+
+ // we will do some clamping on ret.animation_step and need to sync those changes to time_accum,
+ // that's easiest if we just remember their fixed difference now
+ const double animation_minus_accum = ret.animation_step - time_accum;
+
+ // first, least important clamping: keep ret.animation_step consistent with typical_physics_steps.
+ // this smoothes out the animation steps and culls small but quick variations.
+ {
+ float min_average_physics_steps, max_average_physics_steps;
+ int consistent_steps = get_average_physics_steps(min_average_physics_steps, max_average_physics_steps);
+ if (consistent_steps > 3) {
+ ret.clamp_animation(min_average_physics_steps * p_frame_slice, max_average_physics_steps * p_frame_slice);
+ }
+ }
+
+ // second clamping: keep abs(time_deficit) < jitter_fix * frame_slise
+ float max_clock_deviation = get_physics_jitter_fix() * p_frame_slice;
+ ret.clamp_animation(p_animation_step - max_clock_deviation, p_animation_step + max_clock_deviation);
+
+ // last clamping: make sure time_accum is between 0 and p_frame_slice for consistency between physics and animation
+ ret.clamp_animation(animation_minus_accum, animation_minus_accum + p_frame_slice);
+
+ // restore time_accum
+ time_accum = ret.animation_step - animation_minus_accum;
+
+ // track deficit
+ time_deficit = p_animation_step - ret.animation_step;
+
+ return ret;
+ }
+
+ // determine wall clock step since last iteration
+ float get_cpu_animation_step() {
+ uint64_t cpu_ticks_elapsed = current_cpu_ticks_usec - last_cpu_ticks_usec;
+ last_cpu_ticks_usec = current_cpu_ticks_usec;
+
+ return cpu_ticks_elapsed / 1000000.0;
+ }
+
+public:
+ explicit _TimerSync() :
+ last_cpu_ticks_usec(0),
+ current_cpu_ticks_usec(0),
+ time_accum(0),
+ time_deficit(0) {
+ for (int i = CONTROL_STEPS - 1; i >= 0; --i) {
+ typical_physics_steps[i] = i;
+ accumulated_physics_steps[i] = i;
+ }
+ }
+
+ // start the clock
+ void init(uint64_t p_cpu_ticks_usec) {
+ current_cpu_ticks_usec = last_cpu_ticks_usec = p_cpu_ticks_usec;
+ }
+
+ // set measured wall clock time
+ void set_cpu_ticks_usec(uint64_t p_cpu_ticks_usec) {
+ current_cpu_ticks_usec = p_cpu_ticks_usec;
+ }
+
+ // advance one frame, return timesteps to take
+ _FrameTime advance(float p_frame_slice, int p_iterations_per_second) {
+ float cpu_animation_step = get_cpu_animation_step();
+
+ return advance_checked(p_frame_slice, p_iterations_per_second, cpu_animation_step);
+ }
+
+ void before_start_render() {
+ VisualServer::get_singleton()->sync();
+ }
+};
+
+static _TimerSync _timer_sync;
+
bool Main::start() {
ERR_FAIL_COND_V(!_start_success, false);
@@ -1242,6 +1457,8 @@ bool Main::start() {
String _export_preset;
bool export_debug = false;
+ _timer_sync.init(OS::get_singleton()->get_ticks_usec());
+
List<String> args = OS::get_singleton()->get_cmdline_args();
for (int i = 0; i < args.size(); i++) {
//parameters that do not have an argument to the right
@@ -1444,6 +1661,114 @@ bool Main::start() {
}
#endif
+ if (!project_manager) { // game or editor
+ if (game_path != "" || script != "") {
+ //autoload
+ List<PropertyInfo> props;
+ ProjectSettings::get_singleton()->get_property_list(&props);
+
+ //first pass, add the constants so they exist before any script is loaded
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
+
+ String s = E->get().name;
+ if (!s.begins_with("autoload/"))
+ continue;
+ String name = s.get_slicec('/', 1);
+ String path = ProjectSettings::get_singleton()->get(s);
+ bool global_var = false;
+ if (path.begins_with("*")) {
+ global_var = true;
+ }
+
+ if (global_var) {
+ for (int i = 0; i < ScriptServer::get_language_count(); i++) {
+#ifdef TOOLS_ENABLED
+ if (editor) {
+ ScriptServer::get_language(i)->add_named_global_constant(name, Variant());
+ } else {
+ ScriptServer::get_language(i)->add_global_constant(name, Variant());
+ }
+#else
+ ScriptServer::get_language(i)->add_global_constant(name, Variant());
+#endif
+ }
+ }
+ }
+
+ //second pass, load into global constants
+ List<Node *> to_add;
+#ifdef TOOLS_ENABLED
+ ResourceLoader::set_timestamp_on_load(editor); // Avoid problems when editing
+#endif
+ for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
+
+ String s = E->get().name;
+ if (!s.begins_with("autoload/"))
+ continue;
+ String name = s.get_slicec('/', 1);
+ String path = ProjectSettings::get_singleton()->get(s);
+ bool global_var = false;
+ if (path.begins_with("*")) {
+ global_var = true;
+ path = path.substr(1, path.length() - 1);
+ }
+
+ RES res = ResourceLoader::load(path);
+ ERR_EXPLAIN("Can't autoload: " + path);
+ ERR_CONTINUE(res.is_null());
+ Node *n = NULL;
+ if (res->is_class("PackedScene")) {
+ Ref<PackedScene> ps = res;
+ n = ps->instance();
+ } else if (res->is_class("Script")) {
+ Ref<Script> s = res;
+ StringName ibt = s->get_instance_base_type();
+ bool valid_type = ClassDB::is_parent_class(ibt, "Node");
+ ERR_EXPLAIN("Script does not inherit a Node: " + path);
+ ERR_CONTINUE(!valid_type);
+
+ Object *obj = ClassDB::instance(ibt);
+
+ ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt));
+ ERR_CONTINUE(obj == NULL);
+
+ n = Object::cast_to<Node>(obj);
+ n->set_script(s.get_ref_ptr());
+ }
+
+ ERR_EXPLAIN("Path in autoload not a node or script: " + path);
+ ERR_CONTINUE(!n);
+ n->set_name(name);
+
+ //defer so references are all valid on _ready()
+ to_add.push_back(n);
+
+ if (global_var) {
+ for (int i = 0; i < ScriptServer::get_language_count(); i++) {
+#ifdef TOOLS_ENABLED
+ if (editor) {
+ ScriptServer::get_language(i)->add_named_global_constant(name, n);
+ } else {
+ ScriptServer::get_language(i)->add_global_constant(name, n);
+ }
+#else
+ ScriptServer::get_language(i)->add_global_constant(name, n);
+#endif
+ }
+ }
+ }
+
+#ifdef TOOLS_ENABLED
+ ResourceLoader::set_timestamp_on_load(false);
+#endif
+
+ for (List<Node *>::Element *E = to_add.front(); E; E = E->next()) {
+
+ sml->get_root()->add_child(E->get());
+ }
+ }
+ }
+
#ifdef TOOLS_ENABLED
EditorNode *editor_node = NULL;
@@ -1463,9 +1788,6 @@ bool Main::start() {
}
#endif
- {
- }
-
if (!editor && !project_manager) {
//standard helpers that can be changed from main config
@@ -1578,89 +1900,6 @@ bool Main::start() {
}
if (!project_manager && !editor) { // game
- if (game_path != "" || script != "") {
- //autoload
- List<PropertyInfo> props;
- ProjectSettings::get_singleton()->get_property_list(&props);
-
- //first pass, add the constants so they exist before any script is loaded
- for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
-
- String s = E->get().name;
- if (!s.begins_with("autoload/"))
- continue;
- String name = s.get_slicec('/', 1);
- String path = ProjectSettings::get_singleton()->get(s);
- bool global_var = false;
- if (path.begins_with("*")) {
- global_var = true;
- }
-
- if (global_var) {
- for (int i = 0; i < ScriptServer::get_language_count(); i++) {
- ScriptServer::get_language(i)->add_global_constant(name, Variant());
- }
- }
- }
-
- //second pass, load into global constants
- List<Node *> to_add;
- for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
-
- String s = E->get().name;
- if (!s.begins_with("autoload/"))
- continue;
- String name = s.get_slicec('/', 1);
- String path = ProjectSettings::get_singleton()->get(s);
- bool global_var = false;
- if (path.begins_with("*")) {
- global_var = true;
- path = path.substr(1, path.length() - 1);
- }
-
- RES res = ResourceLoader::load(path);
- ERR_EXPLAIN("Can't autoload: " + path);
- ERR_CONTINUE(res.is_null());
- Node *n = NULL;
- if (res->is_class("PackedScene")) {
- Ref<PackedScene> ps = res;
- n = ps->instance();
- } else if (res->is_class("Script")) {
- Ref<Script> s = res;
- StringName ibt = s->get_instance_base_type();
- bool valid_type = ClassDB::is_parent_class(ibt, "Node");
- ERR_EXPLAIN("Script does not inherit a Node: " + path);
- ERR_CONTINUE(!valid_type);
-
- Object *obj = ClassDB::instance(ibt);
-
- ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: " + String(ibt));
- ERR_CONTINUE(obj == NULL);
-
- n = Object::cast_to<Node>(obj);
- n->set_script(s.get_ref_ptr());
- }
-
- ERR_EXPLAIN("Path in autoload not a node or script: " + path);
- ERR_CONTINUE(!n);
- n->set_name(name);
-
- //defer so references are all valid on _ready()
- to_add.push_back(n);
-
- if (global_var) {
- for (int i = 0; i < ScriptServer::get_language_count(); i++) {
- ScriptServer::get_language(i)->add_global_constant(name, n);
- }
- }
- }
-
- for (List<Node *>::Element *E = to_add.front(); E; E = E->next()) {
-
- sml->get_root()->add_child(E->get());
- }
- }
-
if (game_path != "") {
Node *scene = NULL;
Ref<PackedScene> scenedata = ResourceLoader::load(local_game_path);
@@ -1707,7 +1946,6 @@ bool Main::start() {
uint64_t Main::last_ticks = 0;
uint64_t Main::target_ticks = 0;
-float Main::time_accum = 0;
uint32_t Main::frames = 0;
uint32_t Main::frame = 0;
bool Main::force_redraw_requested = false;
@@ -1720,14 +1958,15 @@ bool Main::iteration() {
uint64_t ticks = OS::get_singleton()->get_ticks_usec();
Engine::get_singleton()->_frame_ticks = ticks;
+ _timer_sync.set_cpu_ticks_usec(ticks);
uint64_t ticks_elapsed = ticks - last_ticks;
- double step = (double)ticks_elapsed / 1000000.0;
- if (fixed_fps != -1)
- step = 1.0 / fixed_fps;
+ int physics_fps = Engine::get_singleton()->get_iterations_per_second();
+ float frame_slice = 1.0 / physics_fps;
- float frame_slice = 1.0 / Engine::get_singleton()->get_iterations_per_second();
+ _FrameTime advance = _timer_sync.advance(frame_slice, physics_fps);
+ double step = advance.animation_step;
Engine::get_singleton()->_frame_step = step;
@@ -1743,20 +1982,19 @@ bool Main::iteration() {
last_ticks = ticks;
- if (fixed_fps == -1 && step > frame_slice * 8)
- step = frame_slice * 8;
-
- time_accum += step;
+ static const int max_physics_steps = 8;
+ if (fixed_fps == -1 && advance.physics_steps > max_physics_steps) {
+ step -= (advance.physics_steps - max_physics_steps) * frame_slice;
+ advance.physics_steps = max_physics_steps;
+ }
float time_scale = Engine::get_singleton()->get_time_scale();
bool exit = false;
- int iters = 0;
-
Engine::get_singleton()->_in_physics = true;
- while (time_accum > frame_slice) {
+ for (int iters = 0; iters < advance.physics_steps; ++iters) {
uint64_t physics_begin = OS::get_singleton()->get_ticks_usec();
@@ -1778,12 +2016,10 @@ bool Main::iteration() {
Physics2DServer::get_singleton()->end_sync();
Physics2DServer::get_singleton()->step(frame_slice * time_scale);
- time_accum -= frame_slice;
message_queue->flush();
physics_process_ticks = MAX(physics_process_ticks, OS::get_singleton()->get_ticks_usec() - physics_begin); // keep the largest one for reference
physics_process_max = MAX(OS::get_singleton()->get_ticks_usec() - physics_begin, physics_process_max);
- iters++;
Engine::get_singleton()->_physics_frames++;
}
@@ -1794,7 +2030,7 @@ bool Main::iteration() {
OS::get_singleton()->get_main_loop()->idle(step * time_scale);
message_queue->flush();
- VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.
+ _timer_sync.before_start_render(); //sync if still drawing from previous frames.
if (OS::get_singleton()->can_draw() && !disable_render_loop) {
diff --git a/main/main.h b/main/main.h
index 8b805fa1d0..c20592bf3b 100644
--- a/main/main.h
+++ b/main/main.h
@@ -44,7 +44,6 @@ class Main {
static void print_help(const char *p_binary);
static uint64_t last_ticks;
static uint64_t target_ticks;
- static float time_accum;
static uint32_t frames;
static uint32_t frame;
static bool force_redraw_requested;
diff --git a/main/tests/test_oa_hash_map.cpp b/main/tests/test_oa_hash_map.cpp
index ac65fdf19c..0e34faace7 100644
--- a/main/tests/test_oa_hash_map.cpp
+++ b/main/tests/test_oa_hash_map.cpp
@@ -49,7 +49,7 @@ MainLoop *test() {
map.set(42, 11880);
int value;
- map.lookup(42, &value);
+ map.lookup(42, value);
OS::get_singleton()->print("capacity %d\n", map.get_capacity());
OS::get_singleton()->print("elements %d\n", map.get_num_elements());
@@ -72,7 +72,7 @@ MainLoop *test() {
uint32_t num_elems = 0;
for (int i = 0; i < 500; i++) {
int tmp;
- if (map.lookup(i, &tmp))
+ if (map.lookup(i, tmp) && tmp == i * 2)
num_elems++;
}
@@ -88,7 +88,7 @@ MainLoop *test() {
map.set("Godot rocks", 42);
for (OAHashMap<String, int>::Iterator it = map.iter(); it.valid; it = map.next_iter(it)) {
- OS::get_singleton()->print("map[\"%s\"] = %d\n", it.key->utf8().get_data(), *it.data);
+ OS::get_singleton()->print("map[\"%s\"] = %d\n", it.key->utf8().get_data(), *it.value);
}
}
diff --git a/methods.py b/methods.py
index 792417866e..7cdc160075 100644
--- a/methods.py
+++ b/methods.py
@@ -93,7 +93,6 @@ def include_file_in_legacygl_header(filename, header_data, depth):
enumbase = ifdefline[:ifdefline.find("_EN_")]
ifdefline = ifdefline.replace("_EN_", "_")
line = line.replace("_EN_", "_")
-# print(enumbase+":"+ifdefline);
if (enumbase not in header_data.enums):
header_data.enums[enumbase] = []
if (ifdefline not in header_data.enums[enumbase]):
@@ -192,9 +191,6 @@ def include_file_in_legacygl_header(filename, header_data, depth):
line = line.replace("\r", "")
line = line.replace("\n", "")
- # line=line.replace("\\","\\\\")
- # line=line.replace("\"","\\\"")
- # line=line+"\\n\\"
if (header_data.reading == "vertex"):
header_data.vertex_lines += [line]
@@ -224,7 +220,6 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
out_file_base = out_file
out_file_base = out_file_base[out_file_base.rfind("/") + 1:]
out_file_base = out_file_base[out_file_base.rfind("\\") + 1:]
-# print("out file "+out_file+" base " +out_file_base)
out_file_ifdef = out_file_base.replace(".", "_").upper()
fd.write("#ifndef " + out_file_ifdef + class_suffix + "_120\n")
fd.write("#define " + out_file_ifdef + class_suffix + "_120\n")
@@ -262,10 +257,6 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int16_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
- #fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint64_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n");
- #fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int64_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n");
- #fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, unsigned long p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n");
- #fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, long p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n");
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Color& p_color) { _FU GLfloat col[4]={p_color.r,p_color.g,p_color.b,p_color.a}; glUniform4fv(get_uniform(p_uniform),1,col); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector2& p_vec2) { _FU GLfloat vec2[2]={p_vec2.x,p_vec2.y}; glUniform2fv(get_uniform(p_uniform),1,vec2); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector3& p_vec3) { _FU GLfloat vec3[3]={p_vec3.x,p_vec3.y,p_vec3.z}; glUniform3fv(get_uniform(p_uniform),1,vec3); }\n\n")
@@ -367,10 +358,8 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
x = header_data.enums[xv]
bits = 1
amt = len(x)
-# print(x)
while(2**bits < amt):
bits += 1
-# print("amount: "+str(amt)+" bits "+str(bits));
strs = "{"
for i in range(amt):
strs += "\"#define " + x[i] + "\\n\","
@@ -658,7 +647,6 @@ def win32_spawn(sh, escape, cmd, args, env):
newargs = ' '.join(args[1:])
cmdline = cmd + " " + newargs
startupinfo = subprocess.STARTUPINFO()
- #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
for e in env:
if type(env[e]) != type(""):
env[e] = str(env[e])
@@ -998,7 +986,6 @@ def detect_visual_c_compiler_version(tools_env):
# and for VS 2017 and newer we check VCTOOLSINSTALLDIR:
if 'VCTOOLSINSTALLDIR' in tools_env:
- # print("Checking VCTOOLSINSTALLDIR")
# Newer versions have a different path available
vc_amd64_compiler_detection_index = tools_env["PATH"].upper().find(tools_env['VCTOOLSINSTALLDIR'].upper() + "BIN\\HOSTX64\\X64;")
@@ -1027,13 +1014,6 @@ def detect_visual_c_compiler_version(tools_env):
vc_chosen_compiler_index = vc_x86_amd64_compiler_detection_index
vc_chosen_compiler_str = "x86_amd64"
- # debug help
- # print(vc_amd64_compiler_detection_index)
- # print(vc_amd64_x86_compiler_detection_index)
- # print(vc_x86_compiler_detection_index)
- # print(vc_x86_amd64_compiler_detection_index)
- # print("chosen "+str(vc_chosen_compiler_index)+ " | "+str(vc_chosen_compiler_str))
-
return vc_chosen_compiler_str
def find_visual_c_batch_file(env):
@@ -1066,7 +1046,6 @@ def generate_vs_project(env, num_jobs):
'call "' + batch_file + '" !plat!']
result = " ^& ".join(common_build_prefix + [commands])
- # print("Building commandline: ", result)
return result
env.AddToVSProject(env.core_sources)
diff --git a/misc/dist/html/default.html b/misc/dist/html/default.html
index 4e3515a7b6..14766e8239 100644
--- a/misc/dist/html/default.html
+++ b/misc/dist/html/default.html
@@ -195,7 +195,7 @@ $GODOT_HEAD_INCLUDE
</head>
<body>
<div id="container">
- <canvas id="canvas" oncontextmenu="event.preventDefault();" width="640" height="480">
+ <canvas id="canvas" width="640" height="480">
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
@@ -229,7 +229,7 @@ $GODOT_HEAD_INCLUDE
(function() {
- const BASENAME = '$GODOT_BASENAME';
+ const MAIN_PACK = '$GODOT_BASENAME.pck';
const DEBUG_ENABLED = $GODOT_DEBUG_ENABLED;
const INDETERMINATE_STATUS_STEP_MS = 100;
@@ -380,7 +380,7 @@ $GODOT_HEAD_INCLUDE
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
- engine.startGame(BASENAME + '.pck').then(() => {
+ engine.startGame(MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6
index 26ebe01af7..64495d817e 100644
--- a/misc/dist/linux/godot.6
+++ b/misc/dist/linux/godot.6
@@ -128,10 +128,10 @@ Print the frames per second to the stdout.
Run a script.
.TP
\fB\-\-export\fR <target>
-Export the project using the given export target.
+Export the project using the given export target. Export only main pack if path ends with .pck or .zip.
.TP
\fB\-\-export\-debug\fR
-Use together with \fB\-\-export\fR, enables debug mode for the template.
+Like \-\-export, but use debug template.
.TP
\fB\-\-doctool\fR <path>
Dump the engine API reference to the given <path> in XML format, merging if existing files are found.
diff --git a/modules/bmp/SCsub b/modules/bmp/SCsub
new file mode 100644
index 0000000000..e7da7cf108
--- /dev/null
+++ b/modules/bmp/SCsub
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+Import('env')
+Import('env_modules')
+
+env_bmp = env_modules.Clone()
+
+# Godot's own source files
+env_bmp.add_source_files(env.modules_sources, "*.cpp")
diff --git a/modules/bmp/config.py b/modules/bmp/config.py
new file mode 100644
index 0000000000..fb920482f5
--- /dev/null
+++ b/modules/bmp/config.py
@@ -0,0 +1,7 @@
+
+def can_build(platform):
+ return True
+
+
+def configure(env):
+ pass
diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp
new file mode 100644
index 0000000000..769119a0dc
--- /dev/null
+++ b/modules/bmp/image_loader_bmp.cpp
@@ -0,0 +1,194 @@
+/*************************************************************************/
+/* image_loader_bmp.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "image_loader_bmp.h"
+
+Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image,
+ const uint8_t *p_buffer,
+ const uint8_t *p_color_buffer,
+ const bmp_header_s &p_header) {
+
+ Error err = OK;
+
+ if (p_buffer == NULL)
+ err = FAILED;
+
+ if (err == OK) {
+ size_t index = 0;
+ size_t width =
+ static_cast<size_t>(p_header.bmp_info_header.bmp_width < 0 ? -p_header.bmp_info_header.bmp_width : p_header.bmp_info_header.bmp_width);
+ size_t height =
+ static_cast<size_t>(p_header.bmp_info_header.bmp_height < 0 ? -p_header.bmp_info_header.bmp_height : p_header.bmp_info_header.bmp_height);
+ size_t bits_per_pixel =
+ static_cast<size_t>(p_header.bmp_info_header.bmp_bit_count);
+
+ if (p_header.bmp_info_header.bmp_compression != 0) {
+ err = FAILED;
+ }
+
+ if (bits_per_pixel != 24 || bits_per_pixel != 32) {
+ err = FAILED;
+ }
+
+ if (err == OK) {
+
+ uint32_t line_width = ((p_header.bmp_info_header.bmp_width *
+ p_header.bmp_info_header.bmp_bit_count / 8) +
+ 3) &
+ ~3;
+
+ PoolVector<uint8_t> image_data;
+ err = image_data.resize(width * height * 4);
+
+ PoolVector<uint8_t>::Write image_data_w = image_data.write();
+ uint8_t *write_buffer = image_data_w.ptr();
+
+ const uint8_t *line = p_buffer + (line_width * (height - 1));
+ for (unsigned int i = 0; i < height; i++) {
+ const uint8_t *line_ptr = line;
+ for (unsigned int j = 0; j < width; j++) {
+ switch (bits_per_pixel) {
+ case 24: {
+ uint32_t color = *((uint32_t *)line_ptr);
+
+ write_buffer[index + 2] = color & 0xff;
+ write_buffer[index + 1] = (color >> 8) & 0xff;
+ write_buffer[index + 0] = (color >> 16) & 0xff;
+ write_buffer[index + 3] = 0xff;
+ index += 4;
+ line_ptr += 3;
+ } break;
+ case 32: {
+ uint32_t color = *((uint32_t *)line_ptr);
+
+ write_buffer[index + 2] = color & 0xff;
+ write_buffer[index + 1] = (color >> 8) & 0xff;
+ write_buffer[index + 0] = (color >> 16) & 0xff;
+ write_buffer[index + 3] = color >> 24;
+ index += 4;
+ line_ptr += 4;
+ } break;
+ }
+ }
+ line -= line_width;
+ }
+ p_image->create(width, height, 0, Image::FORMAT_RGBA8, image_data);
+ }
+ }
+ return err;
+}
+
+Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f,
+ bool p_force_linear, float p_scale) {
+
+ bmp_header_s bmp_header;
+ Error err = ERR_INVALID_DATA;
+
+ if (f->get_len() > sizeof(bmp_header)) {
+ // File Header
+ bmp_header.bmp_file_header.bmp_signature = f->get_16();
+ if (bmp_header.bmp_file_header.bmp_signature == BITMAP_SIGNATURE) {
+ bmp_header.bmp_file_header.bmp_file_size = f->get_32();
+ bmp_header.bmp_file_header.bmp_file_padding = f->get_32();
+ bmp_header.bmp_file_header.bmp_file_offset = f->get_32();
+
+ // Info Header
+ bmp_header.bmp_info_header.bmp_header_size = f->get_32();
+ bmp_header.bmp_info_header.bmp_width = f->get_32();
+ bmp_header.bmp_info_header.bmp_height = f->get_32();
+ bmp_header.bmp_info_header.bmp_planes = f->get_16();
+ bmp_header.bmp_info_header.bmp_bit_count = f->get_16();
+ bmp_header.bmp_info_header.bmp_compression = f->get_32();
+ bmp_header.bmp_info_header.bmp_size_image = f->get_32();
+ bmp_header.bmp_info_header.bmp_pixels_per_meter_x = f->get_32();
+ bmp_header.bmp_info_header.bmp_pixels_per_meter_y = f->get_32();
+ bmp_header.bmp_info_header.bmp_colors_used = f->get_32();
+ bmp_header.bmp_info_header.bmp_important_colors = f->get_32();
+
+ bmp_header.bmp_info_header.bmp_red_mask = f->get_32();
+ bmp_header.bmp_info_header.bmp_green_mask = f->get_32();
+ bmp_header.bmp_info_header.bmp_blue_mask = f->get_32();
+ bmp_header.bmp_info_header.bmp_alpha_mask = f->get_32();
+ bmp_header.bmp_info_header.bmp_cs_type = f->get_32();
+ for (int i = 0; i < 9; i++)
+ bmp_header.bmp_info_header.bmp_endpoints[i] = f->get_32();
+
+ bmp_header.bmp_info_header.bmp_gamma_red = f->get_32();
+ bmp_header.bmp_info_header.bmp_gamma_green = f->get_32();
+ bmp_header.bmp_info_header.bmp_gamma_blue = f->get_32();
+
+ f->seek(sizeof(bmp_header.bmp_file_header) +
+ bmp_header.bmp_info_header.bmp_header_size);
+
+ uint32_t color_table_size = 0;
+ if (bmp_header.bmp_info_header.bmp_bit_count == 1)
+ color_table_size = 2;
+ else if (bmp_header.bmp_info_header.bmp_bit_count == 4)
+ color_table_size = 16;
+ else if (bmp_header.bmp_info_header.bmp_bit_count == 8)
+ color_table_size = 256;
+
+ PoolVector<uint8_t> bmp_color_table;
+ if (color_table_size > 0) {
+ err = bmp_color_table.resize(color_table_size * 4);
+ PoolVector<uint8_t>::Write bmp_color_table_w = bmp_color_table.write();
+ f->get_buffer(bmp_color_table_w.ptr(),
+ bmp_header.bmp_info_header.bmp_colors_used * 4);
+ }
+
+ f->seek(bmp_header.bmp_file_header.bmp_file_offset);
+
+ uint32_t bmp_buffer_size = (bmp_header.bmp_file_header.bmp_file_size -
+ bmp_header.bmp_file_header.bmp_file_offset);
+
+ PoolVector<uint8_t> bmp_buffer;
+ err = bmp_buffer.resize(bmp_buffer_size);
+ if (err == OK) {
+ PoolVector<uint8_t>::Write bmp_buffer_w = bmp_buffer.write();
+ f->get_buffer(bmp_buffer_w.ptr(), bmp_buffer_size);
+
+ PoolVector<uint8_t>::Read bmp_buffer_r = bmp_buffer.read();
+ PoolVector<uint8_t>::Read bmp_color_table_r = bmp_color_table.read();
+ err = convert_to_image(p_image, bmp_buffer_r.ptr(),
+ bmp_color_table_r.ptr(), bmp_header);
+ }
+ f->close();
+ }
+ }
+ return err;
+}
+
+void ImageLoaderBMP::get_recognized_extensions(
+ List<String> *p_extensions) const {
+
+ p_extensions->push_back("bmp");
+}
+
+ImageLoaderBMP::ImageLoaderBMP() {}
diff --git a/modules/bmp/image_loader_bmp.h b/modules/bmp/image_loader_bmp.h
new file mode 100644
index 0000000000..3fa7481287
--- /dev/null
+++ b/modules/bmp/image_loader_bmp.h
@@ -0,0 +1,84 @@
+/*************************************************************************/
+/* image_loader_bmp.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifndef IMAGE_LOADER_BMP_H
+#define IMAGE_LOADER_BMP_H
+
+#include "io/image_loader.h"
+
+class ImageLoaderBMP : public ImageFormatLoader {
+protected:
+ static const unsigned BITMAP_SIGNATURE = 0x4d42;
+
+ struct bmp_header_s {
+ struct bmp_file_header_s {
+ uint16_t bmp_signature;
+ uint32_t bmp_file_size;
+ uint32_t bmp_file_padding;
+ uint32_t bmp_file_offset;
+ } bmp_file_header;
+
+ struct bmp_info_header_s {
+ uint32_t bmp_header_size;
+ uint32_t bmp_width;
+ uint32_t bmp_height;
+ uint16_t bmp_planes;
+ uint16_t bmp_bit_count;
+ uint32_t bmp_compression;
+ uint32_t bmp_size_image;
+ uint32_t bmp_pixels_per_meter_x;
+ uint32_t bmp_pixels_per_meter_y;
+ uint32_t bmp_colors_used;
+ uint32_t bmp_important_colors;
+ uint32_t bmp_red_mask;
+ uint32_t bmp_green_mask;
+ uint32_t bmp_blue_mask;
+ uint32_t bmp_alpha_mask;
+ uint32_t bmp_cs_type;
+ uint32_t bmp_endpoints[9];
+ uint32_t bmp_gamma_red;
+ uint32_t bmp_gamma_green;
+ uint32_t bmp_gamma_blue;
+ } bmp_info_header;
+ };
+
+ static Error convert_to_image(Ref<Image> p_image,
+ const uint8_t *p_buffer,
+ const uint8_t *p_color_buffer,
+ const bmp_header_s &p_header);
+
+public:
+ virtual Error load_image(Ref<Image> p_image, FileAccess *f,
+ bool p_force_linear, float p_scale);
+ virtual void get_recognized_extensions(List<String> *p_extensions) const;
+ ImageLoaderBMP();
+};
+
+#endif // IMAGE_LOADER_BMP_H
diff --git a/modules/bmp/register_types.cpp b/modules/bmp/register_types.cpp
new file mode 100644
index 0000000000..1f68a03e85
--- /dev/null
+++ b/modules/bmp/register_types.cpp
@@ -0,0 +1,44 @@
+/*************************************************************************/
+/* register_types.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#include "register_types.h"
+
+#include "image_loader_bmp.h"
+
+static ImageLoaderBMP *image_loader_bmp = NULL;
+
+void register_bmp_types() {
+ image_loader_bmp = memnew(ImageLoaderBMP);
+ ImageLoader::add_image_format_loader(image_loader_bmp);
+}
+
+void unregister_bmp_types() {
+ memdelete(image_loader_bmp);
+}
diff --git a/modules/bmp/register_types.h b/modules/bmp/register_types.h
new file mode 100644
index 0000000000..d8755db397
--- /dev/null
+++ b/modules/bmp/register_types.h
@@ -0,0 +1,32 @@
+/*************************************************************************/
+/* register_types.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+void register_bmp_types();
+void unregister_bmp_types();
diff --git a/modules/bullet/generic_6dof_joint_bullet.cpp b/modules/bullet/generic_6dof_joint_bullet.cpp
index 151a79a69f..adfad7803f 100644
--- a/modules/bullet/generic_6dof_joint_bullet.cpp
+++ b/modules/bullet/generic_6dof_joint_bullet.cpp
@@ -138,6 +138,12 @@ void Generic6DOFJointBullet::set_param(Vector3::Axis p_axis, PhysicsServer::G6DO
case PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING:
sixDOFConstraint->getTranslationalLimitMotor()->m_damping = p_value;
break;
+ case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
+ sixDOFConstraint->getTranslationalLimitMotor()->m_targetVelocity.m_floats[p_axis] = p_value;
+ break;
+ case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
+ sixDOFConstraint->getTranslationalLimitMotor()->m_maxMotorForce.m_floats[p_axis] = p_value;
+ break;
case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
limits_lower[1][p_axis] = p_value;
set_flag(p_axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, flags[p_axis][p_param]); // Reload bullet parameter
@@ -185,6 +191,10 @@ real_t Generic6DOFJointBullet::get_param(Vector3::Axis p_axis, PhysicsServer::G6
return sixDOFConstraint->getTranslationalLimitMotor()->m_restitution;
case PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING:
return sixDOFConstraint->getTranslationalLimitMotor()->m_damping;
+ case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY:
+ return sixDOFConstraint->getTranslationalLimitMotor()->m_targetVelocity.m_floats[p_axis];
+ case PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT:
+ return sixDOFConstraint->getTranslationalLimitMotor()->m_maxMotorForce.m_floats[p_axis];
case PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT:
return limits_lower[1][p_axis];
case PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT:
@@ -232,6 +242,9 @@ void Generic6DOFJointBullet::set_flag(Vector3::Axis p_axis, PhysicsServer::G6DOF
case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR:
sixDOFConstraint->getRotationalLimitMotor(p_axis)->m_enableMotor = flags[p_axis][p_flag];
break;
+ case PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR:
+ sixDOFConstraint->getTranslationalLimitMotor()->m_enableMotor[p_axis] = flags[p_axis][p_flag];
+ break;
default:
WARN_PRINT("This flag is not supported by Bullet engine");
return;
diff --git a/modules/bullet/godot_result_callbacks.cpp b/modules/bullet/godot_result_callbacks.cpp
index 1bf259da84..197550d686 100644
--- a/modules/bullet/godot_result_callbacks.cpp
+++ b/modules/bullet/godot_result_callbacks.cpp
@@ -110,7 +110,7 @@ bool GodotKinClosestConvexResultCallback::needsCollision(btBroadphaseProxy *prox
if (gObj->getType() == CollisionObjectBullet::TYPE_AREA)
return false;
- if (m_self_object->has_collision_exception(gObj))
+ if (m_self_object->has_collision_exception(gObj) || gObj->has_collision_exception(m_self_object))
return false;
}
return true;
diff --git a/modules/csg/config.py b/modules/csg/config.py
index 5f133eba90..5e1d916790 100644
--- a/modules/csg/config.py
+++ b/modules/csg/config.py
@@ -3,3 +3,19 @@ def can_build(platform):
def configure(env):
pass
+
+def get_doc_classes():
+ return [
+ "CSGBox",
+ "CSGCombiner",
+ "CSGCylinder",
+ "CSGMesh",
+ "CSGPolygon",
+ "CSGPrimitive",
+ "CSGShape",
+ "CSGSphere",
+ "CSGTorus",
+ ]
+
+def get_doc_path():
+ return "doc_classes"
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index 9752defa79..c1fe11d6aa 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -1255,7 +1255,7 @@ void CSGBrushOperation::MeshMerge::add_face(const Vector3 &p_a, const Vector3 &p
vk.z = int((double(src_points[i].z) + double(vertex_snap) * 0.31234) / double(vertex_snap));
int res;
- if (snap_cache.lookup(vk, &res)) {
+ if (snap_cache.lookup(vk, res)) {
indices[i] = res;
} else {
indices[i] = points.size();
diff --git a/modules/csg/csg.h b/modules/csg/csg.h
index d89e542b5e..bb67e1fb36 100644
--- a/modules/csg/csg.h
+++ b/modules/csg/csg.h
@@ -108,7 +108,7 @@ struct CSGBrushOperation {
}
};
- OAHashMap<VertexKey, int, 64, VertexKeyHash> snap_cache;
+ OAHashMap<VertexKey, int, VertexKeyHash> snap_cache;
Vector<Vector3> points;
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 279edbcec5..22bc79ef43 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -157,7 +157,7 @@ void CSGShape::_update_shape() {
for (int j = 0; j < 3; j++) {
Vector3 v = n->faces[i].vertices[j];
Vector3 add;
- if (vec_map.lookup(v, &add)) {
+ if (vec_map.lookup(v, add)) {
add += p.normal;
} else {
add = p.normal;
@@ -233,7 +233,7 @@ void CSGShape::_update_shape() {
Vector3 normal = p.normal;
- if (n->faces[i].smooth && vec_map.lookup(v, &normal)) {
+ if (n->faces[i].smooth && vec_map.lookup(v, normal)) {
normal.normalize();
}
@@ -389,9 +389,9 @@ void CSGShape::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_collision"), "set_use_collision", "is_using_collision");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "snap", PROPERTY_HINT_RANGE, "0.0001,1,0.001"), "set_snap", "get_snap");
- BIND_CONSTANT(OPERATION_UNION);
- BIND_CONSTANT(OPERATION_INTERSECTION);
- BIND_CONSTANT(OPERATION_SUBTRACTION);
+ BIND_ENUM_CONSTANT(OPERATION_UNION);
+ BIND_ENUM_CONSTANT(OPERATION_INTERSECTION);
+ BIND_ENUM_CONSTANT(OPERATION_SUBTRACTION);
}
CSGShape::CSGShape() {
diff --git a/modules/csg/doc_classes/CSGBox.xml b/modules/csg/doc_classes/CSGBox.xml
new file mode 100644
index 0000000000..80455fda80
--- /dev/null
+++ b/modules/csg/doc_classes/CSGBox.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGBox" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="depth" type="float" setter="set_depth" getter="get_depth">
+ </member>
+ <member name="height" type="float" setter="set_height" getter="get_height">
+ </member>
+ <member name="material" type="Material" setter="set_material" getter="get_material">
+ </member>
+ <member name="width" type="float" setter="set_width" getter="get_width">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGCombiner.xml b/modules/csg/doc_classes/CSGCombiner.xml
new file mode 100644
index 0000000000..b2265d7703
--- /dev/null
+++ b/modules/csg/doc_classes/CSGCombiner.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGCombiner" inherits="CSGShape" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGCylinder.xml b/modules/csg/doc_classes/CSGCylinder.xml
new file mode 100644
index 0000000000..0cab26ad3d
--- /dev/null
+++ b/modules/csg/doc_classes/CSGCylinder.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGCylinder" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="cone" type="bool" setter="set_cone" getter="is_cone">
+ </member>
+ <member name="height" type="float" setter="set_height" getter="get_height">
+ </member>
+ <member name="material" type="Material" setter="set_material" getter="get_material">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius">
+ </member>
+ <member name="sides" type="int" setter="set_sides" getter="get_sides">
+ </member>
+ <member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGMesh.xml b/modules/csg/doc_classes/CSGMesh.xml
new file mode 100644
index 0000000000..e5c3e5ccf3
--- /dev/null
+++ b/modules/csg/doc_classes/CSGMesh.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGMesh" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGPolygon.xml b/modules/csg/doc_classes/CSGPolygon.xml
new file mode 100644
index 0000000000..379c512d6a
--- /dev/null
+++ b/modules/csg/doc_classes/CSGPolygon.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGPolygon" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="depth" type="float" setter="set_depth" getter="get_depth">
+ </member>
+ <member name="material" type="Material" setter="set_material" getter="get_material">
+ </member>
+ <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="CSGPolygon.Mode">
+ </member>
+ <member name="path_interval" type="float" setter="set_path_interval" getter="get_path_interval">
+ </member>
+ <member name="path_node" type="NodePath" setter="set_path_node" getter="get_path_node">
+ </member>
+ <member name="path_rotation" type="int" setter="set_path_rotation" getter="get_path_rotation" enum="CSGPolygon.PathRotation">
+ </member>
+ <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon">
+ </member>
+ <member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces">
+ </member>
+ <member name="spin_degrees" type="float" setter="set_spin_degrees" getter="get_spin_degrees">
+ </member>
+ <member name="spin_sides" type="int" setter="set_spin_sides" getter="get_spin_sides">
+ </member>
+ </members>
+ <constants>
+ <constant name="MODE_DEPTH" value="0" enum="Mode">
+ </constant>
+ <constant name="MODE_SPIN" value="1" enum="Mode">
+ </constant>
+ <constant name="MODE_PATH" value="2" enum="Mode">
+ </constant>
+ <constant name="PATH_ROTATION_POLYGON" value="0" enum="PathRotation">
+ </constant>
+ <constant name="PATH_ROTATION_PATH" value="1" enum="PathRotation">
+ </constant>
+ <constant name="PATH_ROTATION_PATH_FOLLOW" value="2" enum="PathRotation">
+ </constant>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGPrimitive.xml b/modules/csg/doc_classes/CSGPrimitive.xml
new file mode 100644
index 0000000000..bf41c40f22
--- /dev/null
+++ b/modules/csg/doc_classes/CSGPrimitive.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGPrimitive" inherits="CSGShape" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="invert_faces" type="bool" setter="set_invert_faces" getter="is_inverting_faces">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGShape.xml b/modules/csg/doc_classes/CSGShape.xml
new file mode 100644
index 0000000000..cf236a4207
--- /dev/null
+++ b/modules/csg/doc_classes/CSGShape.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGShape" inherits="VisualInstance" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="is_root_shape" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="operation" type="int" setter="set_operation" getter="get_operation" enum="CSGShape.Operation">
+ </member>
+ <member name="snap" type="float" setter="set_snap" getter="get_snap">
+ </member>
+ <member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision">
+ </member>
+ </members>
+ <constants>
+ <constant name="OPERATION_UNION" value="0" enum="Operation">
+ </constant>
+ <constant name="OPERATION_INTERSECTION" value="1" enum="Operation">
+ </constant>
+ <constant name="OPERATION_SUBTRACTION" value="2" enum="Operation">
+ </constant>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGSphere.xml b/modules/csg/doc_classes/CSGSphere.xml
new file mode 100644
index 0000000000..520368506e
--- /dev/null
+++ b/modules/csg/doc_classes/CSGSphere.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGSphere" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="material" type="Material" setter="set_material" getter="get_material">
+ </member>
+ <member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments">
+ </member>
+ <member name="radius" type="float" setter="set_radius" getter="get_radius">
+ </member>
+ <member name="rings" type="int" setter="set_rings" getter="get_rings">
+ </member>
+ <member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/csg/doc_classes/CSGTorus.xml b/modules/csg/doc_classes/CSGTorus.xml
new file mode 100644
index 0000000000..58bbef2600
--- /dev/null
+++ b/modules/csg/doc_classes/CSGTorus.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="CSGTorus" inherits="CSGPrimitive" category="Core" version="3.1">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ </methods>
+ <members>
+ <member name="inner_radius" type="float" setter="set_inner_radius" getter="get_inner_radius">
+ </member>
+ <member name="material" type="Material" setter="set_material" getter="get_material">
+ </member>
+ <member name="outer_radius" type="float" setter="set_outer_radius" getter="get_outer_radius">
+ </member>
+ <member name="ring_sides" type="int" setter="set_ring_sides" getter="get_ring_sides">
+ </member>
+ <member name="sides" type="int" setter="set_sides" getter="get_sides">
+ </member>
+ <member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces">
+ </member>
+ </members>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
index 7bee63019b..d5fd4bff09 100644
--- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
+++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml
@@ -16,6 +16,8 @@
<method name="close_connection">
<return type="void">
</return>
+ <argument index="0" name="wait_usec" type="int" default="100">
+ </argument>
<description>
Closes the connection. Ignored if no connection is currently established. If this is a server it tries to notify all clients before forcibly disconnecting them. If this is a client it simply closes the connection to the server.
</description>
@@ -23,7 +25,7 @@
<method name="create_client">
<return type="int" enum="Error">
</return>
- <argument index="0" name="ip" type="String">
+ <argument index="0" name="address" type="String">
</argument>
<argument index="1" name="port" type="int">
</argument>
@@ -31,8 +33,10 @@
</argument>
<argument index="3" name="out_bandwidth" type="int" default="0">
</argument>
+ <argument index="4" name="client_port" type="int" default="0">
+ </argument>
<description>
- Create client that connects to a server at address [code]ip[/code] using specified [code]port[/code]. The given IP needs to be in IPv4 or IPv6 address format, for example: [code]192.168.1.1[/code]. The [code]port[/code] is the port the server is listening on. The [code]in_bandwidth[/code] and [code]out_bandwidth[/code] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [code]OK[/code] if a client was created, [code]ERR_ALREADY_IN_USE[/code] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [code]ERR_CANT_CREATE[/code] if the client could not be created.
+ Create client that connects to a server at [code]address[/code] using specified [code]port[/code]. The given address needs to be either a fully qualified domain nome (e.g. [code]www.example.com[/code]) or an IP address in IPv4 or IPv6 format (e.g. [code]192.168.1.1[/code]). The [code]port[/code] is the port the server is listening on. The [code]in_bandwidth[/code] and [code]out_bandwidth[/code] parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns [code]OK[/code] if a client was created, [code]ERR_ALREADY_IN_USE[/code] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [code]ERR_CANT_CREATE[/code] if the client could not be created. If [code]client_port[/code] is specified, the client will also listen to the given port, this is useful in some NAT traveral technique.
</description>
</method>
<method name="create_server">
@@ -50,6 +54,49 @@
Create server that listens to connections via [code]port[/code]. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use [method set_bind_ip]. The default IP is the wildcard [code]*[/code], which listens on all available interfaces. [code]max_clients[/code] is the maximum number of clients that are allowed at once, any number up to 4096 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see [method create_client]. Returns [code]OK[/code] if a server was created, [code]ERR_ALREADY_IN_USE[/code] if this NetworkedMultiplayerEnet instance already has an open connection (in which case you need to call [method close_connection] first) or [code]ERR_CANT_CREATE[/code] if the server could not be created.
</description>
</method>
+ <method name="disconnect_peer">
+ <return type="void">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="now" type="bool" default="false">
+ </argument>
+ <description>
+ Disconnect the given peer. If "now" is set to true, the connection will be closed immediately without flushing queued messages.
+ </description>
+ </method>
+ <method name="get_last_packet_channel" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the channel of the last packet fetched via [method PacketPeer.get_packet]
+ </description>
+ </method>
+ <method name="get_packet_channel" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the channel of the next packet that will be retrieved via [method PacketPeer.get_packet_peer]
+ </description>
+ </method>
+ <method name="get_peer_address" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns the IP address of the given peer.
+ </description>
+ </method>
+ <method name="get_peer_port" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns the remote port of the given peer.
+ </description>
+ </method>
<method name="set_bind_ip">
<return type="void">
</return>
@@ -61,9 +108,18 @@
</method>
</methods>
<members>
+ <member name="always_ordered" type="bool" setter="set_always_ordered" getter="is_always_ordered">
+ Always use [code]TRANSFER_MODE_ORDERED[/code] in place of [code]TRANSFER_MODE_UNRELIABLE[/code]. This is the only way to use ordering with the RPC system.
+ </member>
+ <member name="channel_count" type="int" setter="set_channel_count" getter="get_channel_count">
+ The number of channels to be used by ENet. Default: [code]3[/code]. Channels are used to separate different kinds of data. In realiable or ordered mode, for example, the packet delivery order is ensured on a per channel basis.
+ </member>
<member name="compression_mode" type="int" setter="set_compression_mode" getter="get_compression_mode" enum="NetworkedMultiplayerENet.CompressionMode">
The compression method used for network packets. Default is no compression. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all.
</member>
+ <member name="transfer_channel" type="int" setter="set_transfer_channel" getter="get_transfer_channel">
+ Set the default channel to be used to transfer data. By default this value is [code]-1[/code] which means that ENet will only use 2 channels, one for reliable and one for unreliable packets. Channel [code]0[/code] is reserved, and cannot be used. Setting this member to any value between [code]0[/code] and [member channel_count] (excluded) will force ENet to use that channel for sending data.
+ </member>
</members>
<constants>
<constant name="COMPRESS_NONE" value="0" enum="CompressionMode">
diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index 95bb472c7b..88768829d7 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -55,9 +55,29 @@ int NetworkedMultiplayerENet::get_packet_peer() const {
return incoming_packets.front()->get().from;
}
+int NetworkedMultiplayerENet::get_packet_channel() const {
+
+ ERR_FAIL_COND_V(!active, -1);
+ ERR_FAIL_COND_V(incoming_packets.size() == 0, -1);
+
+ return incoming_packets.front()->get().channel;
+}
+
+int NetworkedMultiplayerENet::get_last_packet_channel() const {
+
+ ERR_FAIL_COND_V(!active, -1);
+ ERR_FAIL_COND_V(!current_packet.packet, -1);
+
+ return current_packet.channel;
+}
+
Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int p_in_bandwidth, int p_out_bandwidth) {
ERR_FAIL_COND_V(active, ERR_ALREADY_IN_USE);
+ ERR_FAIL_COND_V(p_port < 0 || p_port > 65535, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_max_clients < 0, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_in_bandwidth < 0, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_out_bandwidth < 0, ERR_INVALID_PARAMETER);
ENetAddress address;
@@ -79,9 +99,9 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int
host = enet_host_create(&address /* the address to bind the server host to */,
p_max_clients /* allow up to 32 clients and/or outgoing connections */,
- SYSCH_MAX /* allow up to SYSCH_MAX channels to be used */,
- p_in_bandwidth /* assume any amount of incoming bandwidth */,
- p_out_bandwidth /* assume any amount of outgoing bandwidth */);
+ channel_count /* allow up to channel_count to be used */,
+ p_in_bandwidth /* limit incoming bandwith if > 0 */,
+ p_out_bandwidth /* limit outgoing bandwith if > 0 */);
ERR_FAIL_COND_V(!host, ERR_CANT_CREATE);
@@ -93,15 +113,46 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int
connection_status = CONNECTION_CONNECTED;
return OK;
}
-Error NetworkedMultiplayerENet::create_client(const String &p_address, int p_port, int p_in_bandwidth, int p_out_bandwidth) {
+Error NetworkedMultiplayerENet::create_client(const String &p_address, int p_port, int p_in_bandwidth, int p_out_bandwidth, int p_client_port) {
ERR_FAIL_COND_V(active, ERR_ALREADY_IN_USE);
+ ERR_FAIL_COND_V(p_port < 0 || p_port > 65535, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_client_port < 0 || p_client_port > 65535, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_in_bandwidth < 0, ERR_INVALID_PARAMETER);
+ ERR_FAIL_COND_V(p_out_bandwidth < 0, ERR_INVALID_PARAMETER);
- host = enet_host_create(NULL /* create a client host */,
- 1 /* only allow 1 outgoing connection */,
- SYSCH_MAX /* allow up to SYSCH_MAX channels to be used */,
- p_in_bandwidth /* limit incoming bandwith if > 0 */,
- p_out_bandwidth /* limit outgoing bandwith if > 0 */);
+ if (p_client_port != 0) {
+ ENetAddress c_client;
+
+#ifdef GODOT_ENET
+ if (bind_ip.is_wildcard()) {
+ c_client.wildcard = 1;
+ } else {
+ enet_address_set_ip(&c_client, bind_ip.get_ipv6(), 16);
+ }
+#else
+ if (bind_ip.is_wildcard()) {
+ c_client.host = 0;
+ } else {
+ ERR_FAIL_COND_V(!bind_ip.is_ipv4(), ERR_INVALID_PARAMETER);
+ c_client.host = *(uint32_t *)bind_ip.get_ipv4();
+ }
+#endif
+
+ c_client.port = p_client_port;
+
+ host = enet_host_create(&c_client /* create a client host */,
+ 1 /* only allow 1 outgoing connection */,
+ channel_count /* allow up to channel_count to be used */,
+ p_in_bandwidth /* limit incoming bandwith if > 0 */,
+ p_out_bandwidth /* limit outgoing bandwith if > 0 */);
+ } else {
+ host = enet_host_create(NULL /* create a client host */,
+ 1 /* only allow 1 outgoing connection */,
+ channel_count /* allow up to channel_count to be used */,
+ p_in_bandwidth /* limit incoming bandwith if > 0 */,
+ p_out_bandwidth /* limit outgoing bandwith if > 0 */);
+ }
ERR_FAIL_COND_V(!host, ERR_CANT_CREATE);
@@ -131,8 +182,8 @@ Error NetworkedMultiplayerENet::create_client(const String &p_address, int p_por
unique_id = _gen_unique_id();
- /* Initiate the connection, allocating the enough channels */
- ENetPeer *peer = enet_host_connect(host, &address, SYSCH_MAX, unique_id);
+ // Initiate connection, allocating enough channels
+ ENetPeer *peer = enet_host_connect(host, &address, channel_count, unique_id);
if (peer == NULL) {
enet_host_destroy(host);
@@ -173,7 +224,7 @@ void NetworkedMultiplayerENet::poll() {
switch (event.type) {
case ENET_EVENT_TYPE_CONNECT: {
- /* Store any relevant client information here. */
+ // Store any relevant client information here.
if (server && refuse_connections) {
enet_peer_reset(event.peer);
@@ -183,7 +234,7 @@ void NetworkedMultiplayerENet::poll() {
int *new_id = memnew(int);
*new_id = event.data;
- if (*new_id == 0) { // Data zero is sent by server (enet won't let you configure this). Server is always 1
+ if (*new_id == 0) { // Data zero is sent by server (enet won't let you configure this). Server is always 1.
*new_id = 1;
}
@@ -220,7 +271,7 @@ void NetworkedMultiplayerENet::poll() {
} break;
case ENET_EVENT_TYPE_DISCONNECT: {
- /* Reset the peer's client information. */
+ // Reset the peer's client information.
int *id = (int *)event.peer->data;
@@ -281,7 +332,7 @@ void NetworkedMultiplayerENet::poll() {
}
enet_packet_destroy(event.packet);
- } else if (event.channelID < SYSCH_MAX) {
+ } else if (event.channelID < channel_count) {
Packet packet;
packet.packet = event.packet;
@@ -295,6 +346,7 @@ void NetworkedMultiplayerENet::poll() {
uint32_t flags = decode_uint32(&event.packet->data[8]);
packet.from = source;
+ packet.channel = event.channelID;
if (server) {
// Someone is cheating and trying to fake the source!
@@ -352,7 +404,7 @@ void NetworkedMultiplayerENet::poll() {
incoming_packets.push_back(packet);
}
- // Destroy packet later..
+ // Destroy packet later
} else {
ERR_CONTINUE(true);
}
@@ -371,10 +423,10 @@ bool NetworkedMultiplayerENet::is_server() const {
return server;
}
-void NetworkedMultiplayerENet::close_connection() {
+void NetworkedMultiplayerENet::close_connection(uint32_t wait_usec) {
- if (!active)
- return;
+ ERR_FAIL_COND(!active);
+ ERR_FAIL_COND(wait_usec < 0);
_pop_current_packet();
@@ -388,7 +440,10 @@ void NetworkedMultiplayerENet::close_connection() {
if (peers_disconnected) {
enet_host_flush(host);
- OS::get_singleton()->delay_usec(100); // Wait 100ms for disconnection packets to send
+
+ if (wait_usec > 0) {
+ OS::get_singleton()->delay_usec(wait_usec); // Wait for disconnection packets to send
+ }
}
enet_host_destroy(host);
@@ -432,6 +487,7 @@ int NetworkedMultiplayerENet::get_available_packet_count() const {
return incoming_packets.size();
}
+
Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
ERR_FAIL_COND_V(incoming_packets.size() == 0, ERR_UNAVAILABLE);
@@ -446,6 +502,7 @@ Error NetworkedMultiplayerENet::get_packet(const uint8_t **r_buffer, int &r_buff
return OK;
}
+
Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
ERR_FAIL_COND_V(!active, ERR_UNCONFIGURED);
@@ -456,7 +513,10 @@ Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer
switch (transfer_mode) {
case TRANSFER_MODE_UNRELIABLE: {
- packet_flags = ENET_PACKET_FLAG_UNSEQUENCED;
+ if (always_ordered)
+ packet_flags = 0;
+ else
+ packet_flags = ENET_PACKET_FLAG_UNSEQUENCED;
channel = SYSCH_UNRELIABLE;
} break;
case TRANSFER_MODE_UNRELIABLE_ORDERED: {
@@ -469,6 +529,9 @@ Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer
} break;
}
+ if (transfer_channel > SYSCH_CONFIG)
+ channel = transfer_channel;
+
Map<int, ENetPeer *>::Element *E = NULL;
if (target_peer != 0) {
@@ -513,7 +576,7 @@ Error NetworkedMultiplayerENet::put_packet(const uint8_t *p_buffer, int p_buffer
} else {
ERR_FAIL_COND_V(!peer_map.has(1), ERR_BUG);
- enet_peer_send(peer_map[1], channel, packet); // Send to server for broadcast..
+ enet_peer_send(peer_map[1], channel, packet); // Send to server for broadcast
}
enet_host_flush(host);
@@ -532,6 +595,7 @@ void NetworkedMultiplayerENet::_pop_current_packet() {
enet_packet_destroy(current_packet.packet);
current_packet.packet = NULL;
current_packet.from = 0;
+ current_packet.channel = -1;
}
}
@@ -719,19 +783,65 @@ int NetworkedMultiplayerENet::get_peer_port(int p_peer_id) const {
#endif
}
+void NetworkedMultiplayerENet::set_transfer_channel(int p_channel) {
+
+ ERR_FAIL_COND(p_channel < -1 || p_channel >= channel_count);
+
+ if (p_channel == SYSCH_CONFIG) {
+ ERR_EXPLAIN("Channel " + itos(SYSCH_CONFIG) + " is reserved");
+ ERR_FAIL();
+ }
+ transfer_channel = p_channel;
+}
+
+int NetworkedMultiplayerENet::get_transfer_channel() const {
+ return transfer_channel;
+}
+
+void NetworkedMultiplayerENet::set_channel_count(int p_channel) {
+
+ ERR_FAIL_COND(active);
+ ERR_FAIL_COND(p_channel < SYSCH_MAX);
+ channel_count = p_channel;
+}
+
+int NetworkedMultiplayerENet::get_channel_count() const {
+ return channel_count;
+}
+
+void NetworkedMultiplayerENet::set_always_ordered(bool p_ordered) {
+ always_ordered = p_ordered;
+}
+
+bool NetworkedMultiplayerENet::is_always_ordered() const {
+ return always_ordered;
+}
+
void NetworkedMultiplayerENet::_bind_methods() {
ClassDB::bind_method(D_METHOD("create_server", "port", "max_clients", "in_bandwidth", "out_bandwidth"), &NetworkedMultiplayerENet::create_server, DEFVAL(32), DEFVAL(0), DEFVAL(0));
- ClassDB::bind_method(D_METHOD("create_client", "address", "port", "in_bandwidth", "out_bandwidth"), &NetworkedMultiplayerENet::create_client, DEFVAL(0), DEFVAL(0));
- ClassDB::bind_method(D_METHOD("close_connection"), &NetworkedMultiplayerENet::close_connection);
+ ClassDB::bind_method(D_METHOD("create_client", "address", "port", "in_bandwidth", "out_bandwidth", "client_port"), &NetworkedMultiplayerENet::create_client, DEFVAL(0), DEFVAL(0), DEFVAL(0));
+ ClassDB::bind_method(D_METHOD("close_connection", "wait_usec"), &NetworkedMultiplayerENet::close_connection, DEFVAL(100));
ClassDB::bind_method(D_METHOD("disconnect_peer", "id", "now"), &NetworkedMultiplayerENet::disconnect_peer, DEFVAL(false));
ClassDB::bind_method(D_METHOD("set_compression_mode", "mode"), &NetworkedMultiplayerENet::set_compression_mode);
ClassDB::bind_method(D_METHOD("get_compression_mode"), &NetworkedMultiplayerENet::get_compression_mode);
ClassDB::bind_method(D_METHOD("set_bind_ip", "ip"), &NetworkedMultiplayerENet::set_bind_ip);
- ClassDB::bind_method(D_METHOD("get_peer_address"), &NetworkedMultiplayerENet::get_peer_address);
- ClassDB::bind_method(D_METHOD("get_peer_port"), &NetworkedMultiplayerENet::get_peer_port);
+ ClassDB::bind_method(D_METHOD("get_peer_address", "id"), &NetworkedMultiplayerENet::get_peer_address);
+ ClassDB::bind_method(D_METHOD("get_peer_port", "id"), &NetworkedMultiplayerENet::get_peer_port);
+
+ ClassDB::bind_method(D_METHOD("get_packet_channel"), &NetworkedMultiplayerENet::get_packet_channel);
+ ClassDB::bind_method(D_METHOD("get_last_packet_channel"), &NetworkedMultiplayerENet::get_last_packet_channel);
+ ClassDB::bind_method(D_METHOD("set_transfer_channel", "channel"), &NetworkedMultiplayerENet::set_transfer_channel);
+ ClassDB::bind_method(D_METHOD("get_transfer_channel"), &NetworkedMultiplayerENet::get_transfer_channel);
+ ClassDB::bind_method(D_METHOD("set_channel_count", "channels"), &NetworkedMultiplayerENet::set_channel_count);
+ ClassDB::bind_method(D_METHOD("get_channel_count"), &NetworkedMultiplayerENet::get_channel_count);
+ ClassDB::bind_method(D_METHOD("set_always_ordered", "ordered"), &NetworkedMultiplayerENet::set_always_ordered);
+ ClassDB::bind_method(D_METHOD("is_always_ordered"), &NetworkedMultiplayerENet::is_always_ordered);
ADD_PROPERTY(PropertyInfo(Variant::INT, "compression_mode", PROPERTY_HINT_ENUM, "None,Range Coder,FastLZ,ZLib,ZStd"), "set_compression_mode", "get_compression_mode");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "transfer_channel"), "set_transfer_channel", "get_transfer_channel");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "channel_count"), "set_channel_count", "get_channel_count");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "always_ordered"), "set_always_ordered", "is_always_ordered");
BIND_ENUM_CONSTANT(COMPRESS_NONE);
BIND_ENUM_CONSTANT(COMPRESS_RANGE_CODER);
@@ -749,6 +859,9 @@ NetworkedMultiplayerENet::NetworkedMultiplayerENet() {
target_peer = 0;
current_packet.packet = NULL;
transfer_mode = TRANSFER_MODE_RELIABLE;
+ channel_count = SYSCH_MAX;
+ transfer_channel = -1;
+ always_ordered = false;
connection_status = CONNECTION_DISCONNECTED;
compression_mode = COMPRESS_NONE;
enet_compressor.context = this;
@@ -764,7 +877,7 @@ NetworkedMultiplayerENet::~NetworkedMultiplayerENet() {
close_connection();
}
-// Sets IP for ENet to bind when using create_server
+// Sets IP for ENet to bind when using create_server or create_client
// if no IP is set, then ENet bind to ENET_HOST_ANY
void NetworkedMultiplayerENet::set_bind_ip(const IP_Address &p_ip) {
ERR_FAIL_COND(!p_ip.is_valid() && !p_ip.is_wildcard());
diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h
index 678ae24135..705807d429 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -68,6 +68,9 @@ private:
int target_peer;
TransferMode transfer_mode;
+ int transfer_channel;
+ int channel_count;
+ bool always_ordered;
ENetEvent event;
ENetPeer *peer;
@@ -83,6 +86,7 @@ private:
ENetPacket *packet;
int from;
+ int channel;
};
CompressionMode compression_mode;
@@ -119,9 +123,9 @@ public:
virtual int get_peer_port(int p_peer_id) const;
Error create_server(int p_port, int p_max_clients = 32, int p_in_bandwidth = 0, int p_out_bandwidth = 0);
- Error create_client(const String &p_address, int p_port, int p_in_bandwidth = 0, int p_out_bandwidth = 0);
+ Error create_client(const String &p_address, int p_port, int p_in_bandwidth = 0, int p_out_bandwidth = 0, int p_client_port = 0);
- void close_connection();
+ void close_connection(uint32_t wait_usec = 100);
void disconnect_peer(int p_peer, bool now = false);
@@ -145,6 +149,15 @@ public:
void set_compression_mode(CompressionMode p_mode);
CompressionMode get_compression_mode() const;
+ int get_packet_channel() const;
+ int get_last_packet_channel() const;
+ void set_transfer_channel(int p_channel);
+ int get_transfer_channel() const;
+ void set_channel_count(int p_channel);
+ int get_channel_count() const;
+ void set_always_ordered(bool p_ordered);
+ bool is_always_ordered() const;
+
NetworkedMultiplayerENet();
~NetworkedMultiplayerENet();
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 8a7c2a773a..301f218361 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -17,18 +17,15 @@ if env['builtin_freetype']:
"src/base/ftbitmap.c",
"src/base/ftcid.c",
"src/base/ftdebug.c",
- "src/base/ftfntfmt.c",
"src/base/ftfstype.c",
"src/base/ftgasp.c",
"src/base/ftglyph.c",
"src/base/ftgxval.c",
"src/base/ftinit.c",
- "src/base/ftlcdfil.c",
"src/base/ftmm.c",
"src/base/ftotval.c",
"src/base/ftpatent.c",
"src/base/ftpfr.c",
- "src/base/ftpic.c",
"src/base/ftstroke.c",
"src/base/ftsynth.c",
"src/base/ftsystem.c",
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
index 8654ef3d82..6d2f8ce8ad 100644
--- a/modules/gdnative/SCsub
+++ b/modules/gdnative/SCsub
@@ -23,7 +23,8 @@ def _build_gdnative_api_struct_header(api):
'\textern const godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct;'
]
- for name in api['extensions']:
+ for ext in api['extensions']:
+ name = ext['name']
gdnative_api_init_macro.append(
'\textern const godot_gdnative_ext_{0}_api_struct *_gdnative_wrapper_{0}_api_struct;'.format(name))
@@ -31,9 +32,10 @@ def _build_gdnative_api_struct_header(api):
gdnative_api_init_macro.append('\tfor (unsigned int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { ')
gdnative_api_init_macro.append('\t\tswitch (_gdnative_wrapper_api_struct->extensions[i]->type) {')
- for name in api['extensions']:
+ for ext in api['extensions']:
+ name = ext['name']
gdnative_api_init_macro.append(
- '\t\t\tcase GDNATIVE_EXT_%s:' % api['extensions'][name]['type'])
+ '\t\t\tcase GDNATIVE_EXT_%s:' % ext['type'])
gdnative_api_init_macro.append(
'\t\t\t\t_gdnative_wrapper_{0}_api_struct = (godot_gdnative_ext_{0}_api_struct *)'
' _gdnative_wrapper_api_struct->extensions[i];'.format(name))
@@ -61,8 +63,8 @@ def _build_gdnative_api_struct_header(api):
'\tGDNATIVE_' + api['core']['type'] + ','
]
- for name in api['extensions']:
- out += ['\tGDNATIVE_EXT_' + api['extensions'][name]['type'] + ',']
+ for ext in api['extensions']:
+ out += ['\tGDNATIVE_EXT_' + ext['type'] + ',']
out += ['};', '']
@@ -88,8 +90,9 @@ def _build_gdnative_api_struct_header(api):
return ret_val
- for name in api['extensions']:
- out += generate_extension_struct(name, api['extensions'][name], False)
+ for ext in api['extensions']:
+ name = ext['name']
+ out += generate_extension_struct(name, ext, False)
out += [
'typedef struct godot_gdnative_core_api_struct {',
@@ -151,12 +154,14 @@ def _build_gdnative_api_struct_source(api):
return ret_val
- for name in api['extensions']:
- out += get_extension_struct_definition(name, api['extensions'][name], False)
+ for ext in api['extensions']:
+ name = ext['name']
+ out += get_extension_struct_definition(name, ext, False)
out += ['', 'const godot_gdnative_api_struct *gdnative_extensions_pointers[] = {']
- for name in api['extensions']:
+ for ext in api['extensions']:
+ name = ext['name']
out += ['\t(godot_gdnative_api_struct *)&api_extension_' + name + '_struct,']
out += ['};\n']
@@ -214,7 +219,8 @@ def _build_gdnative_wrapper_code(api):
'godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct = 0;',
]
- for name in api['extensions']:
+ for ext in api['extensions']:
+ name = ext['name']
out.append('godot_gdnative_ext_' + name + '_api_struct *_gdnative_wrapper_' + name + '_api_struct = 0;')
out += ['']
@@ -232,8 +238,9 @@ def _build_gdnative_wrapper_code(api):
out.append('}')
out.append('')
- for name in api['extensions']:
- for funcdef in api['extensions'][name]['api']:
+ for ext in api['extensions']:
+ name = ext['name']
+ for funcdef in ext['api']:
args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']])
out.append('%s%s(%s) {' % (_spaced(funcdef['return_type']), funcdef['name'], args))
@@ -267,7 +274,7 @@ def build_gdnative_wrapper_code(target, source, env):
if ARGUMENTS.get('gdnative_wrapper', False):
- #build wrapper code
+#build wrapper code
gensource, = gdn_env.Command('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', build_gdnative_wrapper_code)
gd_wrapper_env = env.Clone()
diff --git a/modules/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 897588385a..e7ebcc73af 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -469,7 +469,9 @@ Variant GDNative::call_native(StringName p_native_call_type, StringName p_proced
godot_variant result = E->get()(procedure_handle, (godot_array *)&p_arguments);
- return *(Variant *)&result;
+ Variant res = *(Variant *)&result;
+ godot_variant_destroy(&result);
+ return res;
}
Error GDNative::get_symbol(StringName p_procedure_name, void *&r_handle, bool p_optional) {
diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json
index f41c3859bd..9fcf61af8a 100644
--- a/modules/gdnative/gdnative_api.json
+++ b/modules/gdnative/gdnative_api.json
@@ -5756,8 +5756,9 @@
}
]
},
- "extensions": {
- "nativescript": {
+ "extensions": [
+ {
+ "name": "nativescript",
"type": "NATIVESCRIPT",
"version": {
"major": 1,
@@ -5942,7 +5943,8 @@
}
]
},
- "pluginscript": {
+ {
+ "name": "pluginscript",
"type": "PLUGINSCRIPT",
"version": {
"major": 1,
@@ -5959,7 +5961,8 @@
}
]
},
- "arvr": {
+ {
+ "name": "arvr",
"type": "ARVR",
"version": {
"major": 1,
@@ -6055,5 +6058,5 @@
}
]
}
- }
+ ]
}
diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub
index 13870170a5..73f09f1659 100644
--- a/modules/gdscript/SCsub
+++ b/modules/gdscript/SCsub
@@ -7,4 +7,7 @@ env_gdscript = env_modules.Clone()
env_gdscript.add_source_files(env.modules_sources, "*.cpp")
+if env['tools']:
+ env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp")
+
Export('env')
diff --git a/modules/gdscript/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index 4e89851bf2..ea3efff9cf 100644
--- a/modules/gdscript/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -29,6 +29,8 @@
/*************************************************************************/
#include "gdscript_highlighter.h"
+#include "../gdscript_tokenizer.h"
+#include "editor/editor_settings.h"
#include "scene/gui/text_edit.h"
inline bool _is_symbol(CharType c) {
@@ -61,12 +63,20 @@ static bool _is_hex_symbol(CharType c) {
Map<int, TextEdit::HighlighterInfo> GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line) {
Map<int, TextEdit::HighlighterInfo> color_map;
+ Type next_type = NONE;
+ Type current_type = NONE;
+ Type previous_type = NONE;
+
+ String previous_text = "";
+ int previous_column = 0;
+
bool prev_is_char = false;
bool prev_is_number = false;
bool in_keyword = false;
bool in_word = false;
bool in_function_name = false;
bool in_member_variable = false;
+ bool in_node_path = false;
bool is_hex_notation = false;
Color keyword_color;
Color color;
@@ -214,18 +224,64 @@ Map<int, TextEdit::HighlighterInfo> GDScriptSyntaxHighlighter::_get_line_syntax_
in_member_variable = false;
}
- if (in_region >= 0)
+ if (!in_node_path && in_region == -1 && str[j] == '$') {
+ in_node_path = true;
+ } else if (in_region != -1 || (is_symbol && str[j] != '/')) {
+ in_node_path = false;
+ }
+
+ if (in_region >= 0) {
+ next_type = REGION;
color = text_editor->_get_color_region(in_region).color;
- else if (in_keyword)
+ } else if (in_node_path) {
+ next_type = NODE_PATH;
+ color = node_path_color;
+ } else if (in_keyword) {
+ next_type = KEYWORD;
color = keyword_color;
- else if (in_member_variable)
+ } else if (in_member_variable) {
+ next_type = MEMBER;
color = member_color;
- else if (in_function_name)
- color = function_color;
- else if (is_symbol)
+ } else if (in_function_name) {
+ next_type = FUNCTION;
+
+ if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::TK_PR_FUNCTION)) {
+ color = function_definition_color;
+ } else {
+ color = function_color;
+ }
+ } else if (is_symbol) {
+ next_type = SYMBOL;
color = symbol_color;
- else if (is_number)
+ } else if (is_number) {
+ next_type = NUMBER;
color = number_color;
+ } else {
+ next_type = IDENTIFIER;
+ }
+
+ if (next_type != current_type) {
+ if (current_type == NONE) {
+ current_type = next_type;
+ } else {
+ previous_type = current_type;
+ current_type = next_type;
+
+ // no need to store regions...
+ if (previous_type == REGION) {
+ previous_text = "";
+ previous_column = j;
+ } else {
+ String text = str.substr(previous_column, j - previous_column).strip_edges();
+ previous_column = j;
+
+ // ignore if just whitespace
+ if (text != "") {
+ previous_text = text;
+ }
+ }
+ }
+ }
prev_is_char = is_char;
prev_is_number = is_number;
@@ -255,6 +311,9 @@ void GDScriptSyntaxHighlighter::_update_cache() {
function_color = text_editor->get_color("function_color");
number_color = text_editor->get_color("number_color");
member_color = text_editor->get_color("member_variable_color");
+
+ function_definition_color = EDITOR_DEF("text_editor/highlighting/gdscript/function_definition_color", Color::html("#01e1ff"));
+ node_path_color = EDITOR_DEF("text_editor/highlighting/gdscript/node_path_color", Color::html("#64c15a"));
}
SyntaxHighlighter *GDScriptSyntaxHighlighter::create() {
diff --git a/modules/gdscript/gdscript_highlighter.h b/modules/gdscript/editor/gdscript_highlighter.h
index ef1bdd4103..0296ab7652 100644
--- a/modules/gdscript/gdscript_highlighter.h
+++ b/modules/gdscript/editor/gdscript_highlighter.h
@@ -35,13 +35,27 @@
class GDScriptSyntaxHighlighter : public SyntaxHighlighter {
private:
+ enum Type {
+ NONE,
+ REGION,
+ NODE_PATH,
+ SYMBOL,
+ NUMBER,
+ FUNCTION,
+ KEYWORD,
+ MEMBER,
+ IDENTIFIER
+ };
+
// colours
Color font_color;
Color symbol_color;
Color function_color;
+ Color function_definition_color;
Color built_in_type_color;
Color number_color;
Color member_color;
+ Color node_path_color;
public:
static SyntaxHighlighter *create();
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 4e3ee4d22c..14bdce50ec 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1333,6 +1333,15 @@ void GDScriptLanguage::add_global_constant(const StringName &p_variable, const V
_add_global(p_variable, p_value);
}
+void GDScriptLanguage::add_named_global_constant(const StringName &p_name, const Variant &p_value) {
+ named_globals[p_name] = p_value;
+}
+
+void GDScriptLanguage::remove_named_global_constant(const StringName &p_name) {
+ ERR_FAIL_COND(!named_globals.has(p_name));
+ named_globals.erase(p_name);
+}
+
void GDScriptLanguage::init() {
//populate global constants
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h
index 9566e3b32e..6885fbb7fe 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -262,6 +262,7 @@ class GDScriptLanguage : public ScriptLanguage {
Variant *_global_array;
Vector<Variant> global_array;
Map<StringName, int> globals;
+ Map<StringName, Variant> named_globals;
struct CallLevel {
@@ -369,7 +370,8 @@ public:
_FORCE_INLINE_ int get_global_array_size() const { return global_array.size(); }
_FORCE_INLINE_ Variant *get_global_array() { return _global_array; }
- _FORCE_INLINE_ const Map<StringName, int> &get_global_map() { return globals; }
+ _FORCE_INLINE_ const Map<StringName, int> &get_global_map() const { return globals; }
+ _FORCE_INLINE_ const Map<StringName, Variant> &get_named_globals_map() const { return named_globals; }
_FORCE_INLINE_ static GDScriptLanguage *get_singleton() { return singleton; }
@@ -403,6 +405,8 @@ public:
virtual String _get_indentation() const;
virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const;
virtual void add_global_constant(const StringName &p_variable, const Variant &p_value);
+ virtual void add_named_global_constant(const StringName &p_name, const Variant &p_value);
+ virtual void remove_named_global_constant(const StringName &p_name);
/* DEBUGGER FUNCTIONS */
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 048948dada..9947512444 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -278,6 +278,18 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
return idx | (GDScriptFunction::ADDR_TYPE_GLOBAL << GDScriptFunction::ADDR_BITS); //argument (stack root)
}
+#ifdef TOOLS_ENABLED
+ if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(identifier)) {
+
+ int idx = codegen.named_globals.find(identifier);
+ if (idx == -1) {
+ idx = codegen.named_globals.size();
+ codegen.named_globals.push_back(identifier);
+ }
+ return idx | (GDScriptFunction::ADDR_TYPE_NAMED_GLOBAL << GDScriptFunction::ADDR_BITS);
+ }
+#endif
+
//not found, error
_set_error("Identifier not found: " + String(identifier), p_expression);
@@ -1511,6 +1523,18 @@ Error GDScriptCompiler::_parse_function(GDScript *p_script, const GDScriptParser
gdfunc->_global_names_count = 0;
}
+#ifdef TOOLS_ENABLED
+ // Named globals
+ if (codegen.named_globals.size()) {
+ gdfunc->named_globals.resize(codegen.named_globals.size());
+ gdfunc->_named_globals_ptr = gdfunc->named_globals.ptr();
+ for (int i = 0; i < codegen.named_globals.size(); i++) {
+ gdfunc->named_globals[i] = codegen.named_globals[i];
+ }
+ gdfunc->_named_globals_count = gdfunc->named_globals.size();
+ }
+#endif
+
if (codegen.opcodes.size()) {
gdfunc->code = codegen.opcodes;
diff --git a/modules/gdscript/gdscript_compiler.h b/modules/gdscript/gdscript_compiler.h
index 62aafdbe01..237b0de9e7 100644
--- a/modules/gdscript/gdscript_compiler.h
+++ b/modules/gdscript/gdscript_compiler.h
@@ -94,6 +94,9 @@ class GDScriptCompiler {
HashMap<Variant, int, VariantHasher, VariantComparator> constant_map;
Map<StringName, int> name_map;
+#ifdef TOOLS_ENABLED
+ Vector<StringName> named_globals;
+#endif
int get_name_map_pos(const StringName &p_identifier) {
int ret;
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index b38b30d4b8..87e1276492 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -61,7 +61,7 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str
"# var b = \"textvar\"\n\n" +
"func _ready():\n" +
"%TS%# Called when the node is added to the scene for the first time.\n" +
- "%TS%# Initialization here\n" +
+ "%TS%# Initialization here.\n" +
"%TS%pass\n\n" +
"#func _process(delta):\n" +
"#%TS%# Called every frame. Delta is time since last frame.\n" +
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 1c5b8187ca..dac7da3a28 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -108,6 +108,21 @@ Variant *GDScriptFunction::_get_variant(int p_address, GDScriptInstance *p_insta
#endif
return &GDScriptLanguage::get_singleton()->get_global_array()[address];
} break;
+#ifdef TOOLS_ENABLED
+ case ADDR_TYPE_NAMED_GLOBAL: {
+#ifdef DEBUG_ENABLED
+ ERR_FAIL_INDEX_V(address, _named_globals_count, NULL);
+#endif
+ StringName id = _named_globals_ptr[address];
+
+ if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(id)) {
+ return (Variant *)&GDScriptLanguage::get_singleton()->get_named_globals_map()[id];
+ } else {
+ r_error = "Autoload singleton '" + String(id) + "' has been removed.";
+ return NULL;
+ }
+ } break;
+#endif
case ADDR_TYPE_NIL: {
return &nil;
} break;
diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h
index dff4bdfaf2..ea009dcd96 100644
--- a/modules/gdscript/gdscript_function.h
+++ b/modules/gdscript/gdscript_function.h
@@ -92,7 +92,8 @@ public:
ADDR_TYPE_STACK = 5,
ADDR_TYPE_STACK_VARIABLE = 6,
ADDR_TYPE_GLOBAL = 7,
- ADDR_TYPE_NIL = 8
+ ADDR_TYPE_NAMED_GLOBAL = 8,
+ ADDR_TYPE_NIL = 9
};
enum RPCMode {
@@ -121,6 +122,10 @@ private:
int _constant_count;
const StringName *_global_names_ptr;
int _global_names_count;
+#ifdef TOOLS_ENABLED
+ const StringName *_named_globals_ptr;
+ int _named_globals_count;
+#endif
const int *_default_arg_ptr;
int _default_arg_count;
const int *_code_ptr;
@@ -137,6 +142,9 @@ private:
StringName name;
Vector<Variant> constants;
Vector<StringName> global_names;
+#ifdef TOOLS_ENABLED
+ Vector<StringName> named_globals;
+#endif
Vector<int> default_arguments;
Vector<int> code;
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp
index 278585cb01..a88ba477c6 100644
--- a/modules/gdscript/gdscript_functions.cpp
+++ b/modules/gdscript/gdscript_functions.cpp
@@ -122,6 +122,7 @@ const char *GDScriptFunctions::get_func_name(Function p_func) {
"print_stack",
"instance_from_id",
"len",
+ "is_instance_valid",
};
return _names[p_func];
@@ -329,10 +330,24 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
} break;
case MATH_LERP: {
VALIDATE_ARG_COUNT(3);
- VALIDATE_ARG_NUM(0);
- VALIDATE_ARG_NUM(1);
VALIDATE_ARG_NUM(2);
- r_ret = Math::lerp((double)*p_args[0], (double)*p_args[1], (double)*p_args[2]);
+ const double t = (double)*p_args[2];
+ switch (p_args[0]->get_type() == p_args[1]->get_type() ? p_args[0]->get_type() : Variant::REAL) {
+ case Variant::VECTOR2: {
+ r_ret = ((Vector2)*p_args[0]).linear_interpolate((Vector2)*p_args[1], t);
+ } break;
+ case Variant::VECTOR3: {
+ r_ret = ((Vector3)*p_args[0]).linear_interpolate((Vector3)*p_args[1], t);
+ } break;
+ case Variant::COLOR: {
+ r_ret = ((Color)*p_args[0]).linear_interpolate((Color)*p_args[1], t);
+ } break;
+ default: {
+ VALIDATE_ARG_NUM(0);
+ VALIDATE_ARG_NUM(1);
+ r_ret = Math::lerp((double)*p_args[0], (double)*p_args[1], t);
+ } break;
+ }
} break;
case MATH_INVERSE_LERP: {
VALIDATE_ARG_COUNT(3);
@@ -1277,6 +1292,17 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
}
} break;
+ case IS_INSTANCE_VALID: {
+
+ VALIDATE_ARG_COUNT(1);
+ if (p_args[0]->get_type() != Variant::OBJECT) {
+ r_ret = false;
+ } else {
+ Object *obj = *p_args[0];
+ r_ret = ObjectDB::instance_validate(obj);
+ }
+
+ } break;
case FUNC_MAX: {
ERR_FAIL();
@@ -1488,7 +1514,7 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
return mi;
} break;
case MATH_LERP: {
- MethodInfo mi("lerp", PropertyInfo(Variant::REAL, "from"), PropertyInfo(Variant::REAL, "to"), PropertyInfo(Variant::REAL, "weight"));
+ MethodInfo mi("lerp", PropertyInfo(Variant::NIL, "from"), PropertyInfo(Variant::NIL, "to"), PropertyInfo(Variant::REAL, "weight"));
mi.return_val.type = Variant::REAL;
return mi;
} break;
@@ -1798,7 +1824,11 @@ MethodInfo GDScriptFunctions::get_info(Function p_func) {
mi.return_val.type = Variant::INT;
return mi;
} break;
-
+ case IS_INSTANCE_VALID: {
+ MethodInfo mi("is_instance_valid", PropertyInfo(Variant::OBJECT, "instance"));
+ mi.return_val.type = Variant::BOOL;
+ return mi;
+ } break;
case FUNC_MAX: {
ERR_FAIL_V(MethodInfo());
diff --git a/modules/gdscript/gdscript_functions.h b/modules/gdscript/gdscript_functions.h
index 1d54006084..c4731d17a4 100644
--- a/modules/gdscript/gdscript_functions.h
+++ b/modules/gdscript/gdscript_functions.h
@@ -113,6 +113,7 @@ public:
PRINT_STACK,
INSTANCE_FROM_ID,
LEN,
+ IS_INSTANCE_VALID,
FUNC_MAX
};
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 774e9e62ee..e7b0700e76 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -3440,6 +3440,22 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
if (tokenizer->get_token() == GDScriptTokenizer::TK_PARENTHESIS_OPEN) {
tokenizer->advance();
+
+ String hint_prefix = "";
+ bool is_arrayed = false;
+
+ while (tokenizer->get_token() == GDScriptTokenizer::TK_BUILT_IN_TYPE &&
+ tokenizer->get_token_type() == Variant::ARRAY &&
+ tokenizer->get_token(1) == GDScriptTokenizer::TK_COMMA) {
+ tokenizer->advance(); // Array
+ tokenizer->advance(); // Comma
+ if (is_arrayed) {
+ hint_prefix += itos(Variant::ARRAY) + ":";
+ } else {
+ is_arrayed = true;
+ }
+ }
+
if (tokenizer->get_token() == GDScriptTokenizer::TK_BUILT_IN_TYPE) {
Variant::Type type = tokenizer->get_token_type();
@@ -3455,28 +3471,6 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
current_export.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE;
tokenizer->advance();
- String hint_prefix = "";
-
- if (type == Variant::ARRAY && tokenizer->get_token() == GDScriptTokenizer::TK_COMMA) {
- tokenizer->advance();
-
- while (tokenizer->get_token() == GDScriptTokenizer::TK_BUILT_IN_TYPE) {
- type = tokenizer->get_token_type();
-
- tokenizer->advance();
-
- if (type == Variant::ARRAY) {
- hint_prefix += itos(Variant::ARRAY) + ":";
- if (tokenizer->get_token() == GDScriptTokenizer::TK_COMMA) {
- tokenizer->advance();
- }
- } else {
- hint_prefix += itos(type);
- break;
- }
- }
- }
-
if (tokenizer->get_token() == GDScriptTokenizer::TK_COMMA) {
// hint expected next!
tokenizer->advance();
@@ -3830,13 +3824,6 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
} break;
}
}
- if (current_export.type == Variant::ARRAY && !hint_prefix.empty()) {
- if (current_export.hint) {
- hint_prefix += "/" + itos(current_export.hint);
- }
- current_export.hint_string = hint_prefix + ":" + current_export.hint_string;
- current_export.hint = PROPERTY_HINT_NONE;
- }
} else {
@@ -3923,6 +3910,16 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
return;
}
+ if (is_arrayed) {
+ hint_prefix += itos(current_export.type);
+ if (current_export.hint) {
+ hint_prefix += "/" + itos(current_export.hint);
+ }
+ current_export.hint_string = hint_prefix + ":" + current_export.hint_string;
+ current_export.hint = PROPERTY_HINT_TYPE_STRING;
+ current_export.type = Variant::ARRAY;
+ }
+
tokenizer->advance();
}
@@ -4090,7 +4087,8 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
member._export.type=Variant::DICTIONARY;
- } else*/ {
+ } else*/
+ {
if (subexpr->type != Node::TYPE_CONSTANT) {
diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp
index 85c94c3596..422223370b 100644
--- a/modules/gdscript/register_types.cpp
+++ b/modules/gdscript/register_types.cpp
@@ -30,8 +30,8 @@
#include "register_types.h"
+#include "editor/gdscript_highlighter.h"
#include "gdscript.h"
-#include "gdscript_highlighter.h"
#include "gdscript_tokenizer.h"
#include "io/file_access_encrypted.h"
#include "io/resource_loader.h"
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index adc5f16f92..bbe245951e 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -305,7 +305,7 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin
" public override void _Ready()\n"
" {\n"
" // Called every time the node is added to the scene.\n"
- " // Initialization here\n"
+ " // Initialization here.\n"
" \n"
" }\n"
"\n"
diff --git a/modules/mono/glue/cs_files/Vector2.cs b/modules/mono/glue/cs_files/Vector2.cs
index cc2cda82fb..9bc40cf8df 100644
--- a/modules/mono/glue/cs_files/Vector2.cs
+++ b/modules/mono/glue/cs_files/Vector2.cs
@@ -97,6 +97,11 @@ namespace Godot
return -Reflect(n);
}
+ public Vector2 Ceil()
+ {
+ return new Vector2(Mathf.Ceil(x), Mathf.Ceil(y));
+ }
+
public Vector2 Clamped(real_t length)
{
var v = this;
@@ -190,6 +195,11 @@ namespace Godot
return new Vector2(Mathf.Cos(rads), Mathf.Sin(rads)) * Length();
}
+ public Vector2 Round()
+ {
+ return new Vector2(Mathf.Round(x), Mathf.Round(y));
+ }
+
public void Set(real_t x, real_t y)
{
this.x = x;
diff --git a/modules/mono/glue/cs_files/Vector3.cs b/modules/mono/glue/cs_files/Vector3.cs
index 0a71f3fa4d..57e4494f7e 100644
--- a/modules/mono/glue/cs_files/Vector3.cs
+++ b/modules/mono/glue/cs_files/Vector3.cs
@@ -219,6 +219,11 @@ namespace Godot
return 2.0f * n * Dot(n) - this;
}
+ public Vector3 Round()
+ {
+ return new Vector3(Mathf.Round(x), Mathf.Round(y), Mathf.Round(z));
+ }
+
public Vector3 Rotated(Vector3 axis, real_t phi)
{
return new Basis(axis, phi).Xform(this);
diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp
index 2809cff362..11401c0460 100644
--- a/modules/visual_script/register_types.cpp
+++ b/modules/visual_script/register_types.cpp
@@ -112,7 +112,9 @@ void register_visual_script_types() {
register_visual_script_expression_node();
#ifdef TOOLS_ENABLED
+ ClassDB::set_current_api(ClassDB::API_EDITOR);
ClassDB::register_class<_VisualScriptEditor>();
+ ClassDB::set_current_api(ClassDB::API_CORE);
vs_editor_singleton = memnew(_VisualScriptEditor);
Engine::get_singleton()->add_singleton(Engine::Singleton("VisualScriptEditor", _VisualScriptEditor::get_singleton()));
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index b09c232b3c..c681e2b34f 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -263,7 +263,7 @@ if env["platform"] == 'uwp':
webm_cpu_x86 = True
else:
import platform
- is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and platform.machine().startswith('arm'))
+ is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and (platform.machine().startswith('arm') or platform.machine().startswith('aarch')))
is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"])
is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86')
if is_android_x86:
@@ -337,7 +337,6 @@ if webm_cpu_arm:
if webm_simd_optimizations == False:
print("WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!")
-
env_libvpx.add_source_files(env.modules_sources, libvpx_sources)
if webm_cpu_x86:
is_clang_or_gcc = ('gcc' in env["CC"]) or ('clang' in env["CC"]) or ("OSXCROSS_ROOT" in os.environ)
@@ -379,5 +378,5 @@ elif webm_cpu_arm:
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_armasm_ms)
elif env["platform"] == 'iphone':
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas_apple)
- elif not env["android_arch"] == 'arm64v8':
+ elif (is_x11_or_server_arm and cpu_bits == '32') or (env["platform"] == 'android' and not env["android_arch"] == 'arm64v8'):
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas)
diff --git a/modules/websocket/config.py b/modules/websocket/config.py
index fb920482f5..399ca88fc1 100644
--- a/modules/websocket/config.py
+++ b/modules/websocket/config.py
@@ -5,3 +5,14 @@ def can_build(platform):
def configure(env):
pass
+
+def get_doc_classes():
+ return [
+ "WebSocketClient",
+ "WebSocketMultiplayerPeer",
+ "WebSocketPeer",
+ "WebSocketServer"
+ ]
+
+def get_doc_path():
+ return "doc_classes"
diff --git a/modules/websocket/doc_classes/WebSocketClient.xml b/modules/websocket/doc_classes/WebSocketClient.xml
new file mode 100644
index 0000000000..2e11e1a44c
--- /dev/null
+++ b/modules/websocket/doc_classes/WebSocketClient.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="WebSocketClient" inherits="WebSocketMultiplayerPeer" category="Core" version="3.1">
+ <brief_description>
+ A WebSocket client implementation
+ </brief_description>
+ <description>
+ This class implements a WebSocket client compatible with any RFC 6455 complaint WebSocket server.
+ This client can be optionally used as a network peer for the [MultiplayerAPI].
+ After starting the client ([method connect_to_url]), you will need to [method NetworkedMultiplayerPeer.poll] it at regular intervals (e.g. inside [method Node._process]).
+ You will received appropriate signals when connecting, disconnecting, or when new data is available.
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="connect_to_url">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="url" type="String">
+ </argument>
+ <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
+ </argument>
+ <argument index="2" name="gd_mp_api" type="bool" default="false">
+ </argument>
+ <description>
+ Connect to the given URL requesting one of the given [code]protocols[/code] as sub-protocol.
+ If [code]true[/code] is passed as [code]gd_mp_api[/code], the client will behave like a network peer for the [MultiplayerAPI]. Note: connnections to non Godot servers will not work, and [signal data_received] will not be emitted when this option is true.
+ </description>
+ </method>
+ <method name="disconnect_from_host">
+ <return type="void">
+ </return>
+ <description>
+ Disconnect from the server if currently connected.
+ </description>
+ </method>
+ </methods>
+ <members>
+ <member name="verify_ssl" type="bool" setter="set_verify_ssl_enabled" getter="is_verify_ssl_enabled">
+ Enable or disable SSL certificate verification. Note: You must specify the certificates to be used in the project settings for it to work when exported.
+ </member>
+ </members>
+ <signals>
+ <signal name="connection_closed">
+ <description>
+ Emitted when the connection to the server is closed.
+ </description>
+ </signal>
+ <signal name="connection_error">
+ <description>
+ Emitted when the connection to the server fails.
+ </description>
+ </signal>
+ <signal name="connection_established">
+ <argument index="0" name="protocol" type="String">
+ </argument>
+ <description>
+ Emitted when a connection with the server is established, [code]protocol[/code] will contain the sub-protocol agreed with the server.
+ </description>
+ </signal>
+ <signal name="data_received">
+ <description>
+ Emitted when a WebSocket message is received. Note: This signal is NOT emitted when used as high level multiplayer peer.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/WebSocketMultiplayerPeer.xml b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml
index a1014350f5..1a841f85ed 100644
--- a/doc/classes/WebSocketMultiplayerPeer.xml
+++ b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="WebSocketMultiplayerPeer" inherits="NetworkedMultiplayerPeer" category="Core" version="3.1">
<brief_description>
+ Base class for WebSocket server and client.
</brief_description>
<description>
+ Base class for WebSocket server and client, allowing them to be used as network peer for the [MultiplayerAPI].
</description>
<tutorials>
</tutorials>
@@ -15,6 +17,7 @@
<argument index="0" name="peer_id" type="int">
</argument>
<description>
+ Returns the [WebSocketPeer] associated to the given [code]peer_id[/code].
</description>
</method>
</methods>
@@ -23,6 +26,7 @@
<argument index="0" name="peer_source" type="int">
</argument>
<description>
+ Emitted when a packet is received from a peer. Note: this signal is only emitted when the client or server is configured to use Godot multiplayer API.
</description>
</signal>
</signals>
diff --git a/modules/websocket/doc_classes/WebSocketPeer.xml b/modules/websocket/doc_classes/WebSocketPeer.xml
new file mode 100644
index 0000000000..85a08e0c0b
--- /dev/null
+++ b/modules/websocket/doc_classes/WebSocketPeer.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="WebSocketPeer" inherits="PacketPeer" category="Core" version="3.1">
+ <brief_description>
+ A class representing a specific WebSocket connection.
+ </brief_description>
+ <description>
+ This class represent a specific WebSocket connection, you can do lower level operations with it.
+ You can choose to write to the socket in binary or text mode, and you can recognize the mode used for writing by the other peer.
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="close">
+ <return type="void">
+ </return>
+ <description>
+ Close this WebSocket connection, actively disconnecting the peer.
+ </description>
+ </method>
+ <method name="get_connected_host" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns the IP Address of the connected peer. (Not available in HTML5 export)
+ </description>
+ </method>
+ <method name="get_connected_port" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ Returns the remote port of the connected peer. (Not available in HTML5 export)
+ </description>
+ </method>
+ <method name="get_write_mode" qualifiers="const">
+ <return type="int" enum="WebSocketPeer.WriteMode">
+ </return>
+ <description>
+ Get the current selected write mode. See [enum WriteMode].
+ </description>
+ </method>
+ <method name="is_connected_to_host" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if this peer is currently connected.
+ </description>
+ </method>
+ <method name="set_write_mode">
+ <return type="void">
+ </return>
+ <argument index="0" name="mode" type="int" enum="WebSocketPeer.WriteMode">
+ </argument>
+ <description>
+ Sets the socket to use the given [enum WriteMode].
+ </description>
+ </method>
+ <method name="was_string_packet" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the last received packet was sent as a text payload. See [enum WriteMode]
+ </description>
+ </method>
+ </methods>
+ <constants>
+ <constant name="WRITE_MODE_TEXT" value="0" enum="WriteMode">
+ Specify that WebSockets messages should be transferred as text payload (only valid UTF-8 is allowed).
+ </constant>
+ <constant name="WRITE_MODE_BINARY" value="1" enum="WriteMode">
+ Specify that WebSockets messages should be transferred as binary payload (any byte combination is allowed).
+ </constant>
+ </constants>
+</class>
diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml
new file mode 100644
index 0000000000..a1061e446b
--- /dev/null
+++ b/modules/websocket/doc_classes/WebSocketServer.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="WebSocketServer" inherits="WebSocketMultiplayerPeer" category="Core" version="3.1">
+ <brief_description>
+ A WebSocket server implementation
+ </brief_description>
+ <description>
+ This class implements a WebSocket server that can also support the high level multiplayer API.
+ After starting the server ([method listen]), you will need to [method NetworkedMultiplayerPeer.poll] it at regular intervals (e.g. inside [method Node._process]). When clients connect, disconnect, or send data, you will receive the appropriate signal.
+ Note: This class will not work in HTML5 exports due to browser restrictions.
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="disconnect_peer">
+ <return type="void">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Disconnects the given peer.
+ </description>
+ </method>
+ <method name="get_peer_address" qualifiers="const">
+ <return type="String">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns the IP address of the given peer.
+ </description>
+ </method>
+ <method name="get_peer_port" qualifiers="const">
+ <return type="int">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns the remote port of the given peer.
+ </description>
+ </method>
+ <method name="has_peer" qualifiers="const">
+ <return type="bool">
+ </return>
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Returns [code]true[/code] if a peer with the given ID is connected.
+ </description>
+ </method>
+ <method name="is_listening" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ Returns [code]true[/code] if the server is actively listening on a port.
+ </description>
+ </method>
+ <method name="listen">
+ <return type="int" enum="Error">
+ </return>
+ <argument index="0" name="port" type="int">
+ </argument>
+ <argument index="1" name="protocols" type="PoolStringArray" default="PoolStringArray( )">
+ </argument>
+ <argument index="2" name="gd_mp_api" type="bool" default="false">
+ </argument>
+ <description>
+ Start listening on the given port.
+ You can specify the desired subprotocols via the "protocols" array. If the list empty (default), "binary" will be used.
+ You can use this server as a network peer for [MultiplayerAPI] by passing true as "gd_mp_api". Note: [signal data_received] will not be fired and clients other than Godot will not work in this case.
+ </description>
+ </method>
+ <method name="stop">
+ <return type="void">
+ </return>
+ <description>
+ Stop the server and clear its state.
+ </description>
+ </method>
+ </methods>
+ <signals>
+ <signal name="client_connected">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <argument index="1" name="protocol" type="String">
+ </argument>
+ <description>
+ Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client.
+ </description>
+ </signal>
+ <signal name="client_disconnected">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Emitted when a client disconnects.
+ </description>
+ </signal>
+ <signal name="data_received">
+ <argument index="0" name="id" type="int">
+ </argument>
+ <description>
+ Emitted when a new message is received. Note: This signal is NOT emitted when used as high level multiplayer peer.
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
diff --git a/modules/websocket/websocket_server.cpp b/modules/websocket/websocket_server.cpp
index 2693b26e47..53dd7b51b7 100644
--- a/modules/websocket/websocket_server.cpp
+++ b/modules/websocket/websocket_server.cpp
@@ -44,9 +44,9 @@ void WebSocketServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("listen", "port", "protocols", "gd_mp_api"), &WebSocketServer::listen, DEFVAL(PoolVector<String>()), DEFVAL(false));
ClassDB::bind_method(D_METHOD("stop"), &WebSocketServer::stop);
ClassDB::bind_method(D_METHOD("has_peer", "id"), &WebSocketServer::has_peer);
- ClassDB::bind_method(D_METHOD("get_peer_address"), &WebSocketServer::get_peer_address);
- ClassDB::bind_method(D_METHOD("get_peer_port"), &WebSocketServer::get_peer_port);
- ClassDB::bind_method(D_METHOD("disconnect_peer"), &WebSocketServer::disconnect_peer);
+ ClassDB::bind_method(D_METHOD("get_peer_address", "id"), &WebSocketServer::get_peer_address);
+ ClassDB::bind_method(D_METHOD("get_peer_port", "id"), &WebSocketServer::get_peer_port);
+ ClassDB::bind_method(D_METHOD("disconnect_peer", "id"), &WebSocketServer::disconnect_peer);
ADD_SIGNAL(MethodInfo("client_disconnected", PropertyInfo(Variant::INT, "id")));
ADD_SIGNAL(MethodInfo("client_connected", PropertyInfo(Variant::INT, "id"), PropertyInfo(Variant::STRING, "protocol")));
diff --git a/platform/android/AndroidManifest.xml.template b/platform/android/AndroidManifest.xml.template
index 3e42b7a3cd..13d10b5026 100644
--- a/platform/android/AndroidManifest.xml.template
+++ b/platform/android/AndroidManifest.xml.template
@@ -201,6 +201,6 @@ $$ADD_PERMISSION_CHUNKS$$
<uses-permission android:name="godot.custom.18"/>
<uses-permission android:name="godot.custom.19"/>
-<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="23"/>
+<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="27"/>
</manifest>
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index 7269e658b4..cc45fee95f 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -21,7 +21,6 @@ allprojects {
}
dependencies {
- compile 'com.android.support:support-v4:27.+' // can be removed if minSdkVersion 16 and modify DownloadNotification.java & V14CustomNotification.java
$$GRADLE_DEPENDENCIES$$
}
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 6ed03d7aee..6fe137a386 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1643,9 +1643,9 @@ public:
List<String> args;
args.push_back("-digestalg");
- args.push_back("SHA1");
+ args.push_back("SHA-256");
args.push_back("-sigalg");
- args.push_back("MD5withRSA");
+ args.push_back("SHA256withRSA");
String tsa_url = EditorSettings::get_singleton()->get("export/android/timestamping_authority_url");
if (tsa_url != "") {
args.push_back("-tsa");
diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
index 73e6f83bec..a9f674803c 100644
--- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java
@@ -27,7 +27,6 @@ import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Messenger;
-import android.support.v4.app.NotificationCompat;
/**
* This class handles displaying the notification associated with the download
@@ -49,9 +48,8 @@ public class DownloadNotification implements IDownloaderClient {
private IDownloaderClient mClientProxy;
final ICustomNotification mCustomNotification;
- // NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
- private NotificationCompat.Builder mNotificationBuilder;
- private NotificationCompat.Builder mCurrentNotificationBuilder;
+ private Notification.Builder mNotificationBuilder;
+ private Notification.Builder mCurrentNotificationBuilder;
private CharSequence mLabel;
private String mCurrentText;
private PendingIntent mContentIntent;
@@ -187,7 +185,7 @@ public class DownloadNotification implements IDownloaderClient {
void setTimeRemaining(long timeRemaining);
- NotificationCompat.Builder updateNotification(Context c);
+ Notification.Builder updateNotification(Context c);
}
/**
@@ -220,7 +218,7 @@ public class DownloadNotification implements IDownloaderClient {
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
mCustomNotification = CustomNotificationFactory
.createCustomNotification();
- mNotificationBuilder = new NotificationCompat.Builder(ctx);
+ mNotificationBuilder = new Notification.Builder(ctx);
mCurrentNotificationBuilder = mNotificationBuilder;
}
diff --git a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
index 390bde96e9..56b2331e31 100644
--- a/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
+++ b/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java
@@ -22,7 +22,6 @@ import com.google.android.vending.expansion.downloader.Helpers;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
-import android.support.v4.app.NotificationCompat;
public class V14CustomNotification implements DownloadNotification.ICustomNotification {
@@ -54,14 +53,13 @@ public class V14CustomNotification implements DownloadNotification.ICustomNotifi
mCurrentKB = currentBytes;
}
- void setProgress(NotificationCompat.Builder builder) {
+ void setProgress(Notification.Builder builder) {
}
@Override
- public NotificationCompat.Builder updateNotification(Context c) {
- // NotificationCompat.Builder is used to support API < 16. This can be changed to Notification.Builder if minimum API >= 16.
- NotificationCompat.Builder builder = new NotificationCompat.Builder(c);
+ public Notification.Builder updateNotification(Context c) {
+ Notification.Builder builder = new Notification.Builder(c);
builder.setContentTitle(mTitle);
if (mTotalKB > 0 && -1 != mCurrentKB) {
builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false);
diff --git a/platform/iphone/app_delegate.h b/platform/iphone/app_delegate.h
index f14864b5b7..c34b5053d6 100644
--- a/platform/iphone/app_delegate.h
+++ b/platform/iphone/app_delegate.h
@@ -37,6 +37,7 @@
@interface AppDelegate : NSObject <UIApplicationDelegate, GLViewDelegate> {
//@property (strong, nonatomic) UIWindow *window;
ViewController *view_controller;
+ bool is_focus_out;
};
@property(strong, nonatomic) UIWindow *window;
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index 9e6bbff1d7..dd5ce4ab10 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -140,6 +140,42 @@ void _ios_add_joystick(GCController *controller, AppDelegate *delegate) {
};
}
+static void on_focus_out(ViewController *view_controller, bool *is_focus_out) {
+ if (!*is_focus_out) {
+ *is_focus_out = true;
+ if (OS::get_singleton()->get_main_loop())
+ OS::get_singleton()->get_main_loop()->notification(
+ MainLoop::NOTIFICATION_WM_FOCUS_OUT);
+
+ [view_controller.view stopAnimation];
+ if (OS::get_singleton()->native_video_is_playing()) {
+ OSIPhone::get_singleton()->native_video_focus_out();
+ }
+
+ AudioDriverCoreAudio *audio = dynamic_cast<AudioDriverCoreAudio *>(AudioDriverCoreAudio::get_singleton());
+ if (audio)
+ audio->stop();
+ }
+}
+
+static void on_focus_in(ViewController *view_controller, bool *is_focus_out) {
+ if (*is_focus_out) {
+ *is_focus_out = false;
+ if (OS::get_singleton()->get_main_loop())
+ OS::get_singleton()->get_main_loop()->notification(
+ MainLoop::NOTIFICATION_WM_FOCUS_IN);
+
+ [view_controller.view startAnimation];
+ if (OSIPhone::get_singleton()->native_video_is_playing()) {
+ OSIPhone::get_singleton()->native_video_unpause();
+ }
+
+ AudioDriverCoreAudio *audio = dynamic_cast<AudioDriverCoreAudio *>(AudioDriverCoreAudio::get_singleton());
+ if (audio)
+ audio->start();
+ }
+}
+
- (void)controllerWasConnected:(NSNotification *)notification {
// create our dictionary if we don't have one yet
if (ios_joysticks == nil) {
@@ -569,6 +605,8 @@ static int frame_count = 0;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CGRect rect = [[UIScreen mainScreen] bounds];
+ is_focus_out = false;
+
[application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
// disable idle timer
// application.idleTimerDisabled = YES;
@@ -628,6 +666,12 @@ static int frame_count = 0;
[self initGameControllers];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(onAudioInterruption:)
+ name:AVAudioSessionInterruptionNotification
+ object:[AVAudioSession sharedInstance]];
+
// OSIPhone::screen_width = rect.size.width - rect.origin.x;
// OSIPhone::screen_height = rect.size.height - rect.origin.y;
@@ -639,6 +683,18 @@ static int frame_count = 0;
return TRUE;
};
+- (void)onAudioInterruption:(NSNotification *)notification {
+ if ([notification.name isEqualToString:AVAudioSessionInterruptionNotification]) {
+ if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] isEqualToNumber:[NSNumber numberWithInt:AVAudioSessionInterruptionTypeBegan]]) {
+ NSLog(@"Audio interruption began");
+ on_focus_out(view_controller, &is_focus_out);
+ } else if ([[notification.userInfo valueForKey:AVAudioSessionInterruptionTypeKey] isEqualToNumber:[NSNumber numberWithInt:AVAudioSessionInterruptionTypeEnded]]) {
+ NSLog(@"Audio interruption ended");
+ on_focus_in(view_controller, &is_focus_out);
+ }
+ }
+};
+
- (void)applicationWillTerminate:(UIApplication *)application {
[self deinitGameControllers];
@@ -653,44 +709,22 @@ static int frame_count = 0;
iphone_finish();
};
-- (void)applicationDidEnterBackground:(UIApplication *)application {
- ///@TODO maybe add pause motionManager? and where would we unpause it?
-
- if (OS::get_singleton()->get_main_loop())
- OS::get_singleton()->get_main_loop()->notification(
- MainLoop::NOTIFICATION_WM_FOCUS_OUT);
-
- [view_controller.view stopAnimation];
- if (OS::get_singleton()->native_video_is_playing()) {
- OSIPhone::get_singleton()->native_video_focus_out();
- };
-}
+// When application goes to background (e.g. user switches to another app or presses Home),
+// then applicationWillResignActive -> applicationDidEnterBackground are called.
+// When user opens the inactive app again,
+// applicationWillEnterForeground -> applicationDidBecomeActive are called.
-- (void)applicationWillEnterForeground:(UIApplication *)application {
- // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN);
- [view_controller.view startAnimation];
-}
+// There are cases when applicationWillResignActive -> applicationDidBecomeActive
+// sequence is called without the app going to background. For example, that happens
+// if you open the app list without switching to another app or open/close the
+// notification panel by swiping from the upper part of the screen.
- (void)applicationWillResignActive:(UIApplication *)application {
- // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT);
- [view_controller.view
- stopAnimation]; // FIXME: pause seems to be recommended elsewhere
+ on_focus_out(view_controller, &is_focus_out);
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
- if (OS::get_singleton()->get_main_loop())
- OS::get_singleton()->get_main_loop()->notification(
- MainLoop::NOTIFICATION_WM_FOCUS_IN);
-
- [view_controller.view
- startAnimation]; // FIXME: resume seems to be recommended elsewhere
- if (OSIPhone::get_singleton()->native_video_is_playing()) {
- OSIPhone::get_singleton()->native_video_unpause();
- };
-
- // Fixed audio can not resume if it is interrupted cause by an incoming phone call
- if (AudioDriverCoreAudio::get_singleton() != NULL)
- AudioDriverCoreAudio::get_singleton()->start();
+ on_focus_in(view_controller, &is_focus_out);
}
- (void)dealloc {
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js
index e4839af433..c3ef5bbbb5 100644
--- a/platform/javascript/engine.js
+++ b/platform/javascript/engine.js
@@ -10,6 +10,7 @@
var DOWNLOAD_ATTEMPTS_MAX = 4;
var basePath = null;
+ var wasmFilenameExtensionOverride = null;
var engineLoadPromise = null;
var loadingFiles = {};
@@ -129,13 +130,17 @@
this.startGame = function(mainPack) {
executableName = getBaseName(mainPack);
+ var mainArgs = [];
+ if (!getPathLeaf(mainPack).endsWith('.pck')) {
+ mainArgs = ['--main-pack', getPathLeaf(mainPack)];
+ }
return Promise.all([
// Load from directory,
this.init(getBasePath(mainPack)),
// ...but write to root where the engine expects it.
this.preloadFile(mainPack, getPathLeaf(mainPack))
]).then(
- Function.prototype.apply.bind(synchronousStart, this, [])
+ Function.prototype.apply.bind(synchronousStart, this, mainArgs)
);
};
@@ -161,6 +166,10 @@
actualCanvas.style.padding = 0;
actualCanvas.style.borderWidth = 0;
actualCanvas.style.borderStyle = 'none';
+ // disable right-click context menu
+ actualCanvas.addEventListener('contextmenu', function(ev) {
+ ev.preventDefault();
+ }, false);
// until context restoration is implemented
actualCanvas.addEventListener('webglcontextlost', function(ev) {
alert("WebGL context lost, please reload the page");
@@ -299,6 +308,14 @@
return !!testContext;
};
+ Engine.setWebAssemblyFilenameExtension = function(override) {
+
+ if (String(override).length === 0) {
+ throw new Error('Invalid WebAssembly filename extension override');
+ }
+ wasmFilenameExtensionOverride = String(override);
+ }
+
Engine.load = function(newBasePath) {
if (newBasePath !== undefined) basePath = getBasePath(newBasePath);
@@ -306,7 +323,7 @@
if (typeof WebAssembly !== 'object')
return Promise.reject(new Error("Browser doesn't support WebAssembly"));
// TODO cache/retrieve module to/from idb
- engineLoadPromise = loadPromise(basePath + '.wasm').then(function(xhr) {
+ engineLoadPromise = loadPromise(basePath + '.' + (wasmFilenameExtensionOverride || 'wasm')).then(function(xhr) {
return xhr.response;
});
engineLoadPromise = engineLoadPromise.catch(function(err) {
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index d81aa25c32..9591850662 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -117,7 +117,7 @@ void EditorExportPlatformJavaScript::get_export_options(List<ExportOption> *r_op
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/s3tc"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc"), false));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "texture_format/etc2"), true));
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/custom_html_shell", PROPERTY_HINT_GLOBAL_FILE, "html"), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/custom_html_shell", PROPERTY_HINT_FILE, "html"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "html/head_include", PROPERTY_HINT_MULTILINE_TEXT), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), ""));
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index 1b5463e40d..6c6e4d2d1c 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -167,10 +167,9 @@ static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent
int mask = _input->get_mouse_button_mask();
int button_flag = 1 << (ev->get_button_index() - 1);
if (ev->is_pressed()) {
- // since the event is consumed, focus manually
- if (!is_canvas_focused()) {
- focus_canvas();
- }
+ // Since the event is consumed, focus manually. The containing iframe,
+ // if used, may not have focus yet, so focus even if already focused.
+ focus_canvas();
mask |= button_flag;
} else if (mask & button_flag) {
mask &= ~button_flag;
@@ -181,7 +180,8 @@ static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent
ev->set_button_mask(mask);
_input->parse_input_event(ev);
- // prevent selection dragging
+ // Prevent multi-click text selection and wheel-click scrolling anchor.
+ // Context menu is prevented through contextmenu event.
return true;
}
@@ -204,7 +204,7 @@ static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *m
ev->set_position(pos);
ev->set_global_position(ev->get_position());
- ev->set_relative(ev->get_position() - _input->get_mouse_position());
+ ev->set_relative(Vector2(mouse_event->movementX, mouse_event->movementY));
_input->set_mouse_position(ev->get_position());
ev->set_speed(_input->get_last_mouse_speed());
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index fee25e98cb..c1022a1aca 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -99,6 +99,8 @@ public:
id pixelFormat;
id context;
+ bool layered_window;
+
CursorShape cursor_shape;
NSCursor *cursors[CURSOR_MAX];
MouseMode mouse_mode;
@@ -226,6 +228,10 @@ public:
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window();
+
+ virtual bool get_window_per_pixel_transparency_enabled() const;
+ virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
+
virtual void set_ime_position(const Point2 &p_pos);
virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp);
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index fbefd41bb7..bde0b4e898 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -541,7 +541,9 @@ static const NSRange kEmptyRange = { NSNotFound, 0 };
}
- (void)cursorUpdate:(NSEvent *)event {
- //setModeCursor(window, window->cursorMode);
+ OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape;
+ OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX;
+ OS_OSX::singleton->set_cursor_shape(p_shape);
}
static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
@@ -656,11 +658,12 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
return;
if (OS_OSX::singleton->main_loop && OS_OSX::singleton->mouse_mode != OS::MOUSE_MODE_CAPTURED)
OS_OSX::singleton->main_loop->notification(MainLoop::NOTIFICATION_WM_MOUSE_ENTER);
- if (OS_OSX::singleton->input) {
+ if (OS_OSX::singleton->input)
OS_OSX::singleton->input->set_mouse_in_window(true);
- OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX;
- OS_OSX::singleton->set_cursor_shape(OS::CURSOR_ARROW);
- }
+
+ OS::CursorShape p_shape = OS_OSX::singleton->cursor_shape;
+ OS_OSX::singleton->cursor_shape = OS::CURSOR_MAX;
+ OS_OSX::singleton->set_cursor_shape(p_shape);
}
- (void)magnifyWithEvent:(NSEvent *)event {
@@ -847,16 +850,16 @@ struct _KeyCodeMap {
static const _KeyCodeMap _keycodes[55] = {
{ '`', KEY_QUOTELEFT },
{ '~', KEY_ASCIITILDE },
- { '0', KEY_KP_0 },
- { '1', KEY_KP_1 },
- { '2', KEY_KP_2 },
- { '3', KEY_KP_3 },
- { '4', KEY_KP_4 },
- { '5', KEY_KP_5 },
- { '6', KEY_KP_6 },
- { '7', KEY_KP_7 },
- { '8', KEY_KP_8 },
- { '9', KEY_KP_9 },
+ { '0', KEY_0 },
+ { '1', KEY_1 },
+ { '2', KEY_2 },
+ { '3', KEY_3 },
+ { '4', KEY_4 },
+ { '5', KEY_5 },
+ { '6', KEY_6 },
+ { '7', KEY_7 },
+ { '8', KEY_8 },
+ { '9', KEY_9 },
{ '-', KEY_MINUS },
{ '_', KEY_UNDERSCORE },
{ '=', KEY_EQUAL },
@@ -1330,6 +1333,9 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
restore_rect = Rect2(get_window_position(), get_window_size());
+ if (p_desired.layered_splash) {
+ set_window_per_pixel_transparency_enabled(true);
+ }
return OK;
}
@@ -1510,39 +1516,78 @@ void OS_OSX::set_cursor_shape(CursorShape p_shape) {
void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
if (p_cursor.is_valid()) {
Ref<Texture> texture = p_cursor;
- Ref<Image> image = texture->get_data();
+ Ref<AtlasTexture> atlas_texture = p_cursor;
+ Ref<Image> image;
+ Size2 texture_size;
+ Rect2 atlas_rect;
- ERR_FAIL_COND(texture->get_width() > 256 || texture->get_height() > 256);
+ if (texture.is_valid()) {
+ image = texture->get_data();
+ }
+
+ if (!image.is_valid() && atlas_texture.is_valid()) {
+ texture = atlas_texture->get_atlas();
+
+ atlas_rect.size.width = texture->get_width();
+ atlas_rect.size.height = texture->get_height();
+ atlas_rect.position.x = atlas_texture->get_region().position.x;
+ atlas_rect.position.y = atlas_texture->get_region().position.y;
+
+ texture_size.width = atlas_texture->get_region().size.x;
+ texture_size.height = atlas_texture->get_region().size.y;
+ } else if (image.is_valid()) {
+ texture_size.width = texture->get_width();
+ texture_size.height = texture->get_height();
+ }
+
+ ERR_FAIL_COND(!texture.is_valid());
+ ERR_FAIL_COND(texture_size.width > 256 || texture_size.height > 256);
+
+ image = texture->get_data();
NSBitmapImageRep *imgrep = [[[NSBitmapImageRep alloc]
initWithBitmapDataPlanes:NULL
- pixelsWide:image->get_width()
- pixelsHigh:image->get_height()
+ pixelsWide:int(texture_size.width)
+ pixelsHigh:int(texture_size.height)
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
- bytesPerRow:image->get_width() * 4
+ bytesPerRow:int(texture_size.width) * 4
bitsPerPixel:32] autorelease];
ERR_FAIL_COND(imgrep == nil);
uint8_t *pixels = [imgrep bitmapData];
- int len = image->get_width() * image->get_height();
+ int len = int(texture_size.width * texture_size.height);
PoolVector<uint8_t> data = image->get_data();
PoolVector<uint8_t>::Read r = data.read();
+ image->lock();
+
/* Premultiply the alpha channel */
for (int i = 0; i < len; i++) {
- uint8_t alpha = r[i * 4 + 3];
- pixels[i * 4 + 0] = (uint8_t)(((uint16_t)r[i * 4 + 0] * alpha) / 255);
- pixels[i * 4 + 1] = (uint8_t)(((uint16_t)r[i * 4 + 1] * alpha) / 255);
- pixels[i * 4 + 2] = (uint8_t)(((uint16_t)r[i * 4 + 2] * alpha) / 255);
+ int row_index = floor(i / texture_size.width) + atlas_rect.position.y;
+ int column_index = (i % int(texture_size.width)) + atlas_rect.position.x;
+
+ if (atlas_texture.is_valid()) {
+ column_index = MIN(column_index, atlas_rect.size.width - 1);
+ row_index = MIN(row_index, atlas_rect.size.height - 1);
+ }
+
+ uint32_t color = image->get_pixel(column_index, row_index).to_argb32();
+
+ uint8_t alpha = (color >> 24) & 0xFF;
+ pixels[i * 4 + 0] = ((color >> 16) & 0xFF) * alpha / 255;
+ pixels[i * 4 + 1] = ((color >> 8) & 0xFF) * alpha / 255;
+ pixels[i * 4 + 2] = ((color)&0xFF) * alpha / 255;
pixels[i * 4 + 3] = alpha;
}
- NSImage *nsimage = [[[NSImage alloc] initWithSize:NSMakeSize(image->get_width(), image->get_height())] autorelease];
+ image->unlock();
+
+ NSImage *nsimage = [[[NSImage alloc] initWithSize:NSMakeSize(texture_size.width, texture_size.height)] autorelease];
[nsimage addRepresentation:imgrep];
NSCursor *cursor = [[NSCursor alloc] initWithImage:nsimage hotSpot:NSMakePoint(p_hotspot.x, p_hotspot.y)];
@@ -1552,6 +1597,11 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
if (p_shape == CURSOR_ARROW) {
[cursor set];
}
+ } else {
+ // Reset to default system cursor
+ cursors[p_shape] = NULL;
+ cursor_shape = CURSOR_MAX;
+ set_cursor_shape(p_shape);
}
}
@@ -2042,6 +2092,8 @@ void OS_OSX::set_window_size(const Size2 p_size) {
void OS_OSX::set_window_fullscreen(bool p_enabled) {
if (zoomed != p_enabled) {
+ if (layered_window)
+ set_window_per_pixel_transparency_enabled(false);
[window_object toggleFullScreen:nil];
}
zoomed = p_enabled;
@@ -2123,6 +2175,39 @@ void OS_OSX::request_attention() {
[NSApp requestUserAttention:NSCriticalRequest];
}
+bool OS_OSX::get_window_per_pixel_transparency_enabled() const {
+
+ if (!is_layered_allowed()) return false;
+ return layered_window;
+}
+
+void OS_OSX::set_window_per_pixel_transparency_enabled(bool p_enabled) {
+
+ if (!is_layered_allowed()) return;
+ if (layered_window != p_enabled) {
+ if (p_enabled) {
+ set_borderless_window(true);
+ GLint opacity = 0;
+ [window_object setBackgroundColor:[NSColor clearColor]];
+ [window_object setOpaque:NO];
+ [window_object setHasShadow:NO];
+ [context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
+ layered_window = true;
+ } else {
+ GLint opacity = 1;
+ [window_object setBackgroundColor:[NSColor colorWithCalibratedWhite:1 alpha:1]];
+ [window_object setOpaque:YES];
+ [window_object setHasShadow:YES];
+ [context setValues:&opacity forParameter:NSOpenGLCPSurfaceOpacity];
+ layered_window = false;
+ }
+ [context update];
+ NSRect frame = [window_object frame];
+ [window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, 1, 1) display:YES];
+ [window_object setFrame:frame display:YES];
+ }
+}
+
void OS_OSX::set_borderless_window(bool p_borderless) {
// OrderOut prevents a lose focus bug with the window
@@ -2131,6 +2216,9 @@ void OS_OSX::set_borderless_window(bool p_borderless) {
if (p_borderless) {
[window_object setStyleMask:NSWindowStyleMaskBorderless];
} else {
+ if (layered_window)
+ set_window_per_pixel_transparency_enabled(false);
+
[window_object setStyleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable];
// Force update of the window styles
@@ -2339,12 +2427,21 @@ void OS_OSX::run() {
//int frames=0;
//uint64_t frame=0;
- while (!force_quit) {
+ bool quit = false;
- process_events(); // get rid of pending events
- joypad_osx->process_joypads();
- if (Main::iteration() == true)
- break;
+ while (!force_quit && !quit) {
+
+ @try {
+
+ process_events(); // get rid of pending events
+ joypad_osx->process_joypads();
+
+ if (Main::iteration() == true) {
+ quit = true;
+ }
+ } @catch (NSException *exception) {
+ ERR_PRINTS("NSException: " + String([exception reason].UTF8String));
+ }
};
main_loop->finish();
@@ -2435,6 +2532,7 @@ OS_OSX::OS_OSX() {
im_position = Point2();
im_callback = NULL;
im_target = NULL;
+ layered_window = false;
autoreleasePool = [[NSAutoreleasePool alloc] init];
eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index 3c537b3b58..35c0b30ce4 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -777,7 +777,7 @@ class EditorExportUWP : public EditorExportPlatform {
result = result.replace("$version_string$", version);
Platform arch = (Platform)(int)p_preset->get("architecture/target");
- String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64";
+ String architecture = arch == ARM ? "arm" : arch == X86 ? "x86" : "x64";
result = result.replace("$architecture$", architecture);
result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)ProjectSettings::get_singleton()->get("application/config/name") : String(p_preset->get("package/display_name")));
@@ -1046,7 +1046,7 @@ public:
}
virtual void get_export_options(List<ExportOption> *r_options) {
- r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "ARM,x86,x64"), 1));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "arm,x86,x64"), 1));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), ""));
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 2ce55d98be..6d559520d7 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -193,7 +193,10 @@ def configure_msvc(env, manual_msvc_config):
env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
env.AppendUnique(CXXFLAGS=['/TP']) # assume all sources are C++
if manual_msvc_config: # should be automatic if SCons found it
- env.Append(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"])
+ if os.getenv("WindowsSdkDir") is not None:
+ env.Append(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"])
+ else:
+ print("Missing environment variable: WindowsSdkDir")
env.AppendUnique(CPPDEFINES = ['WINDOWS_ENABLED', 'OPENGL_ENABLED',
'RTAUDIO_ENABLED', 'WASAPI_ENABLED',
@@ -211,7 +214,10 @@ def configure_msvc(env, manual_msvc_config):
env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS])
if manual_msvc_config:
- env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"])
+ if os.getenv("WindowsSdkDir") is not None:
+ env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"])
+ else:
+ print("Missing environment variable: WindowsSdkDir")
## LTO
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 363f54fc7b..d6cdea7b88 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -152,6 +152,25 @@ void RedirectIOToConsole() {
// point to console as well
}
+BOOL WINAPI HandlerRoutine(_In_ DWORD dwCtrlType) {
+ if (ScriptDebugger::get_singleton() == NULL)
+ return FALSE;
+
+ switch (dwCtrlType) {
+ case CTRL_C_EVENT:
+ ScriptDebugger::get_singleton()->set_depth(-1);
+ ScriptDebugger::get_singleton()->set_lines_left(1);
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+void OS_Windows::initialize_debugging() {
+
+ SetConsoleCtrlHandler(HandlerRoutine, TRUE);
+}
+
void OS_Windows::initialize_core() {
crash_handler.initialize();
@@ -188,6 +207,10 @@ void OS_Windows::initialize_core() {
ticks_start = 0;
ticks_start = get_ticks_usec();
+ // set minimum resolution for periodic timers, otherwise Sleep(n) may wait at least as
+ // long as the windows scheduler resolution (~16-30ms) even for calls like Sleep(1)
+ timeBeginPeriod(1);
+
process_map = memnew((Map<ProcessID, ProcessInfo>));
IP_Unix::make_default();
@@ -614,6 +637,28 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
maximized = false;
minimized = false;
}
+ if (is_layered_allowed() && layered_window) {
+ DeleteObject(hBitmap);
+
+ RECT r;
+ GetWindowRect(hWnd, &r);
+ dib_size = Size2(r.right - r.left, r.bottom - r.top);
+
+ BITMAPINFO bmi;
+ ZeroMemory(&bmi, sizeof(BITMAPINFO));
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = dib_size.x;
+ bmi.bmiHeader.biHeight = dib_size.y;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = 32;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biSizeImage = dib_size.x, dib_size.y * 4;
+ hBitmap = CreateDIBSection(hDC_dib, &bmi, DIB_RGB_COLORS, (void **)&dib_data, NULL, 0x0);
+ SelectObject(hDC_dib, hBitmap);
+
+ ZeroMemory(dib_data, dib_size.x * dib_size.y * 4);
+ }
+ //return 0; // Jump Back
} break;
case WM_ENTERSIZEMOVE: {
@@ -1128,6 +1173,9 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
SetFocus(hWnd); // Sets Keyboard Focus To
}
+ if (p_desired.layered_splash) {
+ set_window_per_pixel_transparency_enabled(true);
+ }
return OK;
}
@@ -1252,6 +1300,8 @@ void OS_Windows::finalize() {
void OS_Windows::finalize_core() {
+ timeEndPeriod(1);
+
memdelete(process_map);
TCPServerWinsock::cleanup();
@@ -1517,6 +1567,9 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
if (video_mode.fullscreen == p_enabled)
return;
+ if (layered_window)
+ set_window_per_pixel_transparency_enabled(false);
+
if (p_enabled) {
if (pre_fs_valid) {
@@ -1621,10 +1674,97 @@ bool OS_Windows::is_window_always_on_top() const {
return video_mode.always_on_top;
}
+bool OS_Windows::get_window_per_pixel_transparency_enabled() const {
+
+ if (!is_layered_allowed()) return false;
+ return layered_window;
+}
+
+void OS_Windows::set_window_per_pixel_transparency_enabled(bool p_enabled) {
+
+ if (!is_layered_allowed()) return;
+ if (layered_window != p_enabled) {
+ if (p_enabled) {
+ set_borderless_window(true);
+ //enable per-pixel alpha
+ hDC_dib = CreateCompatibleDC(GetDC(hWnd));
+
+ SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
+
+ RECT r;
+ GetWindowRect(hWnd, &r);
+ dib_size = Size2(r.right - r.left, r.bottom - r.top);
+
+ BITMAPINFO bmi;
+ ZeroMemory(&bmi, sizeof(BITMAPINFO));
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biWidth = dib_size.x;
+ bmi.bmiHeader.biHeight = dib_size.y;
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biBitCount = 32;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biSizeImage = dib_size.x * dib_size.y * 4;
+ hBitmap = CreateDIBSection(hDC_dib, &bmi, DIB_RGB_COLORS, (void **)&dib_data, NULL, 0x0);
+ SelectObject(hDC_dib, hBitmap);
+
+ ZeroMemory(dib_data, dib_size.x * dib_size.y * 4);
+
+ layered_window = true;
+ } else {
+ //disable per-pixel alpha
+ layered_window = false;
+
+ SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+
+ //cleanup
+ DeleteObject(hBitmap);
+ DeleteDC(hDC_dib);
+ }
+ }
+}
+
+uint8_t *OS_Windows::get_layered_buffer_data() {
+
+ return (is_layered_allowed() && layered_window) ? dib_data : NULL;
+}
+
+Size2 OS_Windows::get_layered_buffer_size() {
+
+ return (is_layered_allowed() && layered_window) ? dib_size : Size2();
+}
+
+void OS_Windows::swap_layered_buffer() {
+
+ if (is_layered_allowed() && layered_window) {
+
+ //premultiply alpha
+ for (int y = 0; y < dib_size.y; y++) {
+ for (int x = 0; x < dib_size.x; x++) {
+ float alpha = (float)dib_data[y * (int)dib_size.x * 4 + x * 4 + 3] / (float)0xFF;
+ dib_data[y * (int)dib_size.x * 4 + x * 4 + 0] *= alpha;
+ dib_data[y * (int)dib_size.x * 4 + x * 4 + 1] *= alpha;
+ dib_data[y * (int)dib_size.x * 4 + x * 4 + 2] *= alpha;
+ }
+ }
+ //swap layered window buffer
+ POINT ptSrc = { 0, 0 };
+ SIZE sizeWnd = { (long)dib_size.x, (long)dib_size.y };
+ BLENDFUNCTION bf;
+ bf.BlendOp = AC_SRC_OVER;
+ bf.BlendFlags = 0;
+ bf.AlphaFormat = AC_SRC_ALPHA;
+ bf.SourceConstantAlpha = 0xFF;
+ UpdateLayeredWindow(hWnd, NULL, NULL, &sizeWnd, hDC_dib, &ptSrc, 0, &bf, ULW_ALPHA);
+ }
+}
+
void OS_Windows::set_borderless_window(bool p_borderless) {
if (video_mode.borderless_window == p_borderless)
return;
+ if (!p_borderless && layered_window)
+ set_window_per_pixel_transparency_enabled(false);
+
video_mode.borderless_window = p_borderless;
_update_window_style();
@@ -1893,27 +2033,57 @@ void OS_Windows::set_cursor_shape(CursorShape p_shape) {
void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
if (p_cursor.is_valid()) {
Ref<Texture> texture = p_cursor;
- Ref<Image> image = texture->get_data();
+ Ref<AtlasTexture> atlas_texture = p_cursor;
+ Ref<Image> image;
+ Size2 texture_size;
+ Rect2 atlas_rect;
- UINT image_size = texture->get_width() * texture->get_height();
- UINT size = sizeof(UINT) * image_size;
+ if (texture.is_valid()) {
+ image = texture->get_data();
+ }
+
+ if (!image.is_valid() && atlas_texture.is_valid()) {
+ texture = atlas_texture->get_atlas();
- ERR_FAIL_COND(texture->get_width() > 256 || texture->get_height() > 256);
+ atlas_rect.size.width = texture->get_width();
+ atlas_rect.size.height = texture->get_height();
+ atlas_rect.position.x = atlas_texture->get_region().position.x;
+ atlas_rect.position.y = atlas_texture->get_region().position.y;
+
+ texture_size.width = atlas_texture->get_region().size.x;
+ texture_size.height = atlas_texture->get_region().size.y;
+ } else if (image.is_valid()) {
+ texture_size.width = texture->get_width();
+ texture_size.height = texture->get_height();
+ }
+
+ ERR_FAIL_COND(!texture.is_valid());
+ ERR_FAIL_COND(texture_size.width > 256 || texture_size.height > 256);
+
+ image = texture->get_data();
+
+ UINT image_size = texture_size.width * texture_size.height;
+ UINT size = sizeof(UINT) * image_size;
// Create the BITMAP with alpha channel
COLORREF *buffer = (COLORREF *)malloc(sizeof(COLORREF) * image_size);
image->lock();
for (UINT index = 0; index < image_size; index++) {
- int row_index = floor(index / texture->get_width());
- int column_index = index % texture->get_width();
+ int row_index = floor(index / texture_size.width) + atlas_rect.position.y;
+ int column_index = (index % int(texture_size.width)) + atlas_rect.position.x;
+
+ if (atlas_texture.is_valid()) {
+ column_index = MIN(column_index, atlas_rect.size.width - 1);
+ row_index = MIN(row_index, atlas_rect.size.height - 1);
+ }
*(buffer + index) = image->get_pixel(column_index, row_index).to_argb32();
}
image->unlock();
// Using 4 channels, so 4 * 8 bits
- HBITMAP bitmap = CreateBitmap(texture->get_width(), texture->get_height(), 1, 4 * 8, buffer);
+ HBITMAP bitmap = CreateBitmap(texture_size.width, texture_size.height, 1, 4 * 8, buffer);
COLORREF clrTransparent = -1;
// Create the AND and XOR masks for the bitmap
@@ -1947,6 +2117,11 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
if (hXorMask != NULL) {
DeleteObject(hXorMask);
}
+ } else {
+ // Reset to default system cursor
+ cursors[p_shape] = NULL;
+ cursor_shape = CURSOR_MAX;
+ set_cursor_shape(p_shape);
}
}
@@ -2557,6 +2732,8 @@ Error OS_Windows::move_to_trash(const String &p_path) {
OS_Windows::OS_Windows(HINSTANCE _hInstance) {
key_event_pos = 0;
+ layered_window = false;
+ hBitmap = NULL;
force_quit = false;
alt_mem = false;
gr_mem = false;
@@ -2590,6 +2767,10 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
}
OS_Windows::~OS_Windows() {
+ if (is_layered_allowed() && layered_window) {
+ DeleteObject(hBitmap);
+ DeleteDC(hDC_dib);
+ }
#ifdef STDOUT_FILE
fclose(stdo);
#endif
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 3d13627bfa..221109318e 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -93,6 +93,12 @@ class OS_Windows : public OS {
HINSTANCE hInstance; // Holds The Instance Of The Application
HWND hWnd;
+ HBITMAP hBitmap; //DIB section for layered window
+ uint8_t *dib_data;
+ Size2 dib_size;
+ HDC hDC_dib;
+ bool layered_window;
+
uint32_t move_timer_id;
HCURSOR hCursor;
@@ -212,6 +218,13 @@ public:
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window();
+ virtual bool get_window_per_pixel_transparency_enabled() const;
+ virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
+
+ virtual uint8_t *get_layered_buffer_data();
+ virtual Size2 get_layered_buffer_size();
+ virtual void swap_layered_buffer();
+
virtual Error open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path = false);
virtual Error close_dynamic_library(void *p_library_handle);
virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle, bool p_optional = false);
@@ -294,6 +307,7 @@ public:
void disable_crash_handler();
bool is_disable_crash_handler() const;
+ virtual void initialize_debugging();
void force_process_input();
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index 1a7cbc0d6d..cd76667c64 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -116,32 +116,76 @@ Error ContextGL_X11::initialize() {
None
};
+ static int visual_attribs_layered[] = {
+ GLX_RENDER_TYPE, GLX_RGBA_BIT,
+ GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
+ GLX_DOUBLEBUFFER, true,
+ GLX_RED_SIZE, 8,
+ GLX_GREEN_SIZE, 8,
+ GLX_BLUE_SIZE, 8,
+ GLX_ALPHA_SIZE, 8,
+ GLX_DEPTH_SIZE, 24,
+ None
+ };
+
int fbcount;
- GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs, &fbcount);
- ERR_FAIL_COND_V(!fbc, ERR_UNCONFIGURED);
+ GLXFBConfig fbconfig;
+ XVisualInfo *vi = NULL;
+
+ if (OS::get_singleton()->is_layered_allowed()) {
+ GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs_layered, &fbcount);
+ ERR_FAIL_COND_V(!fbc, ERR_UNCONFIGURED);
+
+ for (int i = 0; i < fbcount; i++) {
+ vi = (XVisualInfo *)glXGetVisualFromFBConfig(x11_display, fbc[i]);
+ if (!vi)
+ continue;
+
+ XRenderPictFormat *pict_format = XRenderFindVisualFormat(x11_display, vi->visual);
+ if (!pict_format) {
+ XFree(vi);
+ vi = NULL;
+ continue;
+ }
+
+ fbconfig = fbc[i];
+ if (pict_format->direct.alphaMask > 0) {
+ break;
+ }
+ }
+ ERR_FAIL_COND_V(!fbconfig, ERR_UNCONFIGURED);
+
+ XSetWindowAttributes swa;
+
+ swa.colormap = XCreateColormap(x11_display, RootWindow(x11_display, vi->screen), vi->visual, AllocNone);
+ swa.border_pixel = 0;
+ swa.background_pixmap = None;
+ swa.background_pixel = 0;
+ swa.border_pixmap = None;
+ swa.event_mask = StructureNotifyMask;
+
+ x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask | CWBackPixel, &swa);
- XVisualInfo *vi = glXGetVisualFromFBConfig(x11_display, fbc[0]);
+ } else {
+ GLXFBConfig *fbc = glXChooseFBConfig(x11_display, DefaultScreen(x11_display), visual_attribs, &fbcount);
+ ERR_FAIL_COND_V(!fbc, ERR_UNCONFIGURED);
- XSetWindowAttributes swa;
+ vi = glXGetVisualFromFBConfig(x11_display, fbc[0]);
- swa.colormap = XCreateColormap(x11_display, RootWindow(x11_display, vi->screen), vi->visual, AllocNone);
- swa.border_pixel = 0;
- swa.event_mask = StructureNotifyMask;
+ fbconfig = fbc[0];
- /*
- char* windowid = getenv("GODOT_WINDOWID");
- if (windowid) {
+ XSetWindowAttributes swa;
+
+ swa.colormap = XCreateColormap(x11_display, RootWindow(x11_display, vi->screen), vi->visual, AllocNone);
+ swa.border_pixel = 0;
+ swa.event_mask = StructureNotifyMask;
+
+ x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);
+ }
- //freopen("/home/punto/stdout", "w", stdout);
- //reopen("/home/punto/stderr", "w", stderr);
- x11_window = atol(windowid);
- } else {
- */
- x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa);
ERR_FAIL_COND_V(!x11_window, ERR_UNCONFIGURED);
set_class_hint(x11_display, x11_window);
XMapWindow(x11_display, x11_window);
- //};
int (*oldHandler)(Display *, XErrorEvent *) =
XSetErrorHandler(&ctxErrorHandler);
@@ -160,7 +204,7 @@ Error ContextGL_X11::initialize() {
None
};
- p->glx_context = glXCreateContextAttribsARB(x11_display, fbc[0], NULL, true, context_attribs);
+ p->glx_context = glXCreateContextAttribsARB(x11_display, fbconfig, NULL, true, context_attribs);
ERR_EXPLAIN("Could not obtain an OpenGL 3.0 context!");
ERR_FAIL_COND_V(!p->glx_context, ERR_UNCONFIGURED);
} break;
@@ -175,7 +219,7 @@ Error ContextGL_X11::initialize() {
None
};
- p->glx_context = glXCreateContextAttribsARB(x11_display, fbc[0], NULL, true, context_attribs);
+ p->glx_context = glXCreateContextAttribsARB(x11_display, fbconfig, NULL, true, context_attribs);
ERR_EXPLAIN("Could not obtain an OpenGL 3.3 context!");
ERR_FAIL_COND_V(ctxErrorOccurred || !p->glx_context, ERR_UNCONFIGURED);
} break;
@@ -195,7 +239,6 @@ Error ContextGL_X11::initialize() {
//glXMakeCurrent(x11_display, None, NULL);
XFree(vi);
- XFree(fbc);
return OK;
}
diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h
index b54cc84fac..b8f3eb95d4 100644
--- a/platform/x11/context_gl_x11.h
+++ b/platform/x11/context_gl_x11.h
@@ -41,6 +41,7 @@
#include "drivers/gl_context/context_gl.h"
#include "os/os.h"
#include <X11/Xlib.h>
+#include <X11/extensions/Xrender.h>
struct ContextGL_X11_Private;
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 5820a926e9..ad2620c9f5 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -42,6 +42,11 @@ def can_build():
print("xrandr not found.. x11 disabled.")
return False
+ x11_error = os.system("pkg-config xrender --modversion > /dev/null ")
+ if (x11_error):
+ print("xrender not found.. x11 disabled.")
+ return False
+
return True
def get_opts():
@@ -141,6 +146,7 @@ def configure(env):
env.ParseConfig('pkg-config xcursor --cflags --libs')
env.ParseConfig('pkg-config xinerama --cflags --libs')
env.ParseConfig('pkg-config xrandr --cflags --libs')
+ env.ParseConfig('pkg-config xrender --cflags --libs')
if (env['touch']):
x11_error = os.system("pkg-config xi --modversion > /dev/null ")
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 336068cb1e..eec371865e 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -517,6 +517,10 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
power_manager = memnew(PowerX11);
+ if (p_desired.layered_splash) {
+ set_window_per_pixel_transparency_enabled(true);
+ }
+
XEvent xevent;
while (XPending(x11_display) > 0) {
XNextEvent(x11_display, &xevent);
@@ -707,6 +711,25 @@ Point2 OS_X11::get_mouse_position() const {
return last_mouse_pos;
}
+bool OS_X11::get_window_per_pixel_transparency_enabled() const {
+
+ if (!is_layered_allowed()) return false;
+ return layered_window;
+}
+
+void OS_X11::set_window_per_pixel_transparency_enabled(bool p_enabled) {
+
+ if (!is_layered_allowed()) return;
+ if (layered_window != p_enabled) {
+ if (p_enabled) {
+ set_borderless_window(true);
+ layered_window = true;
+ } else {
+ layered_window = false;
+ }
+ }
+}
+
void OS_X11::set_window_title(const String &p_title) {
XStoreName(x11_display, x11_window, p_title.utf8().get_data());
@@ -1006,9 +1029,13 @@ void OS_X11::set_window_size(const Size2 p_size) {
}
void OS_X11::set_window_fullscreen(bool p_enabled) {
+
if (current_videomode.fullscreen == p_enabled)
return;
+ if (layered_window)
+ set_window_per_pixel_transparency_enabled(false);
+
if (p_enabled && current_videomode.always_on_top) {
// Fullscreen + Always-on-top requires a maximized window on some window managers (Metacity)
set_window_maximized(true);
@@ -1254,6 +1281,9 @@ void OS_X11::set_borderless_window(bool p_borderless) {
if (current_videomode.borderless_window == p_borderless)
return;
+ if (!p_borderless && layered_window)
+ set_window_per_pixel_transparency_enabled(false);
+
current_videomode.borderless_window = p_borderless;
Hints hints;
@@ -2390,13 +2420,38 @@ void OS_X11::set_cursor_shape(CursorShape p_shape) {
void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
if (p_cursor.is_valid()) {
Ref<Texture> texture = p_cursor;
- Ref<Image> image = texture->get_data();
+ Ref<AtlasTexture> atlas_texture = p_cursor;
+ Ref<Image> image;
+ Size2 texture_size;
+ Rect2 atlas_rect;
+
+ if (texture.is_valid()) {
+ image = texture->get_data();
+ }
+
+ if (!image.is_valid() && atlas_texture.is_valid()) {
+ texture = atlas_texture->get_atlas();
+
+ atlas_rect.size.width = texture->get_width();
+ atlas_rect.size.height = texture->get_height();
+ atlas_rect.position.x = atlas_texture->get_region().position.x;
+ atlas_rect.position.y = atlas_texture->get_region().position.y;
+
+ texture_size.width = atlas_texture->get_region().size.x;
+ texture_size.height = atlas_texture->get_region().size.y;
+ } else if (image.is_valid()) {
+ texture_size.width = texture->get_width();
+ texture_size.height = texture->get_height();
+ }
- ERR_FAIL_COND(texture->get_width() > 256 || texture->get_height() > 256);
+ ERR_FAIL_COND(!texture.is_valid());
+ ERR_FAIL_COND(texture_size.width > 256 || texture_size.height > 256);
+
+ image = texture->get_data();
// Create the cursor structure
- XcursorImage *cursor_image = XcursorImageCreate(texture->get_width(), texture->get_height());
- XcursorUInt image_size = texture->get_width() * texture->get_height();
+ XcursorImage *cursor_image = XcursorImageCreate(texture_size.width, texture_size.height);
+ XcursorUInt image_size = texture_size.width * texture_size.height;
XcursorDim size = sizeof(XcursorPixel) * image_size;
cursor_image->version = 1;
@@ -2410,8 +2465,13 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
image->lock();
for (XcursorPixel index = 0; index < image_size; index++) {
- int row_index = floor(index / texture->get_width());
- int column_index = index % texture->get_width();
+ int row_index = floor(index / texture_size.width) + atlas_rect.position.y;
+ int column_index = (index % int(texture_size.width)) + atlas_rect.position.x;
+
+ if (atlas_texture.is_valid()) {
+ column_index = MIN(column_index, atlas_rect.size.width - 1);
+ row_index = MIN(row_index, atlas_rect.size.height - 1);
+ }
*(cursor_image->pixels + index) = image->get_pixel(column_index, row_index).to_argb32();
}
@@ -2426,6 +2486,14 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
if (p_shape == CURSOR_ARROW) {
XDefineCursor(x11_display, x11_window, cursors[p_shape]);
}
+ } else {
+ // Reset to default system cursor
+ if (img[p_shape]) {
+ cursors[p_shape] = XcursorImageLoadCursor(x11_display, img[p_shape]);
+ }
+
+ current_cursor = CURSOR_MAX;
+ set_cursor_shape(p_shape);
}
}
@@ -2715,6 +2783,7 @@ OS_X11::OS_X11() {
AudioDriverManager::add_driver(&driver_alsa);
#endif
+ layered_window = false;
minimized = false;
xim_style = 0L;
mouse_mode = MOUSE_MODE_VISIBLE;
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 0a39da77de..09ed9588c4 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -172,6 +172,8 @@ class OS_X11 : public OS_Unix {
PowerX11 *power_manager;
+ bool layered_window;
+
CrashHandler crash_handler;
int audio_driver_index;
@@ -263,6 +265,10 @@ public:
virtual void set_borderless_window(bool p_borderless);
virtual bool get_borderless_window();
+
+ virtual bool get_window_per_pixel_transparency_enabled() const;
+ virtual void set_window_per_pixel_transparency_enabled(bool p_enabled);
+
virtual void set_ime_position(const Point2 &p_pos);
virtual String get_unique_id() const;
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index 447bd9a090..54194ff543 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -351,7 +351,7 @@ void AnimatedSprite::_notification(int p_what) {
if (frame < 0)
return;
- float speed = frames->get_animation_speed(animation);
+ float speed = frames->get_animation_speed(animation) * speed_scale;
if (speed == 0)
return; //do nothing
@@ -361,7 +361,7 @@ void AnimatedSprite::_notification(int p_what) {
if (timeout <= 0) {
- timeout = 1.0 / speed;
+ timeout = _get_frame_duration();
int fc = frames->get_frame_count(animation);
if (frame >= fc - 1) {
@@ -481,6 +481,22 @@ int AnimatedSprite::get_frame() const {
return frame;
}
+void AnimatedSprite::set_speed_scale(float p_speed_scale) {
+
+ float elapsed = _get_frame_duration() - timeout;
+
+ speed_scale = MAX(p_speed_scale, 0.0f);
+
+ // We adapt the timeout so that the animation speed adapts as soon as the speed scale is changed
+ _reset_timeout();
+ timeout -= elapsed;
+}
+
+float AnimatedSprite::get_speed_scale() const {
+
+ return speed_scale;
+}
+
void AnimatedSprite::set_centered(bool p_center) {
centered = p_center;
@@ -564,21 +580,22 @@ bool AnimatedSprite::is_playing() const {
return playing;
}
+float AnimatedSprite::_get_frame_duration() {
+ if (frames.is_valid() && frames->has_animation(animation)) {
+ float speed = frames->get_animation_speed(animation) * speed_scale;
+ if (speed > 0) {
+ return 1.0 / speed;
+ }
+ }
+ return 0.0;
+}
+
void AnimatedSprite::_reset_timeout() {
if (!playing)
return;
- if (frames.is_valid() && frames->has_animation(animation)) {
- float speed = frames->get_animation_speed(animation);
- if (speed > 0) {
- timeout = 1.0 / speed;
- } else {
- timeout = 0;
- }
- } else {
- timeout = 0;
- }
+ timeout = _get_frame_duration();
}
void AnimatedSprite::set_animation(const StringName &p_animation) {
@@ -636,6 +653,9 @@ void AnimatedSprite::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_frame", "frame"), &AnimatedSprite::set_frame);
ClassDB::bind_method(D_METHOD("get_frame"), &AnimatedSprite::get_frame);
+ ClassDB::bind_method(D_METHOD("set_speed_scale", "speed_scale"), &AnimatedSprite::set_speed_scale);
+ ClassDB::bind_method(D_METHOD("get_speed_scale"), &AnimatedSprite::get_speed_scale);
+
ClassDB::bind_method(D_METHOD("_res_changed"), &AnimatedSprite::_res_changed);
ADD_SIGNAL(MethodInfo("frame_changed"));
@@ -644,6 +664,7 @@ void AnimatedSprite::_bind_methods() {
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE, "SpriteFrames"), "set_sprite_frames", "get_sprite_frames");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "animation"), "set_animation", "get_animation");
ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "frame", PROPERTY_HINT_SPRITE_FRAME), "set_frame", "get_frame");
+ ADD_PROPERTYNO(PropertyInfo(Variant::REAL, "speed_scale"), "set_speed_scale", "get_speed_scale");
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
@@ -658,6 +679,7 @@ AnimatedSprite::AnimatedSprite() {
vflip = false;
frame = 0;
+ speed_scale = 1.0f;
playing = false;
animation = "default";
timeout = 0;
diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h
index c7606d88aa..be5b1ef6d6 100644
--- a/scene/2d/animated_sprite.h
+++ b/scene/2d/animated_sprite.h
@@ -129,6 +129,7 @@ class AnimatedSprite : public Node2D {
bool playing;
StringName animation;
int frame;
+ float speed_scale;
bool centered;
Point2 offset;
@@ -140,6 +141,7 @@ class AnimatedSprite : public Node2D {
void _res_changed();
+ float _get_frame_duration();
void _reset_timeout();
void _set_playing(bool p_playing);
bool _is_playing() const;
@@ -172,6 +174,9 @@ public:
void set_frame(int p_frame);
int get_frame() const;
+ void set_speed_scale(float p_speed_scale);
+ float get_speed_scale() const;
+
void set_centered(bool p_center);
bool is_centered() const;
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index a2637f816e..27bdeda4a8 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -94,6 +94,7 @@ void CanvasItemMaterial::_update_shader() {
case BLEND_MODE_SUB: code += "blend_sub"; break;
case BLEND_MODE_MUL: code += "blend_mul"; break;
case BLEND_MODE_PREMULT_ALPHA: code += "blend_premul_alpha"; break;
+ case BLEND_MODE_DISABLED: code += "blend_disabled"; break;
}
switch (light_mode) {
@@ -1105,6 +1106,7 @@ void CanvasItem::_bind_methods() {
BIND_ENUM_CONSTANT(BLEND_MODE_SUB);
BIND_ENUM_CONSTANT(BLEND_MODE_MUL);
BIND_ENUM_CONSTANT(BLEND_MODE_PREMULT_ALPHA);
+ BIND_ENUM_CONSTANT(BLEND_MODE_DISABLED);
BIND_CONSTANT(NOTIFICATION_TRANSFORM_CHANGED);
BIND_CONSTANT(NOTIFICATION_DRAW);
diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h
index 85de0d2796..10d5082dfc 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -54,7 +54,8 @@ public:
BLEND_MODE_ADD,
BLEND_MODE_SUB,
BLEND_MODE_MUL,
- BLEND_MODE_PREMULT_ALPHA
+ BLEND_MODE_PREMULT_ALPHA,
+ BLEND_MODE_DISABLED
};
enum LightMode {
@@ -145,7 +146,8 @@ public:
BLEND_MODE_ADD,
BLEND_MODE_SUB,
BLEND_MODE_MUL,
- BLEND_MODE_PREMULT_ALPHA
+ BLEND_MODE_PREMULT_ALPHA,
+ BLEND_MODE_DISABLED
};
private:
diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp
index d4481583fb..c9e5d0f1bc 100644
--- a/scene/2d/light_occluder_2d.cpp
+++ b/scene/2d/light_occluder_2d.cpp
@@ -107,12 +107,12 @@ OccluderPolygon2D::~OccluderPolygon2D() {
VS::get_singleton()->free(occ_polygon);
}
-#ifdef DEBUG_ENABLED
void LightOccluder2D::_poly_changed() {
+#ifdef DEBUG_ENABLED
update();
-}
#endif
+}
void LightOccluder2D::_notification(int p_what) {
@@ -221,9 +221,7 @@ void LightOccluder2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_occluder_light_mask", "mask"), &LightOccluder2D::set_occluder_light_mask);
ClassDB::bind_method(D_METHOD("get_occluder_light_mask"), &LightOccluder2D::get_occluder_light_mask);
-#ifdef DEBUG_ENABLED
ClassDB::bind_method("_poly_changed", &LightOccluder2D::_poly_changed);
-#endif
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "occluder", PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D"), "set_occluder_polygon", "get_occluder_polygon");
ADD_PROPERTY(PropertyInfo(Variant::INT, "light_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_occluder_light_mask", "get_occluder_light_mask");
diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h
index 5e16351a6f..d59c9100b0 100644
--- a/scene/2d/light_occluder_2d.h
+++ b/scene/2d/light_occluder_2d.h
@@ -78,9 +78,7 @@ class LightOccluder2D : public Node2D {
int mask;
Ref<OccluderPolygon2D> occluder_polygon;
-#ifdef DEBUG_ENABLED
void _poly_changed();
-#endif
protected:
void _notification(int p_what);
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index 229c2c6fe8..3e61dd05f4 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -270,7 +270,8 @@ void Line2D::_draw() {
lb.indices,
lb.vertices,
lb.colors,
- lb.uvs,
+ lb.uvs, Vector<int>(), Vector<float>(),
+
texture_rid);
// DEBUG
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp
index 584c2f2c85..2ac6c76032 100644
--- a/scene/2d/parallax_layer.cpp
+++ b/scene/2d/parallax_layer.cpp
@@ -120,7 +120,6 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, float p_sc
if (mirroring.x) {
double den = mirroring.x * p_scale;
- double before = new_ofs.x;
new_ofs.x -= den * ceil(new_ofs.x / den);
}
diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp
index eed26f5399..4d6ebc81c3 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -30,7 +30,7 @@
#include "polygon_2d.h"
#include "core/math/geometry.h"
-
+#include "skeleton_2d.h"
Dictionary Polygon2D::_edit_get_state() const {
Dictionary state = Node2D::_edit_get_state();
state["offset"] = offset;
@@ -91,8 +91,20 @@ void Polygon2D::_notification(int p_what) {
if (polygon.size() < 3)
return;
+ Skeleton2D *skeleton_node = NULL;
+ if (has_node(skeleton)) {
+ skeleton_node = Object::cast_to<Skeleton2D>(get_node(skeleton));
+ }
+
+ if (skeleton_node)
+ VS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), skeleton_node->get_skeleton());
+ else
+ VS::get_singleton()->canvas_item_attach_skeleton(get_canvas_item(), RID());
+
Vector<Vector2> points;
Vector<Vector2> uvs;
+ Vector<int> bones;
+ Vector<float> weights;
points.resize(polygon.size());
@@ -180,6 +192,70 @@ void Polygon2D::_notification(int p_what) {
}
}
+ if (!invert && bone_weights.size()) {
+ //a skeleton is set! fill indices and weights
+ int vc = points.size();
+ bones.resize(vc * 4);
+ weights.resize(vc * 4);
+
+ int *bonesw = bones.ptrw();
+ float *weightsw = weights.ptrw();
+
+ for (int i = 0; i < vc * 4; i++) {
+ bonesw[i] = 0;
+ weightsw[i] = 0;
+ }
+
+ for (int i = 0; i < bone_weights.size(); i++) {
+ if (bone_weights[i].weights.size() != points.size()) {
+ continue; //different number of vertices, sorry not using.
+ }
+ if (!skeleton_node->has_node(bone_weights[i].path)) {
+ continue; //node does not exist
+ }
+ Bone2D *bone = Object::cast_to<Bone2D>(skeleton_node->get_node(bone_weights[i].path));
+ if (!bone) {
+ continue;
+ }
+
+ int bone_index = bone->get_index_in_skeleton();
+ PoolVector<float>::Read r = bone_weights[i].weights.read();
+ for (int j = 0; j < vc; j++) {
+ if (r[j] == 0.0)
+ continue; //weight is unpainted, skip
+ //find an index with a weight
+ for (int k = 0; k < 4; k++) {
+ if (weightsw[j * 4 + k] < r[j]) {
+ //this is less than this weight, insert weight!
+ for (int l = 3; l > k; l--) {
+ weightsw[j * 4 + l] = weightsw[j * 4 + l - 1];
+ bonesw[j * 4 + l] = bonesw[j * 4 + l - 1];
+ }
+ weightsw[j * 4 + k] = r[j];
+ bonesw[j * 4 + k] = bone_index;
+ break;
+ }
+ }
+ }
+ }
+
+ //normalize the weights
+ for (int i = 0; i < vc; i++) {
+ float tw = 0;
+ for (int j = 0; j < 4; j++) {
+ tw += weightsw[i * 4 + j];
+ }
+ if (tw == 0)
+ continue; //unpainted, do nothing
+
+ //normalize
+ for (int j = 0; j < 4; j++) {
+ weightsw[i * 4 + j] /= tw;
+ // print_line("point " + itos(i) + " idx " + itos(j) + " index: " + itos(bonesw[i * 4 + j]) + " weight: " + rtos(weightsw[i * 4 + j]));
+ }
+ }
+ }
+
Vector<Color> colors;
int color_len = vertex_colors.size();
colors.resize(len);
@@ -197,7 +273,8 @@ void Polygon2D::_notification(int p_what) {
// VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, texture.is_valid() ? texture->get_rid() : RID());
if (invert || splits.size() == 0) {
- VS::get_singleton()->canvas_item_add_polygon(get_canvas_item(), points, colors, uvs, texture.is_valid() ? texture->get_rid() : RID(), RID(), antialiased);
+ Vector<int> indices = Geometry::triangulate_polygon(points);
+ VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
} else {
//use splits
Vector<int> loop;
@@ -268,7 +345,7 @@ void Polygon2D::_notification(int p_what) {
//print_line("loops: " + itos(loops.size()) + " indices: " + itos(indices.size()));
- VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, texture.is_valid() ? texture->get_rid() : RID());
+ VS::get_singleton()->canvas_item_add_triangle_array(get_canvas_item(), indices, points, colors, uvs, bones, weights, texture.is_valid() ? texture->get_rid() : RID());
}
} break;
@@ -488,9 +565,12 @@ void Polygon2D::_set_bones(const Array &p_bones) {
}
void Polygon2D::set_skeleton(const NodePath &p_skeleton) {
+ if (skeleton == p_skeleton)
+ return;
skeleton = p_skeleton;
update();
}
+
NodePath Polygon2D::get_skeleton() const {
return skeleton;
}
diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp
index 3b3561bc1c..2363c791fa 100644
--- a/scene/2d/skeleton_2d.cpp
+++ b/scene/2d/skeleton_2d.cpp
@@ -28,6 +28,11 @@ void Bone2D::_notification(int p_what) {
skeleton->_make_transform_dirty();
}
}
+ if (p_what == NOTIFICATION_MOVED_IN_PARENT) {
+ if (skeleton) {
+ skeleton->_make_bone_setup_dirty();
+ }
+ }
if (p_what == NOTIFICATION_EXIT_TREE) {
if (skeleton) {
@@ -48,12 +53,22 @@ void Bone2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_rest", "rest"), &Bone2D::set_rest);
ClassDB::bind_method(D_METHOD("get_rest"), &Bone2D::get_rest);
ClassDB::bind_method(D_METHOD("apply_rest"), &Bone2D::apply_rest);
+ ClassDB::bind_method(D_METHOD("get_skeleton_rest"), &Bone2D::get_skeleton_rest);
+ ClassDB::bind_method(D_METHOD("get_index_in_skeleton"), &Bone2D::get_index_in_skeleton);
+
+ ClassDB::bind_method(D_METHOD("set_default_length", "default_length"), &Bone2D::set_default_length);
+ ClassDB::bind_method(D_METHOD("get_default_length"), &Bone2D::get_default_length);
+
+ ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"rest"),"set_rest","get_rest");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL,"default_length",PROPERTY_HINT_RANGE,"1,1024,1"),"set_default_length","get_default_length");
}
void Bone2D::set_rest(const Transform2D &p_rest) {
rest = p_rest;
if (skeleton)
skeleton->_make_bone_setup_dirty();
+
+ update_configuration_warning();
}
Transform2D Bone2D::get_rest() const {
@@ -73,22 +88,56 @@ void Bone2D::apply_rest() {
set_transform(rest);
}
+void Bone2D::set_default_length(float p_length) {
+
+ default_length=p_length;
+
+}
+
+float Bone2D::get_default_length() const {
+ return default_length;
+}
+
+int Bone2D::get_index_in_skeleton() const {
+ ERR_FAIL_COND_V(!skeleton,-1);
+ skeleton->_update_bone_setup();
+ return skeleton_index;
+}
String Bone2D::get_configuration_warning() const {
+
+ String warning = Node2D::get_configuration_warning();
if (!skeleton) {
+ if (warning!=String()) {
+ warning+="\n";
+ }
if (parent_bone) {
- return TTR("This Bone2D chain should end at a Skeleton2D node.");
+ warning+=TTR("This Bone2D chain should end at a Skeleton2D node.");
} else {
- return TTR("A Bone2D only works with a Skeleton2D or another Bone2D as parent node.");
+ warning+=TTR("A Bone2D only works with a Skeleton2D or another Bone2D as parent node.");
}
}
- return Node2D::get_configuration_warning();
+ if (rest==Transform2D(0,0,0,0,0,0)) {
+ if (warning!=String()) {
+ warning+="\n";
+ }
+ warning+=TTR("This bone lacks a proper REST pose. Go to the Skeleton2D node and set one.");
+
+ }
+
+ return warning;
}
Bone2D::Bone2D() {
skeleton = NULL;
parent_bone = NULL;
+ skeleton_index=-1;
+ default_length=16;
set_notify_local_transform(true);
+ //this is a clever hack so the bone knows no rest has been set yet, allowing to show an error.
+ for(int i=0;i<3;i++) {
+ rest[i]=Vector2(0,0);
+ }
}
//////////////////////////////////////
@@ -114,7 +163,14 @@ void Skeleton2D::_update_bone_setup() {
bones.sort(); //sorty so they are always in the same order/index
for (int i = 0; i < bones.size(); i++) {
- bones[i].rest_inverse = bones[i].bone->get_skeleton_rest(); //bind pose
+ bones[i].rest_inverse = bones[i].bone->get_skeleton_rest().affine_inverse(); //bind pose
+ bones[i].bone->skeleton_index=i;
+ Bone2D *parent_bone = Object::cast_to<Bone2D>(bones[i].bone->get_parent());
+ if (parent_bone) {
+ bones[i].parent_index=parent_bone->skeleton_index;
+ } else {
+ bones[i].parent_index=-1;
+ }
}
transform_dirty = true;
@@ -142,13 +198,20 @@ void Skeleton2D::_update_transform() {
transform_dirty = false;
- Transform2D global_xform = get_global_transform();
- Transform2D global_xform_inverse = global_xform.affine_inverse();
+ for (int i = 0; i < bones.size(); i++) {
+
+ ERR_CONTINUE(bones[i].parent_index>=i);
+ if (bones[i].parent_index>=0) {
+ bones[i].accum_transform = bones[bones[i].parent_index].accum_transform * bones[i].bone->get_transform();
+ } else {
+ bones[i].accum_transform = bones[i].bone->get_transform();
+ }
+ }
for (int i = 0; i < bones.size(); i++) {
- Transform2D final_xform = bones[i].rest_inverse * bones[i].bone->get_relative_transform_to_parent(this);
- VS::get_singleton()->skeleton_bone_set_transform_2d(skeleton, i, global_xform * (final_xform * global_xform_inverse));
+ Transform2D final_xform = bones[i].accum_transform * bones[i].rest_inverse;
+ VS::get_singleton()->skeleton_bone_set_transform_2d(skeleton, i, final_xform);
}
}
@@ -179,10 +242,12 @@ void Skeleton2D::_notification(int p_what) {
_update_bone_setup();
if (transform_dirty)
_update_transform();
+
+ request_ready();
}
if (p_what == NOTIFICATION_TRANSFORM_CHANGED) {
- _make_transform_dirty();
+ VS::get_singleton()->skeleton_set_base_transform_2d(skeleton,get_global_transform());
}
}
@@ -203,6 +268,7 @@ void Skeleton2D::_bind_methods() {
Skeleton2D::Skeleton2D() {
bone_setup_dirty = true;
transform_dirty = true;
+
skeleton = VS::get_singleton()->skeleton_create();
}
diff --git a/scene/2d/skeleton_2d.h b/scene/2d/skeleton_2d.h
index 49199f684f..cd270dac85 100644
--- a/scene/2d/skeleton_2d.h
+++ b/scene/2d/skeleton_2d.h
@@ -11,6 +11,10 @@ class Bone2D : public Node2D {
Bone2D *parent_bone;
Skeleton2D *skeleton;
Transform2D rest;
+ float default_length;
+
+friend class Skeleton2D;
+ int skeleton_index;
protected:
void _notification(int p_what);
@@ -24,6 +28,11 @@ public:
String get_configuration_warning() const;
+ void set_default_length(float p_length);
+ float get_default_length() const;
+
+ int get_index_in_skeleton() const;
+
Bone2D();
};
@@ -37,6 +46,8 @@ class Skeleton2D : public Node2D {
return p_bone.bone->is_greater_than(bone);
}
Bone2D *bone;
+ int parent_index;
+ Transform2D accum_transform;
Transform2D rest_inverse;
};
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index bc39368c88..64d0771fab 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -68,31 +68,31 @@ bool Sprite::_edit_use_rect() const {
void Sprite::_get_rects(Rect2 &r_src_rect, Rect2 &r_dst_rect, bool &r_filter_clip) const {
- Size2 s;
- r_filter_clip = false;
+ Rect2 base_rect;
if (region) {
-
- s = region_rect.size;
- r_src_rect = region_rect;
r_filter_clip = region_filter_clip;
+ base_rect = region_rect;
} else {
- s = Size2(texture->get_size());
- s = s / Size2(hframes, vframes);
-
- r_src_rect.size = s;
- r_src_rect.position.x = float(frame % hframes) * s.x;
- r_src_rect.position.y = float(frame / hframes) * s.y;
+ r_filter_clip = false;
+ base_rect = Rect2(0, 0, texture->get_width(), texture->get_height());
}
- Point2 ofs = offset;
+ Size2 frame_size = base_rect.size / Size2(hframes, vframes);
+ Point2 frame_offset = Point2(frame % hframes, frame / hframes);
+ frame_offset *= frame_size;
+
+ r_src_rect.size = frame_size;
+ r_src_rect.position = base_rect.position + frame_offset;
+
+ Point2 dest_offset = offset;
if (centered)
- ofs -= s / 2;
+ dest_offset -= frame_size / 2;
if (Engine::get_singleton()->get_use_pixel_snap()) {
- ofs = ofs.floor();
+ dest_offset = dest_offset.floor();
}
- r_dst_rect = Rect2(ofs, s);
+ r_dst_rect = Rect2(dest_offset, frame_size);
if (hflip)
r_dst_rect.size.x = -r_dst_rect.size.x;
@@ -375,13 +375,13 @@ Rect2 Sprite::get_rect() const {
Size2i s;
if (region) {
-
s = region_rect.size;
} else {
s = texture->get_size();
- s = s / Point2(hframes, vframes);
}
+ s = s / Point2(hframes, vframes);
+
Point2 ofs = offset;
if (centered)
ofs -= s / 2;
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 3d3f43d5c6..60766862cc 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -845,13 +845,13 @@ void TileMap::update_cell_bitmask(int p_x, int p_y) {
mask |= TileSet::BIND_BOTTOMRIGHT;
}
} else if (tile_set->autotile_get_bitmask_mode(id) == TileSet::BITMASK_3X3) {
- if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y))) {
+ if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y - 1))) {
mask |= TileSet::BIND_TOPLEFT;
}
if (tile_set->is_tile_bound(id, get_cell(p_x, p_y - 1))) {
mask |= TileSet::BIND_TOP;
}
- if (tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x, p_y - 1)) && tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y))) {
+ if (tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y - 1))) {
mask |= TileSet::BIND_TOPRIGHT;
}
if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y))) {
@@ -861,13 +861,13 @@ void TileMap::update_cell_bitmask(int p_x, int p_y) {
if (tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y))) {
mask |= TileSet::BIND_RIGHT;
}
- if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y + 1)) && tile_set->is_tile_bound(id, get_cell(p_x, p_y + 1)) && tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y))) {
+ if (tile_set->is_tile_bound(id, get_cell(p_x - 1, p_y + 1))) {
mask |= TileSet::BIND_BOTTOMLEFT;
}
if (tile_set->is_tile_bound(id, get_cell(p_x, p_y + 1))) {
mask |= TileSet::BIND_BOTTOM;
}
- if (tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y + 1)) && tile_set->is_tile_bound(id, get_cell(p_x, p_y + 1)) && tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y))) {
+ if (tile_set->is_tile_bound(id, get_cell(p_x + 1, p_y + 1))) {
mask |= TileSet::BIND_BOTTOMRIGHT;
}
}
diff --git a/scene/3d/camera.h b/scene/3d/camera.h
index 109bf3adc6..1b506e0c4f 100644
--- a/scene/3d/camera.h
+++ b/scene/3d/camera.h
@@ -132,9 +132,9 @@ public:
virtual Transform get_camera_transform() const;
- Vector3 project_ray_normal(const Point2 &p_pos) const;
+ virtual Vector3 project_ray_normal(const Point2 &p_pos) const;
virtual Vector3 project_ray_origin(const Point2 &p_pos) const;
- Vector3 project_local_ray_normal(const Point2 &p_pos) const;
+ virtual Vector3 project_local_ray_normal(const Point2 &p_pos) const;
virtual Point2 unproject_position(const Vector3 &p_pos) const;
bool is_position_behind(const Vector3 &p_pos) const;
virtual Vector3 project_position(const Point2 &p_point) const;
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp
index d1bd059b63..a39ac5a8f5 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -1227,28 +1227,19 @@ void ParticlesMaterial::set_emission_box_extents(Vector3 p_extents) {
void ParticlesMaterial::set_emission_point_texture(const Ref<Texture> &p_points) {
emission_point_texture = p_points;
- RID texture;
- if (p_points.is_valid())
- texture = p_points->get_rid();
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, texture);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_points, p_points);
}
void ParticlesMaterial::set_emission_normal_texture(const Ref<Texture> &p_normals) {
emission_normal_texture = p_normals;
- RID texture;
- if (p_normals.is_valid())
- texture = p_normals->get_rid();
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, texture);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_normal, p_normals);
}
void ParticlesMaterial::set_emission_color_texture(const Ref<Texture> &p_colors) {
emission_color_texture = p_colors;
- RID texture;
- if (p_colors.is_valid())
- texture = p_colors->get_rid();
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, texture);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->emission_texture_color, p_colors);
_queue_shader_change();
}
@@ -1310,10 +1301,7 @@ void ParticlesMaterial::set_trail_size_modifier(const Ref<CurveTexture> &p_trail
curve->ensure_default_setup();
}
- RID texture;
- if (p_trail_size_modifier.is_valid())
- texture = p_trail_size_modifier->get_rid();
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_size_modifier, texture);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_size_modifier, curve);
_queue_shader_change();
}
@@ -1325,10 +1313,7 @@ Ref<CurveTexture> ParticlesMaterial::get_trail_size_modifier() const {
void ParticlesMaterial::set_trail_color_modifier(const Ref<GradientTexture> &p_trail_color_modifier) {
trail_color_modifier = p_trail_color_modifier;
- RID texture;
- if (p_trail_color_modifier.is_valid())
- texture = p_trail_color_modifier->get_rid();
- VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_color_modifier, texture);
+ VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->trail_color_modifier, p_trail_color_modifier);
_queue_shader_change();
}
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 9aac391d80..0577a23ea6 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -34,6 +34,10 @@
#include "method_bind_ext.gen.inc"
#include "scene/scene_string_names.h"
+#ifdef TOOLS_ENABLED
+#include "editor/plugins/spatial_editor_plugin.h"
+#endif
+
void PhysicsBody::_notification(int p_what) {
/*
@@ -1266,3 +1270,1112 @@ KinematicCollision::KinematicCollision() {
collision.local_shape = 0;
owner = NULL;
}
+
+///////////////////////////////////////
+
+bool PhysicalBone::JointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ return false;
+}
+
+bool PhysicalBone::JointData::_get(const StringName &p_name, Variant &r_ret) const {
+ return false;
+}
+
+void PhysicalBone::JointData::_get_property_list(List<PropertyInfo> *p_list) const {
+}
+
+bool PhysicalBone::PinJointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ if (JointData::_set(p_name, p_value, j)) {
+ return true;
+ }
+
+ if ("joint_constraints/bias" == p_name) {
+ bias = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_BIAS, bias);
+
+ } else if ("joint_constraints/damping" == p_name) {
+ damping = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_DAMPING, damping);
+
+ } else if ("joint_constraints/impulse_clamp" == p_name) {
+ impulse_clamp = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->pin_joint_set_param(j, PhysicsServer::PIN_JOINT_IMPULSE_CLAMP, impulse_clamp);
+
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool PhysicalBone::PinJointData::_get(const StringName &p_name, Variant &r_ret) const {
+ if (JointData::_get(p_name, r_ret)) {
+ return true;
+ }
+
+ if ("joint_constraints/bias" == p_name) {
+ r_ret = bias;
+ } else if ("joint_constraints/damping" == p_name) {
+ r_ret = damping;
+ } else if ("joint_constraints/impulse_clamp" == p_name) {
+ r_ret = impulse_clamp;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void PhysicalBone::PinJointData::_get_property_list(List<PropertyInfo> *p_list) const {
+ JointData::_get_property_list(p_list);
+
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/damping", PROPERTY_HINT_RANGE, "0.01,8.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/impulse_clamp", PROPERTY_HINT_RANGE, "0.0,64.0,0.01"));
+}
+
+bool PhysicalBone::ConeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ if (JointData::_set(p_name, p_value, j)) {
+ return true;
+ }
+
+ if ("joint_constraints/swing_span" == p_name) {
+ swing_span = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN, swing_span);
+
+ } else if ("joint_constraints/twist_span" == p_name) {
+ twist_span = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN, twist_span);
+
+ } else if ("joint_constraints/bias" == p_name) {
+ bias = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_BIAS, bias);
+
+ } else if ("joint_constraints/softness" == p_name) {
+ softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_SOFTNESS, softness);
+
+ } else if ("joint_constraints/relaxation" == p_name) {
+ relaxation = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(j, PhysicsServer::CONE_TWIST_JOINT_RELAXATION, relaxation);
+
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool PhysicalBone::ConeJointData::_get(const StringName &p_name, Variant &r_ret) const {
+ if (JointData::_get(p_name, r_ret)) {
+ return true;
+ }
+
+ if ("joint_constraints/swing_span" == p_name) {
+ r_ret = Math::rad2deg(swing_span);
+ } else if ("joint_constraints/twist_span" == p_name) {
+ r_ret = Math::rad2deg(twist_span);
+ } else if ("joint_constraints/bias" == p_name) {
+ r_ret = bias;
+ } else if ("joint_constraints/softness" == p_name) {
+ r_ret = softness;
+ } else if ("joint_constraints/relaxation" == p_name) {
+ r_ret = relaxation;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void PhysicalBone::ConeJointData::_get_property_list(List<PropertyInfo> *p_list) const {
+ JointData::_get_property_list(p_list);
+
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/swing_span", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/twist_span", PROPERTY_HINT_RANGE, "-40000,40000,0.1"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/bias", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/relaxation", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+}
+
+bool PhysicalBone::HingeJointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ if (JointData::_set(p_name, p_value, j)) {
+ return true;
+ }
+
+ if ("joint_constraints/angular_limit_enabled" == p_name) {
+ angular_limit_enabled = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_flag(j, PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT, angular_limit_enabled);
+
+ } else if ("joint_constraints/angular_limit_upper" == p_name) {
+ angular_limit_upper = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_UPPER, angular_limit_upper);
+
+ } else if ("joint_constraints/angular_limit_lower" == p_name) {
+ angular_limit_lower = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_LOWER, angular_limit_lower);
+
+ } else if ("joint_constraints/angular_limit_bias" == p_name) {
+ angular_limit_bias = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_BIAS, angular_limit_bias);
+
+ } else if ("joint_constraints/angular_limit_softness" == p_name) {
+ angular_limit_softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS, angular_limit_softness);
+
+ } else if ("joint_constraints/angular_limit_relaxation" == p_name) {
+ angular_limit_relaxation = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->hinge_joint_set_param(j, PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION, angular_limit_relaxation);
+
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool PhysicalBone::HingeJointData::_get(const StringName &p_name, Variant &r_ret) const {
+ if (JointData::_get(p_name, r_ret)) {
+ return true;
+ }
+
+ if ("joint_constraints/angular_limit_enabled" == p_name) {
+ r_ret = angular_limit_enabled;
+ } else if ("joint_constraints/angular_limit_upper" == p_name) {
+ r_ret = Math::rad2deg(angular_limit_upper);
+ } else if ("joint_constraints/angular_limit_lower" == p_name) {
+ r_ret = Math::rad2deg(angular_limit_lower);
+ } else if ("joint_constraints/angular_limit_bias" == p_name) {
+ r_ret = angular_limit_bias;
+ } else if ("joint_constraints/angular_limit_softness" == p_name) {
+ r_ret = angular_limit_softness;
+ } else if ("joint_constraints/angular_limit_relaxation" == p_name) {
+ r_ret = angular_limit_relaxation;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void PhysicalBone::HingeJointData::_get_property_list(List<PropertyInfo> *p_list) const {
+ JointData::_get_property_list(p_list);
+
+ p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/angular_limit_enabled"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_bias", PROPERTY_HINT_RANGE, "0.01,0.99,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_relaxation", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+}
+
+bool PhysicalBone::SliderJointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ if (JointData::_set(p_name, p_value, j)) {
+ return true;
+ }
+
+ if ("joint_constraints/linear_limit_upper" == p_name) {
+ linear_limit_upper = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER, linear_limit_upper);
+
+ } else if ("joint_constraints/linear_limit_lower" == p_name) {
+ linear_limit_lower = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER, linear_limit_lower);
+
+ } else if ("joint_constraints/linear_limit_softness" == p_name) {
+ linear_limit_softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, linear_limit_softness);
+
+ } else if ("joint_constraints/linear_limit_restitution" == p_name) {
+ linear_limit_restitution = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, linear_limit_restitution);
+
+ } else if ("joint_constraints/linear_limit_damping" == p_name) {
+ linear_limit_damping = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, linear_limit_restitution);
+
+ } else if ("joint_constraints/angular_limit_upper" == p_name) {
+ angular_limit_upper = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, angular_limit_upper);
+
+ } else if ("joint_constraints/angular_limit_lower" == p_name) {
+ angular_limit_lower = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, angular_limit_lower);
+
+ } else if ("joint_constraints/angular_limit_softness" == p_name) {
+ angular_limit_softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
+
+ } else if ("joint_constraints/angular_limit_restitution" == p_name) {
+ angular_limit_restitution = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, angular_limit_softness);
+
+ } else if ("joint_constraints/angular_limit_damping" == p_name) {
+ angular_limit_damping = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->slider_joint_set_param(j, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, angular_limit_damping);
+
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool PhysicalBone::SliderJointData::_get(const StringName &p_name, Variant &r_ret) const {
+ if (JointData::_get(p_name, r_ret)) {
+ return true;
+ }
+
+ if ("joint_constraints/linear_limit_upper" == p_name) {
+ r_ret = linear_limit_upper;
+ } else if ("joint_constraints/linear_limit_lower" == p_name) {
+ r_ret = linear_limit_lower;
+ } else if ("joint_constraints/linear_limit_softness" == p_name) {
+ r_ret = linear_limit_softness;
+ } else if ("joint_constraints/linear_limit_restitution" == p_name) {
+ r_ret = linear_limit_restitution;
+ } else if ("joint_constraints/linear_limit_damping" == p_name) {
+ r_ret = linear_limit_damping;
+ } else if ("joint_constraints/angular_limit_upper" == p_name) {
+ r_ret = Math::rad2deg(angular_limit_upper);
+ } else if ("joint_constraints/angular_limit_lower" == p_name) {
+ r_ret = Math::rad2deg(angular_limit_lower);
+ } else if ("joint_constraints/angular_limit_softness" == p_name) {
+ r_ret = angular_limit_softness;
+ } else if ("joint_constraints/angular_limit_restitution" == p_name) {
+ r_ret = angular_limit_restitution;
+ } else if ("joint_constraints/angular_limit_damping" == p_name) {
+ r_ret = angular_limit_damping;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void PhysicalBone::SliderJointData::_get_property_list(List<PropertyInfo> *p_list) const {
+ JointData::_get_property_list(p_list);
+
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_upper"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_lower"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/linear_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"));
+
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_restitution", PROPERTY_HINT_RANGE, "0.01,16.0,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/angular_limit_damping", PROPERTY_HINT_RANGE, "0,16.0,0.01"));
+}
+
+bool PhysicalBone::SixDOFJointData::_set(const StringName &p_name, const Variant &p_value, RID j) {
+ if (JointData::_set(p_name, p_value, j)) {
+ return true;
+ }
+
+ String path = p_name;
+
+ Vector3::Axis axis;
+ {
+ const String axis_s = path.get_slicec('/', 1);
+ if ("x" == axis_s) {
+ axis = Vector3::AXIS_X;
+ } else if ("y" == axis_s) {
+ axis = Vector3::AXIS_Y;
+ } else if ("z" == axis_s) {
+ axis = Vector3::AXIS_Z;
+ } else {
+ return false;
+ }
+ }
+
+ String var_name = path.get_slicec('/', 2);
+
+ if ("linear_limit_enabled" == var_name) {
+ axis_data[axis].linear_limit_enabled = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, axis_data[axis].linear_limit_enabled);
+
+ } else if ("linear_limit_upper" == var_name) {
+ axis_data[axis].linear_limit_upper = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT, axis_data[axis].linear_limit_upper);
+
+ } else if ("linear_limit_lower" == var_name) {
+ axis_data[axis].linear_limit_lower = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT, axis_data[axis].linear_limit_lower);
+
+ } else if ("linear_limit_softness" == var_name) {
+ axis_data[axis].linear_limit_softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, axis_data[axis].linear_limit_softness);
+
+ } else if ("linear_restitution" == var_name) {
+ axis_data[axis].linear_restitution = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION, axis_data[axis].linear_restitution);
+
+ } else if ("linear_damping" == var_name) {
+ axis_data[axis].linear_damping = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING, axis_data[axis].linear_damping);
+
+ } else if ("angular_limit_enabled" == var_name) {
+ axis_data[axis].angular_limit_enabled = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(j, axis, PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, axis_data[axis].angular_limit_enabled);
+
+ } else if ("angular_limit_upper" == var_name) {
+ axis_data[axis].angular_limit_upper = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, axis_data[axis].angular_limit_upper);
+
+ } else if ("angular_limit_lower" == var_name) {
+ axis_data[axis].angular_limit_lower = Math::deg2rad(real_t(p_value));
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, axis_data[axis].angular_limit_lower);
+
+ } else if ("angular_limit_softness" == var_name) {
+ axis_data[axis].angular_limit_softness = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, axis_data[axis].angular_limit_softness);
+
+ } else if ("angular_restitution" == var_name) {
+ axis_data[axis].angular_restitution = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION, axis_data[axis].angular_restitution);
+
+ } else if ("angular_damping" == var_name) {
+ axis_data[axis].angular_damping = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING, axis_data[axis].angular_damping);
+
+ } else if ("erp" == var_name) {
+ axis_data[axis].erp = p_value;
+ if (j.is_valid())
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(j, axis, PhysicsServer::G6DOF_JOINT_ANGULAR_ERP, axis_data[axis].erp);
+
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+bool PhysicalBone::SixDOFJointData::_get(const StringName &p_name, Variant &r_ret) const {
+ if (JointData::_get(p_name, r_ret)) {
+ return true;
+ }
+
+ String path = p_name;
+
+ int axis;
+ {
+ const String axis_s = path.get_slicec('/', 1);
+ if ("x" == axis_s) {
+ axis = 0;
+ } else if ("y" == axis_s) {
+ axis = 1;
+ } else if ("z" == axis_s) {
+ axis = 2;
+ } else {
+ return false;
+ }
+ }
+
+ String var_name = path.get_slicec('/', 2);
+
+ if ("linear_limit_enabled" == var_name) {
+ r_ret = axis_data[axis].linear_limit_enabled;
+ } else if ("linear_limit_upper" == var_name) {
+ r_ret = axis_data[axis].linear_limit_upper;
+ } else if ("linear_limit_lower" == var_name) {
+ r_ret = axis_data[axis].linear_limit_lower;
+ } else if ("linear_limit_softness" == var_name) {
+ r_ret = axis_data[axis].linear_limit_softness;
+ } else if ("linear_restitution" == var_name) {
+ r_ret = axis_data[axis].linear_restitution;
+ } else if ("linear_damping" == var_name) {
+ r_ret = axis_data[axis].linear_damping;
+ } else if ("angular_limit_enabled" == var_name) {
+ r_ret = axis_data[axis].angular_limit_enabled;
+ } else if ("angular_limit_upper" == var_name) {
+ r_ret = Math::rad2deg(axis_data[axis].angular_limit_upper);
+ } else if ("angular_limit_lower" == var_name) {
+ r_ret = Math::rad2deg(axis_data[axis].angular_limit_lower);
+ } else if ("angular_limit_softness" == var_name) {
+ r_ret = axis_data[axis].angular_limit_softness;
+ } else if ("angular_restitution" == var_name) {
+ r_ret = axis_data[axis].angular_restitution;
+ } else if ("angular_damping" == var_name) {
+ r_ret = axis_data[axis].angular_damping;
+ } else if ("erp" == var_name) {
+ r_ret = axis_data[axis].erp;
+ } else {
+ return false;
+ }
+
+ return true;
+}
+
+void PhysicalBone::SixDOFJointData::_get_property_list(List<PropertyInfo> *p_list) const {
+ const StringName axis_names[] = { "x", "y", "z" };
+ for (int i = 0; i < 3; ++i) {
+ p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/linear_limit_enabled"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_upper"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_lower"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/linear_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::BOOL, "joint_constraints/" + axis_names[i] + "/angular_limit_enabled"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_upper", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_lower", PROPERTY_HINT_RANGE, "-180,180,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_limit_softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/angular_damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"));
+ p_list->push_back(PropertyInfo(Variant::REAL, "joint_constraints/" + axis_names[i] + "/erp"));
+ }
+}
+
+bool PhysicalBone::_set(const StringName &p_name, const Variant &p_value) {
+ if (p_name == "bone_name") {
+ set_bone_name(p_value);
+ return true;
+ }
+
+ if (joint_data) {
+ if (joint_data->_set(p_name, p_value)) {
+#ifdef TOOLS_ENABLED
+ if (get_gizmo().is_valid())
+ get_gizmo()->redraw();
+#endif
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool PhysicalBone::_get(const StringName &p_name, Variant &r_ret) const {
+ if (p_name == "bone_name") {
+ r_ret = get_bone_name();
+ return true;
+ }
+
+ if (joint_data) {
+ return joint_data->_get(p_name, r_ret);
+ }
+
+ return false;
+}
+
+void PhysicalBone::_get_property_list(List<PropertyInfo> *p_list) const {
+
+ Skeleton *parent = find_skeleton_parent(get_parent());
+
+ if (parent) {
+
+ String names;
+ for (int i = 0; i < parent->get_bone_count(); i++) {
+ if (i > 0)
+ names += ",";
+ names += parent->get_bone_name(i);
+ }
+
+ p_list->push_back(PropertyInfo(Variant::STRING, "bone_name", PROPERTY_HINT_ENUM, names));
+ } else {
+
+ p_list->push_back(PropertyInfo(Variant::STRING, "bone_name"));
+ }
+
+ if (joint_data) {
+ joint_data->_get_property_list(p_list);
+ }
+}
+
+void PhysicalBone::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE:
+ parent_skeleton = find_skeleton_parent(get_parent());
+ update_bone_id();
+ reset_to_rest_position();
+ _reset_physics_simulation_state();
+ break;
+ case NOTIFICATION_EXIT_TREE:
+ if (parent_skeleton) {
+ if (-1 != bone_id) {
+ parent_skeleton->unbind_physical_bone_from_bone(bone_id);
+ }
+ }
+ parent_skeleton = NULL;
+ update_bone_id();
+ break;
+ case NOTIFICATION_TRANSFORM_CHANGED:
+ if (Engine::get_singleton()->is_editor_hint()) {
+
+ update_offset();
+ }
+ break;
+ }
+}
+
+void PhysicalBone::_direct_state_changed(Object *p_state) {
+
+ if (!simulate_physics) {
+ return;
+ }
+
+ /// Update bone transform
+
+ PhysicsDirectBodyState *state;
+
+#ifdef DEBUG_ENABLED
+ state = Object::cast_to<PhysicsDirectBodyState>(p_state);
+#else
+ state = (PhysicsDirectBodyState *)p_state; //trust it
+#endif
+
+ Transform global_transform(state->get_transform());
+
+ set_ignore_transform_notification(true);
+ set_global_transform(global_transform);
+ set_ignore_transform_notification(false);
+
+ // Update skeleton
+ if (parent_skeleton) {
+ if (-1 != bone_id) {
+ parent_skeleton->set_bone_global_pose(bone_id, parent_skeleton->get_global_transform().affine_inverse() * (global_transform * body_offset_inverse));
+ }
+ }
+}
+
+void PhysicalBone::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_direct_state_changed"), &PhysicalBone::_direct_state_changed);
+
+ ClassDB::bind_method(D_METHOD("set_joint_type", "joint_type"), &PhysicalBone::set_joint_type);
+ ClassDB::bind_method(D_METHOD("get_joint_type"), &PhysicalBone::get_joint_type);
+
+ ClassDB::bind_method(D_METHOD("set_joint_offset", "offset"), &PhysicalBone::set_joint_offset);
+ ClassDB::bind_method(D_METHOD("get_joint_offset"), &PhysicalBone::get_joint_offset);
+
+ ClassDB::bind_method(D_METHOD("set_body_offset", "offset"), &PhysicalBone::set_body_offset);
+ ClassDB::bind_method(D_METHOD("get_body_offset"), &PhysicalBone::get_body_offset);
+
+ ClassDB::bind_method(D_METHOD("is_static_body"), &PhysicalBone::is_static_body);
+
+ ClassDB::bind_method(D_METHOD("get_simulate_physics"), &PhysicalBone::get_simulate_physics);
+
+ ClassDB::bind_method(D_METHOD("is_simulating_physics"), &PhysicalBone::is_simulating_physics);
+
+ ClassDB::bind_method(D_METHOD("set_mass", "mass"), &PhysicalBone::set_mass);
+ ClassDB::bind_method(D_METHOD("get_mass"), &PhysicalBone::get_mass);
+
+ ClassDB::bind_method(D_METHOD("set_weight", "weight"), &PhysicalBone::set_weight);
+ ClassDB::bind_method(D_METHOD("get_weight"), &PhysicalBone::get_weight);
+
+ ClassDB::bind_method(D_METHOD("set_friction", "friction"), &PhysicalBone::set_friction);
+ ClassDB::bind_method(D_METHOD("get_friction"), &PhysicalBone::get_friction);
+
+ ClassDB::bind_method(D_METHOD("set_bounce", "bounce"), &PhysicalBone::set_bounce);
+ ClassDB::bind_method(D_METHOD("get_bounce"), &PhysicalBone::get_bounce);
+
+ ClassDB::bind_method(D_METHOD("set_gravity_scale", "gravity_scale"), &PhysicalBone::set_gravity_scale);
+ ClassDB::bind_method(D_METHOD("get_gravity_scale"), &PhysicalBone::get_gravity_scale);
+
+ ADD_GROUP("Joint", "joint_");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "joint_type", PROPERTY_HINT_ENUM, "None,PinJoint,ConeJoint,HingeJoint,SliderJoint,6DOFJoint"), "set_joint_type", "get_joint_type");
+ ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "joint_offset"), "set_joint_offset", "get_joint_offset");
+
+ ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "body_offset"), "set_body_offset", "get_body_offset");
+
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "mass", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_mass", "get_mass");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "weight", PROPERTY_HINT_EXP_RANGE, "0.01,65535,0.01"), "set_weight", "get_weight");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "friction", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_friction", "get_friction");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "bounce", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_bounce", "get_bounce");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "gravity_scale", PROPERTY_HINT_RANGE, "-10,10,0.01"), "set_gravity_scale", "get_gravity_scale");
+
+ BIND_ENUM_CONSTANT(JOINT_TYPE_NONE);
+ BIND_ENUM_CONSTANT(JOINT_TYPE_PIN);
+ BIND_ENUM_CONSTANT(JOINT_TYPE_CONE);
+ BIND_ENUM_CONSTANT(JOINT_TYPE_HINGE);
+ BIND_ENUM_CONSTANT(JOINT_TYPE_SLIDER);
+ BIND_ENUM_CONSTANT(JOINT_TYPE_6DOF);
+}
+
+Skeleton *PhysicalBone::find_skeleton_parent(Node *p_parent) {
+ if (!p_parent) {
+ return NULL;
+ }
+ Skeleton *s = Object::cast_to<Skeleton>(p_parent);
+ return s ? s : find_skeleton_parent(p_parent->get_parent());
+}
+
+void PhysicalBone::_fix_joint_offset() {
+ // Clamp joint origin to bone origin
+ if (parent_skeleton) {
+ joint_offset.origin = body_offset.affine_inverse().origin;
+ }
+}
+
+void PhysicalBone::_reload_joint() {
+
+ if (joint.is_valid()) {
+ PhysicsServer::get_singleton()->free(joint);
+ joint = RID();
+ }
+
+ if (!parent_skeleton) {
+ return;
+ }
+
+ PhysicalBone *body_a = parent_skeleton->get_physical_bone_parent(bone_id);
+ if (!body_a) {
+ return;
+ }
+
+ Transform joint_transf = get_global_transform() * joint_offset;
+ Transform local_a = body_a->get_global_transform().affine_inverse() * joint_transf;
+ local_a.orthonormalize();
+
+ switch (get_joint_type()) {
+ case JOINT_TYPE_PIN: {
+
+ joint = PhysicsServer::get_singleton()->joint_create_pin(body_a->get_rid(), local_a.origin, get_rid(), joint_offset.origin);
+ const PinJointData *pjd(static_cast<const PinJointData *>(joint_data));
+ PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_BIAS, pjd->bias);
+ PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_DAMPING, pjd->damping);
+ PhysicsServer::get_singleton()->pin_joint_set_param(joint, PhysicsServer::PIN_JOINT_IMPULSE_CLAMP, pjd->impulse_clamp);
+
+ } break;
+ case JOINT_TYPE_CONE: {
+
+ joint = PhysicsServer::get_singleton()->joint_create_cone_twist(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ const ConeJointData *cjd(static_cast<const ConeJointData *>(joint_data));
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_SWING_SPAN, cjd->swing_span);
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_TWIST_SPAN, cjd->twist_span);
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_BIAS, cjd->bias);
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_SOFTNESS, cjd->softness);
+ PhysicsServer::get_singleton()->cone_twist_joint_set_param(joint, PhysicsServer::CONE_TWIST_JOINT_RELAXATION, cjd->relaxation);
+
+ } break;
+ case JOINT_TYPE_HINGE: {
+
+ joint = PhysicsServer::get_singleton()->joint_create_hinge(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ const HingeJointData *hjd(static_cast<const HingeJointData *>(joint_data));
+ PhysicsServer::get_singleton()->hinge_joint_set_flag(joint, PhysicsServer::HINGE_JOINT_FLAG_USE_LIMIT, hjd->angular_limit_enabled);
+ PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_UPPER, hjd->angular_limit_upper);
+ PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_LOWER, hjd->angular_limit_lower);
+ PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_BIAS, hjd->angular_limit_bias);
+ PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_SOFTNESS, hjd->angular_limit_softness);
+ PhysicsServer::get_singleton()->hinge_joint_set_param(joint, PhysicsServer::HINGE_JOINT_LIMIT_RELAXATION, hjd->angular_limit_relaxation);
+
+ } break;
+ case JOINT_TYPE_SLIDER: {
+
+ joint = PhysicsServer::get_singleton()->joint_create_slider(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ const SliderJointData *sjd(static_cast<const SliderJointData *>(joint_data));
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_UPPER, sjd->linear_limit_upper);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_LOWER, sjd->linear_limit_lower);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS, sjd->linear_limit_softness);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION, sjd->linear_limit_restitution);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_LINEAR_LIMIT_DAMPING, sjd->linear_limit_restitution);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_UPPER, sjd->angular_limit_upper);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_LOWER, sjd->angular_limit_lower);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS, sjd->angular_limit_softness);
+ PhysicsServer::get_singleton()->slider_joint_set_param(joint, PhysicsServer::SLIDER_JOINT_ANGULAR_LIMIT_DAMPING, sjd->angular_limit_damping);
+
+ } break;
+ case JOINT_TYPE_6DOF: {
+
+ joint = PhysicsServer::get_singleton()->joint_create_generic_6dof(body_a->get_rid(), local_a, get_rid(), joint_offset);
+ const SixDOFJointData *g6dofjd(static_cast<const SixDOFJointData *>(joint_data));
+ for (int axis = 0; axis < 3; ++axis) {
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT, g6dofjd->axis_data[axis].linear_limit_enabled);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_UPPER_LIMIT, g6dofjd->axis_data[axis].linear_limit_upper);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_LOWER_LIMIT, g6dofjd->axis_data[axis].linear_limit_lower);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].linear_limit_softness);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION, g6dofjd->axis_data[axis].linear_restitution);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING, g6dofjd->axis_data[axis].linear_damping);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_flag(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT, g6dofjd->axis_data[axis].angular_limit_enabled);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT, g6dofjd->axis_data[axis].angular_limit_upper);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT, g6dofjd->axis_data[axis].angular_limit_lower);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS, g6dofjd->axis_data[axis].angular_limit_softness);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_RESTITUTION, g6dofjd->axis_data[axis].angular_restitution);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_DAMPING, g6dofjd->axis_data[axis].angular_damping);
+ PhysicsServer::get_singleton()->generic_6dof_joint_set_param(joint, static_cast<Vector3::Axis>(axis), PhysicsServer::G6DOF_JOINT_ANGULAR_ERP, g6dofjd->axis_data[axis].erp);
+ }
+
+ } break;
+ }
+}
+
+void PhysicalBone::_on_bone_parent_changed() {
+ _reload_joint();
+}
+
+void PhysicalBone::_set_gizmo_move_joint(bool p_move_joint) {
+#ifdef TOOLS_ENABLED
+ gizmo_move_joint = p_move_joint;
+ SpatialEditor::get_singleton()->update_transform_gizmo();
+#endif
+}
+
+#ifdef TOOLS_ENABLED
+Transform PhysicalBone::get_global_gizmo_transform() const {
+ return gizmo_move_joint ? get_global_transform() * joint_offset : get_global_transform();
+}
+
+Transform PhysicalBone::get_local_gizmo_transform() const {
+ return gizmo_move_joint ? get_transform() * joint_offset : get_transform();
+}
+#endif
+
+const PhysicalBone::JointData *PhysicalBone::get_joint_data() const {
+ return joint_data;
+}
+
+Skeleton *PhysicalBone::find_skeleton_parent() {
+ return find_skeleton_parent(this);
+}
+
+void PhysicalBone::set_joint_type(JointType p_joint_type) {
+
+ if (p_joint_type == get_joint_type())
+ return;
+
+ memdelete(joint_data);
+ joint_data = NULL;
+ switch (p_joint_type) {
+ case JOINT_TYPE_PIN:
+ joint_data = memnew(PinJointData);
+ break;
+ case JOINT_TYPE_CONE:
+ joint_data = memnew(ConeJointData);
+ break;
+ case JOINT_TYPE_HINGE:
+ joint_data = memnew(HingeJointData);
+ break;
+ case JOINT_TYPE_SLIDER:
+ joint_data = memnew(SliderJointData);
+ break;
+ case JOINT_TYPE_6DOF:
+ joint_data = memnew(SixDOFJointData);
+ break;
+ }
+
+ _reload_joint();
+
+#ifdef TOOLS_ENABLED
+ _change_notify();
+ if (get_gizmo().is_valid())
+ get_gizmo()->redraw();
+#endif
+}
+
+PhysicalBone::JointType PhysicalBone::get_joint_type() const {
+ return joint_data ? joint_data->get_joint_type() : JOINT_TYPE_NONE;
+}
+
+void PhysicalBone::set_joint_offset(const Transform &p_offset) {
+ joint_offset = p_offset;
+
+ _fix_joint_offset();
+
+ set_ignore_transform_notification(true);
+ reset_to_rest_position();
+ set_ignore_transform_notification(false);
+
+#ifdef TOOLS_ENABLED
+ if (get_gizmo().is_valid())
+ get_gizmo()->redraw();
+#endif
+}
+
+const Transform &PhysicalBone::get_body_offset() const {
+ return body_offset;
+}
+
+void PhysicalBone::set_body_offset(const Transform &p_offset) {
+ body_offset = p_offset;
+ body_offset_inverse = body_offset.affine_inverse();
+
+ _fix_joint_offset();
+
+ set_ignore_transform_notification(true);
+ reset_to_rest_position();
+ set_ignore_transform_notification(false);
+
+#ifdef TOOLS_ENABLED
+ if (get_gizmo().is_valid())
+ get_gizmo()->redraw();
+#endif
+}
+
+const Transform &PhysicalBone::get_joint_offset() const {
+ return joint_offset;
+}
+
+void PhysicalBone::set_static_body(bool p_static) {
+
+ static_body = p_static;
+
+ set_as_toplevel(!static_body);
+
+ _reset_physics_simulation_state();
+}
+
+bool PhysicalBone::is_static_body() {
+ return static_body;
+}
+
+void PhysicalBone::set_simulate_physics(bool p_simulate) {
+ if (simulate_physics == p_simulate) {
+ return;
+ }
+
+ simulate_physics = p_simulate;
+ _reset_physics_simulation_state();
+}
+
+bool PhysicalBone::get_simulate_physics() {
+ return simulate_physics;
+}
+
+bool PhysicalBone::is_simulating_physics() {
+ return _internal_simulate_physics && !_internal_static_body;
+}
+
+void PhysicalBone::set_bone_name(const String &p_name) {
+
+ bone_name = p_name;
+ bone_id = -1;
+
+ update_bone_id();
+ reset_to_rest_position();
+}
+
+const String &PhysicalBone::get_bone_name() const {
+
+ return bone_name;
+}
+
+void PhysicalBone::set_mass(real_t p_mass) {
+
+ ERR_FAIL_COND(p_mass <= 0);
+ mass = p_mass;
+ PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_MASS, mass);
+}
+
+real_t PhysicalBone::get_mass() const {
+
+ return mass;
+}
+
+void PhysicalBone::set_weight(real_t p_weight) {
+
+ set_mass(p_weight / real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8)));
+}
+
+real_t PhysicalBone::get_weight() const {
+
+ return mass * real_t(GLOBAL_DEF("physics/3d/default_gravity", 9.8));
+}
+
+void PhysicalBone::set_friction(real_t p_friction) {
+
+ ERR_FAIL_COND(p_friction < 0 || p_friction > 1);
+
+ friction = p_friction;
+ PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_FRICTION, friction);
+}
+
+real_t PhysicalBone::get_friction() const {
+
+ return friction;
+}
+
+void PhysicalBone::set_bounce(real_t p_bounce) {
+
+ ERR_FAIL_COND(p_bounce < 0 || p_bounce > 1);
+
+ bounce = p_bounce;
+ PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_BOUNCE, bounce);
+}
+real_t PhysicalBone::get_bounce() const {
+
+ return bounce;
+}
+
+void PhysicalBone::set_gravity_scale(real_t p_gravity_scale) {
+
+ gravity_scale = p_gravity_scale;
+ PhysicsServer::get_singleton()->body_set_param(get_rid(), PhysicsServer::BODY_PARAM_GRAVITY_SCALE, gravity_scale);
+}
+
+real_t PhysicalBone::get_gravity_scale() const {
+
+ return gravity_scale;
+}
+
+PhysicalBone::PhysicalBone() :
+ PhysicsBody(PhysicsServer::BODY_MODE_STATIC),
+#ifdef TOOLS_ENABLED
+ gizmo_move_joint(false),
+#endif
+ joint_data(NULL),
+ static_body(false),
+ simulate_physics(false),
+ _internal_static_body(false),
+ _internal_simulate_physics(false),
+ bone_id(-1),
+ parent_skeleton(NULL),
+ bone_name(""),
+ bounce(0),
+ mass(1),
+ friction(1),
+ gravity_scale(1) {
+
+ set_static_body(static_body);
+ _reset_physics_simulation_state();
+}
+
+PhysicalBone::~PhysicalBone() {
+ memdelete(joint_data);
+}
+
+void PhysicalBone::update_bone_id() {
+ if (!parent_skeleton) {
+ return;
+ }
+
+ const int new_bone_id = parent_skeleton->find_bone(bone_name);
+
+ if (new_bone_id != bone_id) {
+ if (-1 != bone_id) {
+ // Assert the unbind from old node
+ parent_skeleton->unbind_physical_bone_from_bone(bone_id);
+ parent_skeleton->unbind_child_node_from_bone(bone_id, this);
+ }
+
+ bone_id = new_bone_id;
+
+ parent_skeleton->bind_physical_bone_to_bone(bone_id, this);
+
+ _fix_joint_offset();
+ _internal_static_body = !static_body; // Force staticness reset
+ _reset_staticness_state();
+ }
+}
+
+void PhysicalBone::update_offset() {
+#ifdef TOOLS_ENABLED
+ if (parent_skeleton) {
+
+ Transform bone_transform(parent_skeleton->get_global_transform());
+ if (-1 != bone_id)
+ bone_transform *= parent_skeleton->get_bone_global_pose(bone_id);
+
+ if (gizmo_move_joint) {
+ bone_transform *= body_offset;
+ set_joint_offset(bone_transform.affine_inverse() * get_global_transform());
+ } else {
+ set_body_offset(bone_transform.affine_inverse() * get_global_transform());
+ }
+ }
+#endif
+}
+
+void PhysicalBone::reset_to_rest_position() {
+ if (parent_skeleton) {
+ if (-1 == bone_id) {
+ set_global_transform(parent_skeleton->get_global_transform() * body_offset);
+ } else {
+ set_global_transform(parent_skeleton->get_global_transform() * parent_skeleton->get_bone_global_pose(bone_id) * body_offset);
+ }
+ }
+}
+
+void PhysicalBone::_reset_physics_simulation_state() {
+ if (simulate_physics && !static_body) {
+ _start_physics_simulation();
+ } else {
+ _stop_physics_simulation();
+ }
+
+ _reset_staticness_state();
+}
+
+void PhysicalBone::_reset_staticness_state() {
+
+ if (parent_skeleton && -1 != bone_id) {
+ if (static_body && simulate_physics) { // With this check I'm sure the position of this body is updated only when it's necessary
+
+ if (_internal_static_body) {
+ return;
+ }
+
+ parent_skeleton->bind_child_node_to_bone(bone_id, this);
+ _internal_static_body = true;
+ } else {
+
+ if (!_internal_static_body) {
+ return;
+ }
+
+ parent_skeleton->unbind_child_node_from_bone(bone_id, this);
+ _internal_static_body = false;
+ }
+ }
+}
+
+void PhysicalBone::_start_physics_simulation() {
+ if (_internal_simulate_physics || !parent_skeleton) {
+ return;
+ }
+ reset_to_rest_position();
+ PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_RIGID);
+ PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), get_collision_layer());
+ PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), get_collision_mask());
+ PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed");
+ parent_skeleton->set_bone_ignore_animation(bone_id, true);
+ _internal_simulate_physics = true;
+}
+
+void PhysicalBone::_stop_physics_simulation() {
+ if (!_internal_simulate_physics || !parent_skeleton) {
+ return;
+ }
+ PhysicsServer::get_singleton()->body_set_mode(get_rid(), PhysicsServer::BODY_MODE_STATIC);
+ PhysicsServer::get_singleton()->body_set_collision_layer(get_rid(), 0);
+ PhysicsServer::get_singleton()->body_set_collision_mask(get_rid(), 0);
+ PhysicsServer::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, "");
+ parent_skeleton->set_bone_ignore_animation(bone_id, false);
+ _internal_simulate_physics = false;
+}
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index ffdc9ab309..17d2769c79 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -33,6 +33,7 @@
#include "scene/3d/collision_object.h"
#include "servers/physics_server.h"
+#include "skeleton.h"
#include "vset.h"
class PhysicsBody : public CollisionObject {
@@ -342,4 +343,267 @@ public:
KinematicCollision();
};
+class PhysicalBone : public PhysicsBody {
+
+ GDCLASS(PhysicalBone, PhysicsBody);
+
+public:
+ enum JointType {
+ JOINT_TYPE_NONE,
+ JOINT_TYPE_PIN,
+ JOINT_TYPE_CONE,
+ JOINT_TYPE_HINGE,
+ JOINT_TYPE_SLIDER,
+ JOINT_TYPE_6DOF
+ };
+
+ struct JointData {
+ virtual JointType get_joint_type() { return JOINT_TYPE_NONE; }
+
+ /// "j" is used to set the parameter inside the PhysicsServer
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+ };
+
+ struct PinJointData : public JointData {
+ virtual JointType get_joint_type() { return JOINT_TYPE_PIN; }
+
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ real_t bias;
+ real_t damping;
+ real_t impulse_clamp;
+
+ PinJointData() :
+ bias(0.3),
+ damping(1.),
+ impulse_clamp(0) {}
+ };
+
+ struct ConeJointData : public JointData {
+ virtual JointType get_joint_type() { return JOINT_TYPE_CONE; }
+
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ real_t swing_span;
+ real_t twist_span;
+ real_t bias;
+ real_t softness;
+ real_t relaxation;
+
+ ConeJointData() :
+ swing_span(Math_PI * 0.25),
+ twist_span(Math_PI),
+ bias(0.3),
+ softness(0.8),
+ relaxation(1.) {}
+ };
+
+ struct HingeJointData : public JointData {
+ virtual JointType get_joint_type() { return JOINT_TYPE_HINGE; }
+
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ bool angular_limit_enabled;
+ real_t angular_limit_upper;
+ real_t angular_limit_lower;
+ real_t angular_limit_bias;
+ real_t angular_limit_softness;
+ real_t angular_limit_relaxation;
+
+ HingeJointData() :
+ angular_limit_enabled(false),
+ angular_limit_upper(Math_PI * 0.5),
+ angular_limit_lower(-Math_PI * 0.5),
+ angular_limit_bias(0.3),
+ angular_limit_softness(0.9),
+ angular_limit_relaxation(1.) {}
+ };
+
+ struct SliderJointData : public JointData {
+ virtual JointType get_joint_type() { return JOINT_TYPE_SLIDER; }
+
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ real_t linear_limit_upper;
+ real_t linear_limit_lower;
+ real_t linear_limit_softness;
+ real_t linear_limit_restitution;
+ real_t linear_limit_damping;
+ real_t angular_limit_upper;
+ real_t angular_limit_lower;
+ real_t angular_limit_softness;
+ real_t angular_limit_restitution;
+ real_t angular_limit_damping;
+
+ SliderJointData() :
+ linear_limit_upper(1.),
+ linear_limit_lower(-1.),
+ linear_limit_softness(1.),
+ linear_limit_restitution(0.7),
+ linear_limit_damping(1.),
+ angular_limit_upper(0),
+ angular_limit_lower(0),
+ angular_limit_softness(1.),
+ angular_limit_restitution(0.7),
+ angular_limit_damping(1.) {}
+ };
+
+ struct SixDOFJointData : public JointData {
+ struct SixDOFAxisData {
+ bool linear_limit_enabled;
+ real_t linear_limit_upper;
+ real_t linear_limit_lower;
+ real_t linear_limit_softness;
+ real_t linear_restitution;
+ real_t linear_damping;
+ bool angular_limit_enabled;
+ real_t angular_limit_upper;
+ real_t angular_limit_lower;
+ real_t angular_limit_softness;
+ real_t angular_restitution;
+ real_t angular_damping;
+ real_t erp;
+
+ SixDOFAxisData() :
+ linear_limit_enabled(true),
+ linear_limit_upper(0),
+ linear_limit_lower(0),
+ linear_limit_softness(0.7),
+ linear_restitution(0.5),
+ linear_damping(1.),
+ angular_limit_enabled(true),
+ angular_limit_upper(0),
+ angular_limit_lower(0),
+ angular_limit_softness(0.5),
+ angular_restitution(0),
+ angular_damping(1.),
+ erp(0.5) {}
+ };
+
+ virtual JointType get_joint_type() { return JOINT_TYPE_6DOF; }
+
+ virtual bool _set(const StringName &p_name, const Variant &p_value, RID j = RID());
+ virtual bool _get(const StringName &p_name, Variant &r_ret) const;
+ virtual void _get_property_list(List<PropertyInfo> *p_list) const;
+
+ SixDOFAxisData axis_data[3];
+
+ SixDOFJointData() {}
+ };
+
+private:
+#ifdef TOOLS_ENABLED
+ // if false gizmo move body
+ bool gizmo_move_joint;
+#endif
+
+ JointData *joint_data;
+ Transform joint_offset;
+ RID joint;
+
+ Skeleton *parent_skeleton;
+ Transform body_offset;
+ Transform body_offset_inverse;
+ bool static_body;
+ bool _internal_static_body;
+ bool simulate_physics;
+ bool _internal_simulate_physics;
+ int bone_id;
+
+ String bone_name;
+ real_t bounce;
+ real_t mass;
+ real_t friction;
+ real_t gravity_scale;
+
+protected:
+ bool _set(const StringName &p_name, const Variant &p_value);
+ bool _get(const StringName &p_name, Variant &r_ret) const;
+ void _get_property_list(List<PropertyInfo> *p_list) const;
+ void _notification(int p_what);
+ void _direct_state_changed(Object *p_state);
+
+ static void _bind_methods();
+
+private:
+ static Skeleton *find_skeleton_parent(Node *p_parent);
+ void _fix_joint_offset();
+ void _reload_joint();
+
+public:
+ void _on_bone_parent_changed();
+ void _set_gizmo_move_joint(bool p_move_joint);
+
+public:
+#ifdef TOOLS_ENABLED
+ virtual Transform get_global_gizmo_transform() const;
+ virtual Transform get_local_gizmo_transform() const;
+#endif
+
+ const JointData *get_joint_data() const;
+ Skeleton *find_skeleton_parent();
+
+ int get_bone_id() const { return bone_id; }
+
+ void set_joint_type(JointType p_joint_type);
+ JointType get_joint_type() const;
+
+ void set_joint_offset(const Transform &p_offset);
+ const Transform &get_joint_offset() const;
+
+ void set_body_offset(const Transform &p_offset);
+ const Transform &get_body_offset() const;
+
+ void set_static_body(bool p_static);
+ bool is_static_body();
+
+ void set_simulate_physics(bool p_simulate);
+ bool get_simulate_physics();
+ bool is_simulating_physics();
+
+ void set_bone_name(const String &p_name);
+ const String &get_bone_name() const;
+
+ void set_mass(real_t p_mass);
+ real_t get_mass() const;
+
+ void set_weight(real_t p_weight);
+ real_t get_weight() const;
+
+ void set_friction(real_t p_friction);
+ real_t get_friction() const;
+
+ void set_bounce(real_t p_bounce);
+ real_t get_bounce() const;
+
+ void set_gravity_scale(real_t p_gravity_scale);
+ real_t get_gravity_scale() const;
+
+ PhysicalBone();
+ ~PhysicalBone();
+
+private:
+ void update_bone_id();
+ void update_offset();
+ void reset_to_rest_position();
+
+ void _reset_physics_simulation_state();
+ void _reset_staticness_state();
+
+ void _start_physics_simulation();
+ void _stop_physics_simulation();
+};
+
+VARIANT_ENUM_CAST(PhysicalBone::JointType);
+
#endif // PHYSICS_BODY__H
diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp
index 2e9f1a241a..b2d10006f7 100644
--- a/scene/3d/physics_joint.cpp
+++ b/scene/3d/physics_joint.cpp
@@ -716,6 +716,9 @@ void Generic6DOFJoint::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_LIMIT_SOFTNESS);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_RESTITUTION);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_x/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_x", "get_param_x", PARAM_LINEAR_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_LINEAR_MOTOR);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_x/target_velocity"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_TARGET_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_x/force_limit"), "set_param_x", "get_param_x", PARAM_LINEAR_MOTOR_FORCE_LIMIT);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_x/enabled"), "set_flag_x", "get_flag_x", FLAG_ENABLE_ANGULAR_LIMIT);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_x/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_x", "_get_angular_hi_limit_x");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_x/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_x", "_get_angular_lo_limit_x");
@@ -734,6 +737,9 @@ void Generic6DOFJoint::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_LIMIT_SOFTNESS);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_RESTITUTION);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_y/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_y", "get_param_y", PARAM_LINEAR_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_LINEAR_MOTOR);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_y/target_velocity"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_TARGET_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_y/force_limit"), "set_param_y", "get_param_y", PARAM_LINEAR_MOTOR_FORCE_LIMIT);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_y/enabled"), "set_flag_y", "get_flag_y", FLAG_ENABLE_ANGULAR_LIMIT);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_y/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_y", "_get_angular_hi_limit_y");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_y/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_y", "_get_angular_lo_limit_y");
@@ -752,6 +758,9 @@ void Generic6DOFJoint::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/softness", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_LIMIT_SOFTNESS);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/restitution", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_RESTITUTION);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_limit_z/damping", PROPERTY_HINT_RANGE, "0.01,16,0.01"), "set_param_z", "get_param_z", PARAM_LINEAR_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "linear_motor_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_LINEAR_MOTOR);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_z/target_velocity"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_TARGET_VELOCITY);
+ ADD_PROPERTYI(PropertyInfo(Variant::REAL, "linear_motor_z/force_limit"), "set_param_z", "get_param_z", PARAM_LINEAR_MOTOR_FORCE_LIMIT);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "angular_limit_z/enabled"), "set_flag_z", "get_flag_z", FLAG_ENABLE_ANGULAR_LIMIT);
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_z/upper_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_hi_limit_z", "_get_angular_hi_limit_z");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "angular_limit_z/lower_angle", PROPERTY_HINT_RANGE, "-180,180,0.01"), "_set_angular_lo_limit_z", "_get_angular_lo_limit_z");
@@ -769,6 +778,8 @@ void Generic6DOFJoint::_bind_methods() {
BIND_ENUM_CONSTANT(PARAM_LINEAR_LIMIT_SOFTNESS);
BIND_ENUM_CONSTANT(PARAM_LINEAR_RESTITUTION);
BIND_ENUM_CONSTANT(PARAM_LINEAR_DAMPING);
+ BIND_ENUM_CONSTANT(PARAM_LINEAR_MOTOR_TARGET_VELOCITY);
+ BIND_ENUM_CONSTANT(PARAM_LINEAR_MOTOR_FORCE_LIMIT);
BIND_ENUM_CONSTANT(PARAM_ANGULAR_LOWER_LIMIT);
BIND_ENUM_CONSTANT(PARAM_ANGULAR_UPPER_LIMIT);
BIND_ENUM_CONSTANT(PARAM_ANGULAR_LIMIT_SOFTNESS);
@@ -783,6 +794,7 @@ void Generic6DOFJoint::_bind_methods() {
BIND_ENUM_CONSTANT(FLAG_ENABLE_LINEAR_LIMIT);
BIND_ENUM_CONSTANT(FLAG_ENABLE_ANGULAR_LIMIT);
BIND_ENUM_CONSTANT(FLAG_ENABLE_MOTOR);
+ BIND_ENUM_CONSTANT(FLAG_ENABLE_LINEAR_MOTOR);
BIND_ENUM_CONSTANT(FLAG_MAX);
}
@@ -912,6 +924,8 @@ Generic6DOFJoint::Generic6DOFJoint() {
set_param_x(PARAM_LINEAR_LIMIT_SOFTNESS, 0.7);
set_param_x(PARAM_LINEAR_RESTITUTION, 0.5);
set_param_x(PARAM_LINEAR_DAMPING, 1.0);
+ set_param_x(PARAM_LINEAR_MOTOR_TARGET_VELOCITY, 0);
+ set_param_x(PARAM_LINEAR_MOTOR_FORCE_LIMIT, 0);
set_param_x(PARAM_ANGULAR_LOWER_LIMIT, 0);
set_param_x(PARAM_ANGULAR_UPPER_LIMIT, 0);
set_param_x(PARAM_ANGULAR_LIMIT_SOFTNESS, 0.5f);
@@ -925,12 +939,15 @@ Generic6DOFJoint::Generic6DOFJoint() {
set_flag_x(FLAG_ENABLE_ANGULAR_LIMIT, true);
set_flag_x(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_x(FLAG_ENABLE_MOTOR, false);
+ set_flag_x(FLAG_ENABLE_LINEAR_MOTOR, false);
set_param_y(PARAM_LINEAR_LOWER_LIMIT, 0);
set_param_y(PARAM_LINEAR_UPPER_LIMIT, 0);
set_param_y(PARAM_LINEAR_LIMIT_SOFTNESS, 0.7);
set_param_y(PARAM_LINEAR_RESTITUTION, 0.5);
set_param_y(PARAM_LINEAR_DAMPING, 1.0);
+ set_param_y(PARAM_LINEAR_MOTOR_TARGET_VELOCITY, 0);
+ set_param_y(PARAM_LINEAR_MOTOR_FORCE_LIMIT, 0);
set_param_y(PARAM_ANGULAR_LOWER_LIMIT, 0);
set_param_y(PARAM_ANGULAR_UPPER_LIMIT, 0);
set_param_y(PARAM_ANGULAR_LIMIT_SOFTNESS, 0.5f);
@@ -944,12 +961,15 @@ Generic6DOFJoint::Generic6DOFJoint() {
set_flag_y(FLAG_ENABLE_ANGULAR_LIMIT, true);
set_flag_y(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_y(FLAG_ENABLE_MOTOR, false);
+ set_flag_y(FLAG_ENABLE_LINEAR_MOTOR, false);
set_param_z(PARAM_LINEAR_LOWER_LIMIT, 0);
set_param_z(PARAM_LINEAR_UPPER_LIMIT, 0);
set_param_z(PARAM_LINEAR_LIMIT_SOFTNESS, 0.7);
set_param_z(PARAM_LINEAR_RESTITUTION, 0.5);
set_param_z(PARAM_LINEAR_DAMPING, 1.0);
+ set_param_z(PARAM_LINEAR_MOTOR_TARGET_VELOCITY, 0);
+ set_param_z(PARAM_LINEAR_MOTOR_FORCE_LIMIT, 0);
set_param_z(PARAM_ANGULAR_LOWER_LIMIT, 0);
set_param_z(PARAM_ANGULAR_UPPER_LIMIT, 0);
set_param_z(PARAM_ANGULAR_LIMIT_SOFTNESS, 0.5f);
@@ -963,4 +983,5 @@ Generic6DOFJoint::Generic6DOFJoint() {
set_flag_z(FLAG_ENABLE_ANGULAR_LIMIT, true);
set_flag_z(FLAG_ENABLE_LINEAR_LIMIT, true);
set_flag_z(FLAG_ENABLE_MOTOR, false);
+ set_flag_z(FLAG_ENABLE_LINEAR_MOTOR, false);
}
diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h
index 000109ac55..37870d6f30 100644
--- a/scene/3d/physics_joint.h
+++ b/scene/3d/physics_joint.h
@@ -249,6 +249,8 @@ public:
PARAM_LINEAR_LIMIT_SOFTNESS = PhysicsServer::G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS,
PARAM_LINEAR_RESTITUTION = PhysicsServer::G6DOF_JOINT_LINEAR_RESTITUTION,
PARAM_LINEAR_DAMPING = PhysicsServer::G6DOF_JOINT_LINEAR_DAMPING,
+ PARAM_LINEAR_MOTOR_TARGET_VELOCITY = PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY,
+ PARAM_LINEAR_MOTOR_FORCE_LIMIT = PhysicsServer::G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT,
PARAM_ANGULAR_LOWER_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_LOWER_LIMIT,
PARAM_ANGULAR_UPPER_LIMIT = PhysicsServer::G6DOF_JOINT_ANGULAR_UPPER_LIMIT,
PARAM_ANGULAR_LIMIT_SOFTNESS = PhysicsServer::G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS,
@@ -265,6 +267,7 @@ public:
FLAG_ENABLE_LINEAR_LIMIT = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT,
FLAG_ENABLE_ANGULAR_LIMIT = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
FLAG_ENABLE_MOTOR = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_MOTOR,
+ FLAG_ENABLE_LINEAR_MOTOR = PhysicsServer::G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
FLAG_MAX = PhysicsServer::G6DOF_JOINT_FLAG_MAX
};
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index d3a13c741e..76d90dc6ff 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -33,6 +33,7 @@
#include "message_queue.h"
#include "core/project_settings.h"
+#include "scene/3d/physics_body.h"
#include "scene/resources/surface_tool.h"
bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
@@ -329,7 +330,7 @@ void Skeleton::add_bone(const String &p_name) {
_make_dirty();
update_gizmo();
}
-int Skeleton::find_bone(String p_name) const {
+int Skeleton::find_bone(const String &p_name) const {
for (int i = 0; i < bones.size(); i++) {
@@ -346,6 +347,19 @@ String Skeleton::get_bone_name(int p_bone) const {
return bones[p_bone].name;
}
+bool Skeleton::is_bone_parent_of(int p_bone, int p_parent_bone_id) const {
+
+ int parent_of_bone = get_bone_parent(p_bone);
+
+ if (-1 == parent_of_bone)
+ return false;
+
+ if (parent_of_bone == p_parent_bone_id)
+ return true;
+
+ return is_bone_parent_of(parent_of_bone, p_parent_bone_id);
+}
+
int Skeleton::get_bone_count() const {
return bones.size();
@@ -377,6 +391,17 @@ void Skeleton::unparent_bone_and_rest(int p_bone) {
_make_dirty();
}
+void Skeleton::set_bone_ignore_animation(int p_bone, bool p_ignore) {
+ ERR_FAIL_INDEX(p_bone, bones.size());
+ bones[p_bone].ignore_animation = p_ignore;
+}
+
+bool Skeleton::is_bone_ignore_animation(int p_bone) const {
+
+ ERR_FAIL_INDEX_V(p_bone, bones.size(), false);
+ return bones[p_bone].ignore_animation;
+}
+
void Skeleton::set_bone_disable_rest(int p_bone, bool p_disable) {
ERR_FAIL_INDEX(p_bone, bones.size());
@@ -522,6 +547,150 @@ void Skeleton::localize_rests() {
}
}
+void Skeleton::bind_physical_bone_to_bone(int p_bone, PhysicalBone *p_physical_bone) {
+ ERR_FAIL_INDEX(p_bone, bones.size());
+ ERR_FAIL_COND(bones[p_bone].physical_bone);
+ ERR_FAIL_COND(!p_physical_bone);
+ bones[p_bone].physical_bone = p_physical_bone;
+
+ _rebuild_physical_bones_cache();
+}
+
+void Skeleton::unbind_physical_bone_from_bone(int p_bone) {
+ ERR_FAIL_INDEX(p_bone, bones.size());
+ bones[p_bone].physical_bone = NULL;
+
+ _rebuild_physical_bones_cache();
+}
+
+PhysicalBone *Skeleton::get_physical_bone(int p_bone) {
+ ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL);
+
+ return bones[p_bone].physical_bone;
+}
+
+PhysicalBone *Skeleton::get_physical_bone_parent(int p_bone) {
+ ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL);
+
+ if (bones[p_bone].cache_parent_physical_bone) {
+ return bones[p_bone].cache_parent_physical_bone;
+ }
+
+ return _get_physical_bone_parent(p_bone);
+}
+
+PhysicalBone *Skeleton::_get_physical_bone_parent(int p_bone) {
+ ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL);
+
+ const int parent_bone = bones[p_bone].parent;
+ if (0 > parent_bone) {
+ return NULL;
+ }
+
+ PhysicalBone *pb = bones[parent_bone].physical_bone;
+ if (pb) {
+ return pb;
+ } else {
+ return get_physical_bone_parent(parent_bone);
+ }
+}
+
+void Skeleton::_rebuild_physical_bones_cache() {
+ const int b_size = bones.size();
+ for (int i = 0; i < b_size; ++i) {
+ bones[i].cache_parent_physical_bone = _get_physical_bone_parent(i);
+ if (bones[i].physical_bone)
+ bones[i].physical_bone->_on_bone_parent_changed();
+ }
+}
+
+void _pb_stop_simulation(Node *p_node) {
+
+ for (int i = p_node->get_child_count() - 1; 0 <= i; --i) {
+ _pb_stop_simulation(p_node->get_child(i));
+ }
+
+ PhysicalBone *pb = Object::cast_to<PhysicalBone>(p_node);
+ if (pb) {
+ pb->set_simulate_physics(false);
+ pb->set_static_body(false);
+ }
+}
+
+void Skeleton::physical_bones_stop_simulation() {
+ _pb_stop_simulation(this);
+}
+
+void _pb_start_simulation(const Skeleton *p_skeleton, Node *p_node, const Vector<int> &p_sim_bones) {
+
+ for (int i = p_node->get_child_count() - 1; 0 <= i; --i) {
+ _pb_start_simulation(p_skeleton, p_node->get_child(i), p_sim_bones);
+ }
+
+ PhysicalBone *pb = Object::cast_to<PhysicalBone>(p_node);
+ if (pb) {
+ bool sim = false;
+ for (int i = p_sim_bones.size() - 1; 0 <= i; --i) {
+ if (p_sim_bones[i] == pb->get_bone_id() || p_skeleton->is_bone_parent_of(pb->get_bone_id(), p_sim_bones[i])) {
+ sim = true;
+ break;
+ }
+ }
+
+ pb->set_simulate_physics(true);
+ if (sim) {
+ pb->set_static_body(false);
+ } else {
+ pb->set_static_body(true);
+ }
+ }
+}
+
+void Skeleton::physical_bones_start_simulation_on(const Array &p_bones) {
+
+ Vector<int> sim_bones;
+ if (p_bones.size() <= 0) {
+ sim_bones.push_back(0); // if no bones is specified, activate ragdoll on full body
+ } else {
+ sim_bones.resize(p_bones.size());
+ int c = 0;
+ for (int i = sim_bones.size() - 1; 0 <= i; --i) {
+ if (Variant::STRING == p_bones.get(i).get_type()) {
+ int bone_id = find_bone(p_bones.get(i));
+ if (bone_id != -1)
+ sim_bones[c++] = bone_id;
+ }
+ }
+ sim_bones.resize(c);
+ }
+
+ _pb_start_simulation(this, this, sim_bones);
+}
+
+void _physical_bones_add_remove_collision_exception(bool p_add, Node *p_node, RID p_exception) {
+
+ for (int i = p_node->get_child_count() - 1; 0 <= i; --i) {
+ _physical_bones_add_remove_collision_exception(p_add, p_node->get_child(i), p_exception);
+ }
+
+ CollisionObject *co = Object::cast_to<CollisionObject>(p_node);
+ if (co) {
+ if (p_add) {
+ PhysicsServer::get_singleton()->body_add_collision_exception(co->get_rid(), p_exception);
+ } else {
+ PhysicsServer::get_singleton()->body_remove_collision_exception(co->get_rid(), p_exception);
+ }
+ }
+}
+
+void Skeleton::physical_bones_add_collision_exception(RID p_exception) {
+ _physical_bones_add_remove_collision_exception(true, this, p_exception);
+}
+
+void Skeleton::physical_bones_remove_collision_exception(RID p_exception) {
+ _physical_bones_add_remove_collision_exception(false, this, p_exception);
+}
+
void Skeleton::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_bone", "name"), &Skeleton::add_bone);
@@ -558,6 +727,11 @@ void Skeleton::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_bone_transform", "bone_idx"), &Skeleton::get_bone_transform);
+ ClassDB::bind_method(D_METHOD("physical_bones_stop_simulation"), &Skeleton::physical_bones_stop_simulation);
+ ClassDB::bind_method(D_METHOD("physical_bones_start_simulation", "bones"), &Skeleton::physical_bones_start_simulation_on, DEFVAL(Array()));
+ ClassDB::bind_method(D_METHOD("physical_bones_add_collision_exception", "exception"), &Skeleton::physical_bones_add_collision_exception);
+ ClassDB::bind_method(D_METHOD("physical_bones_remove_collision_exception", "exception"), &Skeleton::physical_bones_remove_collision_exception);
+
BIND_CONSTANT(NOTIFICATION_UPDATE_SKELETON);
}
@@ -570,6 +744,5 @@ Skeleton::Skeleton() {
}
Skeleton::~Skeleton() {
-
VisualServer::get_singleton()->free(skeleton);
}
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index d693670055..dad11960a5 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -37,6 +37,8 @@
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
+
+class PhysicalBone;
class Skeleton : public Spatial {
GDCLASS(Skeleton, Spatial);
@@ -48,6 +50,8 @@ class Skeleton : public Spatial {
bool enabled;
int parent;
+ bool ignore_animation;
+
bool disable_rest;
Transform rest;
Transform rest_global_inverse;
@@ -60,13 +64,19 @@ class Skeleton : public Spatial {
Transform transform_final;
+ PhysicalBone *physical_bone;
+ PhysicalBone *cache_parent_physical_bone;
+
List<uint32_t> nodes_bound;
Bone() {
parent = -1;
enabled = true;
+ ignore_animation = false;
custom_pose_enable = false;
disable_rest = false;
+ physical_bone = NULL;
+ cache_parent_physical_bone = NULL;
}
};
@@ -110,14 +120,19 @@ public:
// skeleton creation api
void add_bone(const String &p_name);
- int find_bone(String p_name) const;
+ int find_bone(const String &p_name) const;
String get_bone_name(int p_bone) const;
+ bool is_bone_parent_of(int p_bone_id, int p_parent_bone_id) const;
+
void set_bone_parent(int p_bone, int p_parent);
int get_bone_parent(int p_bone) const;
void unparent_bone_and_rest(int p_bone);
+ void set_bone_ignore_animation(int p_bone, bool p_ignore);
+ bool is_bone_ignore_animation(int p_bone) const;
+
void set_bone_disable_rest(int p_bone, bool p_disable);
bool is_bone_rest_disabled(int p_bone) const;
@@ -149,6 +164,26 @@ public:
void localize_rests(); // used for loaders and tools
+ // Physical bone API
+
+ void bind_physical_bone_to_bone(int p_bone, PhysicalBone *p_physical_bone);
+ void unbind_physical_bone_from_bone(int p_bone);
+
+ PhysicalBone *get_physical_bone(int p_bone);
+ PhysicalBone *get_physical_bone_parent(int p_bone);
+
+private:
+ /// This is a slow API os it's cached
+ PhysicalBone *_get_physical_bone_parent(int p_bone);
+ void _rebuild_physical_bones_cache();
+
+public:
+ void physical_bones_stop_simulation();
+ void physical_bones_start_simulation_on(const Array &p_bones);
+ void physical_bones_add_collision_exception(RID p_exception);
+ void physical_bones_remove_collision_exception(RID p_exception);
+
+public:
Skeleton();
~Skeleton();
};
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index dab0e573d7..748aa8aad4 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -286,6 +286,16 @@ Transform Spatial::get_global_transform() const {
return data.global_transform;
}
+#ifdef TOOLS_ENABLED
+Transform Spatial::get_global_gizmo_transform() const {
+ return get_global_transform();
+}
+
+Transform Spatial::get_local_gizmo_transform() const {
+ return get_transform();
+}
+#endif
+
Spatial *Spatial::get_parent_spatial() const {
return data.parent;
@@ -430,10 +440,9 @@ Ref<SpatialGizmo> Spatial::get_gizmo() const {
#endif
}
-#ifdef TOOLS_ENABLED
-
void Spatial::_update_gizmo() {
+#ifdef TOOLS_ENABLED
if (!is_inside_world())
return;
data.gizmo_dirty = false;
@@ -445,8 +454,10 @@ void Spatial::_update_gizmo() {
data.gizmo->clear();
}
}
+#endif
}
+#ifdef TOOLS_ENABLED
void Spatial::set_disable_gizmo(bool p_enabled) {
data.gizmo_disabled = p_enabled;
@@ -726,9 +737,7 @@ void Spatial::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel);
ClassDB::bind_method(D_METHOD("get_world"), &Spatial::get_world);
-#ifdef TOOLS_ENABLED
ClassDB::bind_method(D_METHOD("_update_gizmo"), &Spatial::_update_gizmo);
-#endif
ClassDB::bind_method(D_METHOD("update_gizmo"), &Spatial::update_gizmo);
ClassDB::bind_method(D_METHOD("set_gizmo", "gizmo"), &Spatial::set_gizmo);
@@ -790,9 +799,7 @@ void Spatial::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_scale", "get_scale");
ADD_GROUP("Visibility", "");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "visible"), "set_visible", "is_visible");
-#ifdef TOOLS_ENABLED
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "SpatialGizmo", 0), "set_gizmo", "get_gizmo");
-#endif
ADD_SIGNAL(MethodInfo("visibility_changed"));
}
diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h
index 518bba9a51..a43bed3e4a 100644
--- a/scene/3d/spatial.h
+++ b/scene/3d/spatial.h
@@ -100,10 +100,8 @@ class Spatial : public Node {
#endif
} data;
-#ifdef TOOLS_ENABLED
void _update_gizmo();
-#endif
void _notify_dirty();
void _propagate_transform_changed(Spatial *p_origin);
@@ -147,6 +145,11 @@ public:
Transform get_transform() const;
Transform get_global_transform() const;
+#ifdef TOOLS_ENABLED
+ virtual Transform get_global_gizmo_transform() const;
+ virtual Transform get_local_gizmo_transform() const;
+#endif
+
void set_as_toplevel(bool p_enabled);
bool is_set_as_toplevel() const;
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index bc44c91f64..232855c978 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -366,17 +366,11 @@ void Sprite3D::_draw() {
final_rect.position * pixel_size,
};
-
- // Properly setup UVs for impostor textures (AtlasTexture).
- RID texture_rid = texture->get_rid();
- Vector2 src_tsize = Vector2(
- VS::get_singleton()->texture_get_width(texture_rid),
- VS::get_singleton()->texture_get_height(texture_rid));
Vector2 uvs[4] = {
- final_src_rect.position / src_tsize,
- (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize,
- (final_src_rect.position + final_src_rect.size) / src_tsize,
- (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize,
+ final_src_rect.position / tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
+ (final_src_rect.position + final_src_rect.size) / tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
};
if (is_flipped_h()) {
@@ -655,23 +649,18 @@ void AnimatedSprite3D::_draw() {
float pixel_size = get_pixel_size();
Vector2 vertices[4] = {
+
(final_rect.position + Vector2(0, final_rect.size.y)) * pixel_size,
(final_rect.position + final_rect.size) * pixel_size,
(final_rect.position + Vector2(final_rect.size.x, 0)) * pixel_size,
final_rect.position * pixel_size,
};
-
- // Properly setup UVs for impostor textures (AtlasTexture).
- RID texture_rid = texture->get_rid();
- Vector2 src_tsize = Vector2(
- VS::get_singleton()->texture_get_width(texture_rid),
- VS::get_singleton()->texture_get_height(texture_rid));
Vector2 uvs[4] = {
- final_src_rect.position / src_tsize,
- (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / src_tsize,
- (final_src_rect.position + final_src_rect.size) / src_tsize,
- (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / src_tsize,
+ final_src_rect.position / tsize,
+ (final_src_rect.position + Vector2(final_src_rect.size.x, 0)) / tsize,
+ (final_src_rect.position + final_src_rect.size) / tsize,
+ (final_src_rect.position + Vector2(0, final_src_rect.size.y)) / tsize,
};
if (is_flipped_h()) {
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index b72665aa2b..a239e7e871 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -672,13 +672,8 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) {
m_forwardImpulse.resize(numWheel);
m_sideImpulse.resize(numWheel);
- int numWheelsOnGround = 0;
-
//collapse all those loops into one!
for (int i = 0; i < wheels.size(); i++) {
- VehicleWheel &wheelInfo = *wheels[i];
- if (wheelInfo.m_raycastInfo.m_isInContact)
- numWheelsOnGround++;
m_sideImpulse[i] = real_t(0.);
m_forwardImpulse[i] = real_t(0.);
}
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 13700e0bd3..670df5cc7f 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -2316,13 +2316,10 @@ Ref<MultiMesh> VoxelLightBaker::create_debug_multimesh(DebugMode p_mode) {
PoolVector<Vector3> vertices;
PoolVector<Color> colors;
-
- int vtx_idx = 0;
#define ADD_VTX(m_idx) \
; \
vertices.push_back(face_points[m_idx]); \
- colors.push_back(Color(1, 1, 1, 1)); \
- vtx_idx++;
+ colors.push_back(Color(1, 1, 1, 1));
for (int i = 0; i < 6; i++) {
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index eca7caeaf0..a0e0137863 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -246,8 +246,9 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) {
if (a->track_get_path(i).get_subname_count() == 1 && Object::cast_to<Skeleton>(child)) {
- bone_idx = Object::cast_to<Skeleton>(child)->find_bone(a->track_get_path(i).get_subname(0));
- if (bone_idx == -1) {
+ Skeleton *sk = Object::cast_to<Skeleton>(child);
+ bone_idx = sk->find_bone(a->track_get_path(i).get_subname(0));
+ if (bone_idx == -1 || sk->is_bone_ignore_animation(bone_idx)) {
continue;
}
@@ -506,7 +507,6 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, float p_blend) {
float delta = p_delta * speed_scale * cd.speed_scale;
- bool backwards = delta < 0;
float next_pos = cd.pos + delta;
float len = cd.from->animation->get_length();
@@ -524,6 +524,8 @@ void AnimationPlayer::_animation_process_data(PlaybackData &cd, float p_delta, f
if (&cd == &playback.current) {
+ bool backwards = delta < 0;
+
if (!backwards && cd.pos <= len && next_pos == len /*&& playback.blend.empty()*/) {
//playback finished
end_reached = true;
@@ -579,16 +581,14 @@ void AnimationPlayer::_animation_process2(float p_delta) {
}
void AnimationPlayer::_animation_update_transforms() {
+ {
+ Transform t;
+ for (int i = 0; i < cache_update_size; i++) {
- for (int i = 0; i < cache_update_size; i++) {
-
- TrackNodeCache *nc = cache_update[i];
-
- ERR_CONTINUE(nc->accum_pass != accum_pass);
+ TrackNodeCache *nc = cache_update[i];
- if (nc->spatial) {
+ ERR_CONTINUE(nc->accum_pass != accum_pass);
- Transform t;
t.origin = nc->loc_accum;
t.basis.set_quat_scale(nc->rot_accum, nc->scale_accum);
if (nc->skeleton && nc->bone_idx >= 0) {
@@ -1208,7 +1208,7 @@ NodePath AnimationPlayer::get_root() const {
void AnimationPlayer::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
String pf = p_function;
- if (p_function == "play" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue") {
+ if (p_function == "play" || p_function == "play_backwards" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue") {
List<StringName> al;
get_animation_list(&al);
for (List<StringName>::Element *E = al.front(); E; E = E->next()) {
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index afdb8b6f71..ce5b372d72 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -812,6 +812,12 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
t.value = t.object->get_indexed(t.subpath);
t.value.zero();
+
+ if (t.skeleton) {
+ t.skip = t.skeleton->is_bone_ignore_animation(t.bone_idx);
+ } else {
+ t.skip = false;
+ }
}
/* STEP 2 PROCESS ANIMATIONS */
@@ -884,7 +890,7 @@ void AnimationTreePlayer::_process_animation(float p_delta) {
Track &t = E->get();
- if (!t.object)
+ if (t.skip || !t.object)
continue;
if (t.subpath.size()) { // value track
diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h
index 873ff8a9da..09d6f6fcb4 100644
--- a/scene/animation/animation_tree_player.h
+++ b/scene/animation/animation_tree_player.h
@@ -107,6 +107,8 @@ private:
Vector3 scale;
Variant value;
+
+ bool skip;
};
typedef Map<TrackKey, Track> TrackMap;
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index dbfb96697d..acdbd9de08 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -60,7 +60,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
Ref<InputEventMouseButton> b = p_event;
if (b.is_valid()) {
- if (status.disabled || b->get_button_index() != 1)
+ if (status.disabled || ((1 << (b->get_button_index() - 1)) & button_mask) == 0)
return;
if (status.pressing_button)
@@ -408,6 +408,16 @@ BaseButton::ActionMode BaseButton::get_action_mode() const {
return action_mode;
}
+void BaseButton::set_button_mask(int p_mask) {
+
+ button_mask = p_mask;
+}
+
+int BaseButton::get_button_mask() const {
+
+ return button_mask;
+}
+
void BaseButton::set_enabled_focus_mode(FocusMode p_mode) {
enabled_focus_mode = p_mode;
@@ -496,6 +506,8 @@ void BaseButton::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_disabled"), &BaseButton::is_disabled);
ClassDB::bind_method(D_METHOD("set_action_mode", "mode"), &BaseButton::set_action_mode);
ClassDB::bind_method(D_METHOD("get_action_mode"), &BaseButton::get_action_mode);
+ ClassDB::bind_method(D_METHOD("set_button_mask", "mask"), &BaseButton::set_button_mask);
+ ClassDB::bind_method(D_METHOD("get_button_mask"), &BaseButton::get_button_mask);
ClassDB::bind_method(D_METHOD("get_draw_mode"), &BaseButton::get_draw_mode);
ClassDB::bind_method(D_METHOD("set_enabled_focus_mode", "mode"), &BaseButton::set_enabled_focus_mode);
ClassDB::bind_method(D_METHOD("get_enabled_focus_mode"), &BaseButton::get_enabled_focus_mode);
@@ -517,6 +529,7 @@ void BaseButton::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toggle_mode"), "set_toggle_mode", "is_toggle_mode");
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
ADD_PROPERTYNO(PropertyInfo(Variant::INT, "action_mode", PROPERTY_HINT_ENUM, "Button Press,Button Release"), "set_action_mode", "get_action_mode");
+ ADD_PROPERTYNO(PropertyInfo(Variant::INT, "button_mask", PROPERTY_HINT_FLAGS, "Mouse Left, Mouse Right, Mouse Middle"), "set_button_mask", "get_button_mask");
ADD_PROPERTY(PropertyInfo(Variant::INT, "enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All"), "set_enabled_focus_mode", "get_enabled_focus_mode");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shortcut", PROPERTY_HINT_RESOURCE_TYPE, "ShortCut"), "set_shortcut", "get_shortcut");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "group", PROPERTY_HINT_RESOURCE_TYPE, "ButtonGroup"), "set_button_group", "get_button_group");
@@ -542,6 +555,7 @@ BaseButton::BaseButton() {
set_focus_mode(FOCUS_ALL);
enabled_focus_mode = FOCUS_ALL;
action_mode = ACTION_MODE_BUTTON_RELEASE;
+ button_mask = BUTTON_MASK_LEFT;
}
BaseButton::~BaseButton() {
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index 6917e112ab..79638bbcce 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -49,6 +49,7 @@ public:
};
private:
+ int button_mask;
bool toggle_mode;
FocusMode enabled_focus_mode;
Ref<ShortCut> shortcut;
@@ -104,6 +105,9 @@ public:
void set_action_mode(ActionMode p_mode);
ActionMode get_action_mode() const;
+ void set_button_mask(int p_mask);
+ int get_button_mask() const;
+
void set_enabled_focus_mode(FocusMode p_mode);
FocusMode get_enabled_focus_mode() const;
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 511dc248a0..57b9a9a11b 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -1121,6 +1121,7 @@ void ItemList::_notification(int p_what) {
text_ofs += base_ofs;
text_ofs += items[i].rect_cache.position;
+ FontDrawer drawer(font, Color(1, 1, 1));
for (int j = 0; j < ss; j++) {
if (j == line_limit_cache[line]) {
@@ -1129,7 +1130,7 @@ void ItemList::_notification(int p_what) {
if (line >= max_text_lines)
break;
}
- ofs += font->draw_char(get_canvas_item(), text_ofs + Vector2(ofs + (max_len - line_size_cache[line]) / 2, line * (font_height + line_separation)).floor(), items[i].text[j], items[i].text[j + 1], modulate);
+ ofs += drawer.draw_char(get_canvas_item(), text_ofs + Vector2(ofs + (max_len - line_size_cache[line]) / 2, line * (font_height + line_separation)).floor(), items[i].text[j], items[i].text[j + 1], modulate);
}
//special multiline mode
@@ -1243,7 +1244,7 @@ bool ItemList::is_pos_at_end_of_items(const Point2 &p_pos) const {
String ItemList::get_tooltip(const Point2 &p_pos) const {
- int closest = get_item_at_position(p_pos);
+ int closest = get_item_at_position(p_pos, true);
if (closest != -1) {
if (!items[closest].tooltip_enabled) {
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 830f724b3c..f1b0d36f32 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -93,6 +93,7 @@ void Label::_notification(int p_what) {
bool use_outline = get_constant("shadow_as_outline");
Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
int line_spacing = get_constant("line_spacing");
+ Color font_outline_modulate = get_color("font_outline_modulate");
style->draw(ci, Rect2(Point2(0, 0), get_size()));
@@ -150,6 +151,7 @@ void Label::_notification(int p_what) {
int line = 0;
int line_to = lines_skipped + (lines_visible > 0 ? lines_visible : 1);
+ FontDrawer drawer(font, font_outline_modulate);
while (wc) {
/* handle lines not meant to be drawn quickly */
if (line >= line_to)
@@ -244,11 +246,11 @@ void Label::_notification(int p_what) {
n = String::char_uppercase(c);
}
- float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + shadow_ofs, c, n, font_color_shadow);
+ float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + shadow_ofs, c, n, font_color_shadow, false);
if (use_outline) {
- font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, shadow_ofs.y), c, n, font_color_shadow);
- font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow);
- font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, shadow_ofs.y), c, n, font_color_shadow, false);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow, false);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs) + Vector2(-shadow_ofs.x, -shadow_ofs.y), c, n, font_color_shadow, false);
}
x_ofs_shadow += move;
chars_total_shadow++;
@@ -265,7 +267,7 @@ void Label::_notification(int p_what) {
n = String::char_uppercase(c);
}
- x_ofs += font->draw_char(ci, Point2(x_ofs, y_ofs), c, n, font_color);
+ x_ofs += drawer.draw_char(ci, Point2(x_ofs, y_ofs), c, n, font_color);
chars_total++;
}
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index e3b8baf0c0..e57af0a4c0 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -656,6 +656,7 @@ void LineEdit::_notification(int p_what) {
}
int caret_height = font->get_height() > y_area ? y_area : font->get_height();
+ FontDrawer drawer(font, Color(1, 1, 1));
while (true) {
//end of string, break!
@@ -683,7 +684,7 @@ void LineEdit::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
}
- font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
+ drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
x_ofs += im_char_width;
ofs++;
@@ -704,7 +705,7 @@ void LineEdit::_notification(int p_what) {
if (selected)
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color);
- font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color);
+ drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color);
if (char_ofs == cursor_pos && draw_caret) {
if (ime_text.length() == 0) {
@@ -737,7 +738,7 @@ void LineEdit::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color);
}
- font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
+ drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color);
x_ofs += im_char_width;
ofs++;
@@ -1349,12 +1350,12 @@ PopupMenu *LineEdit::get_menu() const {
return menu;
}
-#ifdef TOOLS_ENABLED
void LineEdit::_editor_settings_changed() {
+#ifdef TOOLS_ENABLED
cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false));
cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65));
-}
#endif
+}
void LineEdit::set_expand_to_text_length(bool p_enabled) {
@@ -1423,9 +1424,7 @@ void LineEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("_text_changed"), &LineEdit::_text_changed);
ClassDB::bind_method(D_METHOD("_toggle_draw_caret"), &LineEdit::_toggle_draw_caret);
-#ifdef TOOLS_ENABLED
ClassDB::bind_method("_editor_settings_changed", &LineEdit::_editor_settings_changed);
-#endif
ClassDB::bind_method(D_METHOD("set_align", "align"), &LineEdit::set_align);
ClassDB::bind_method(D_METHOD("get_align"), &LineEdit::get_align);
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index 48dde2461e..e9314ba8dd 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -124,7 +124,6 @@ private:
void shift_selection_check_post(bool);
void selection_fill_at_cursor();
- void selection_delete();
void set_window_pos(int p_pos);
void set_cursor_at_pixel_pos(int p_x);
@@ -135,9 +134,7 @@ private:
void clear_internal();
void changed_internal();
-#ifdef TOOLS_ENABLED
void _editor_settings_changed();
-#endif
void _gui_input(Ref<InputEvent> p_event);
void _notification(int p_what);
@@ -160,6 +157,7 @@ public:
void select(int p_from = 0, int p_to = -1);
void select_all();
+ void selection_delete();
void deselect();
void delete_char();
diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp
index a9402d6404..c5e4149782 100644
--- a/scene/gui/option_button.cpp
+++ b/scene/gui/option_button.cpp
@@ -297,7 +297,7 @@ void OptionButton::_bind_methods() {
ClassDB::bind_method(D_METHOD("_focused"), &OptionButton::_focused);
ClassDB::bind_method(D_METHOD("add_item", "label", "id"), &OptionButton::add_item, DEFVAL(-1));
- ClassDB::bind_method(D_METHOD("add_icon_item", "texture", "label", "id"), &OptionButton::add_icon_item);
+ ClassDB::bind_method(D_METHOD("add_icon_item", "texture", "label", "id"), &OptionButton::add_icon_item, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("set_item_text", "idx", "text"), &OptionButton::set_item_text);
ClassDB::bind_method(D_METHOD("set_item_icon", "idx", "texture"), &OptionButton::set_item_icon);
ClassDB::bind_method(D_METHOD("set_item_disabled", "idx", "disabled"), &OptionButton::set_item_disabled);
diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp
index c85bed0451..37e519e375 100644
--- a/scene/gui/progress_bar.cpp
+++ b/scene/gui/progress_bar.cpp
@@ -33,13 +33,16 @@
Size2 ProgressBar::get_minimum_size() const {
Ref<StyleBox> bg = get_stylebox("bg");
+ Ref<StyleBox> fg = get_stylebox("fg");
Ref<Font> font = get_font("font");
- Size2 ms = bg->get_minimum_size() + bg->get_center_size();
+ Size2 minimum_size = bg->get_minimum_size();
+ minimum_size.height = MAX(minimum_size.height, fg->get_minimum_size().height);
+ minimum_size.width = MAX(minimum_size.width, fg->get_minimum_size().width);
if (percent_visible) {
- ms.height = MAX(ms.height, bg->get_minimum_size().height + font->get_height());
+ minimum_size.height = MAX(minimum_size.height, bg->get_minimum_size().height + font->get_height());
}
- return ms;
+ return minimum_size;
}
void ProgressBar::_notification(int p_what) {
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 1fcde9e9a8..f34559fc8d 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -86,11 +86,59 @@ RichTextLabel::Item *RichTextLabel::_get_next_item(Item *p_item, bool p_free) {
return NULL;
}
+RichTextLabel::Item *RichTextLabel::_get_prev_item(Item *p_item, bool p_free) {
+ if (p_free) {
+
+ if (p_item->subitems.size()) {
+
+ return p_item->subitems.back()->get();
+ } else if (!p_item->parent) {
+ return NULL;
+ } else if (p_item->E->prev()) {
+
+ return p_item->E->prev()->get();
+ } else {
+ //go back until something with a prev is found
+ while (p_item->parent && !p_item->E->prev()) {
+ p_item = p_item->parent;
+ }
+
+ if (p_item->parent)
+ return p_item->E->prev()->get();
+ else
+ return NULL;
+ }
+
+ } else {
+ if (p_item->subitems.size() && p_item->type != ITEM_TABLE) {
+
+ return p_item->subitems.back()->get();
+ } else if (p_item->type == ITEM_FRAME) {
+ return NULL;
+ } else if (p_item->E->prev()) {
+
+ return p_item->E->prev()->get();
+ } else {
+ //go back until something with a prev is found
+ while (p_item->type != ITEM_FRAME && !p_item->E->prev()) {
+ p_item = p_item->parent;
+ }
+
+ if (p_item->type != ITEM_FRAME)
+ return p_item->E->prev()->get();
+ else
+ return NULL;
+ }
+ }
+
+ return NULL;
+}
+
Rect2 RichTextLabel::_get_text_rect() {
Ref<StyleBox> style = get_stylebox("normal");
return Rect2(style->get_offset(), get_size() - style->get_minimum_size());
}
-int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Point2i &p_click_pos, Item **r_click_item, int *r_click_char, bool *r_outside, int p_char_count) {
+int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &shadow_ofs, const Point2i &p_click_pos, Item **r_click_item, int *r_click_char, bool *r_outside, int p_char_count) {
RID ci;
if (r_outside)
@@ -269,10 +317,12 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
int descent = font->get_descent();
Color color;
+ Color font_color_shadow;
bool underline = false;
if (p_mode == PROCESS_DRAW) {
color = _find_color(text, p_base_color);
+ font_color_shadow = _find_color(text, p_font_color_shadow);
underline = _find_underline(text);
if (_find_meta(text, &meta)) {
@@ -284,7 +334,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
}
rchar = 0;
-
+ FontDrawer drawer(font, Color(1, 1, 1));
while (*c) {
int end = 0;
@@ -297,7 +347,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
line_ascent = line < l.ascent_caches.size() ? l.ascent_caches[line] : 1;
line_descent = line < l.descent_caches.size() ? l.descent_caches[line] : 1;
}
-
while (c[end] != 0 && !(end && c[end - 1] == ' ' && c[end] != ' ')) {
int cw = font->get_char_size(c[end], c[end + 1]).width;
@@ -314,7 +363,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
end++;
}
-
CHECK_HEIGHT(fh);
ENSURE_WIDTH(w);
@@ -376,16 +424,30 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (c[i] == '\t')
visible = false;
- if (selected) {
+ if (visible) {
+ if (selected) {
+ cw = font->get_char_size(c[i], c[i + 1]).x;
+ draw_rect(Rect2(p_ofs.x + pofs, p_ofs.y + y, cw, lh), selection_bg);
+ }
- cw = font->get_char_size(c[i], c[i + 1]).x;
- draw_rect(Rect2(p_ofs.x + pofs, p_ofs.y + y, cw, lh), selection_bg);
- if (visible)
- font->draw_char(ci, p_ofs + Point2(align_ofs + pofs, y + lh - line_descent), c[i], c[i + 1], override_selected_font_color ? selection_fg : color);
+ if (p_font_color_shadow.a > 0) {
+ float x_ofs_shadow = align_ofs + pofs;
+ float y_ofs_shadow = y + lh - line_descent;
+ float move = font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + shadow_ofs, c[i], c[i + 1], p_font_color_shadow);
+
+ if (p_shadow_as_outline) {
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(shadow_ofs.x, -shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
+ font->draw_char(ci, Point2(x_ofs_shadow, y_ofs_shadow) + Vector2(-shadow_ofs.x, -shadow_ofs.y), c[i], c[i + 1], p_font_color_shadow);
+ }
+ x_ofs_shadow += move;
+ }
- } else {
- if (visible)
- cw = font->draw_char(ci, p_ofs + Point2(align_ofs + pofs, y + lh - line_descent), c[i], c[i + 1], color);
+ if (selected) {
+ drawer.draw_char(ci, p_ofs + Point2(align_ofs + pofs, y + lh - line_descent), c[i], c[i + 1], override_selected_font_color ? selection_fg : color);
+ } else {
+ cw = drawer.draw_char(ci, p_ofs + Point2(align_ofs + pofs, y + lh - line_descent), c[i], c[i + 1], color);
+ }
}
p_char_count++;
@@ -464,6 +526,9 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
int vseparation = get_constant("table_vseparation");
Color ccolor = _find_color(table, p_base_color);
Vector2 draw_ofs = Point2(wofs, y);
+ Color font_color_shadow = get_color("font_color_shadow");
+ bool use_outline = get_constant("shadow_as_outline");
+ Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
if (p_mode == PROCESS_CACHE) {
@@ -487,7 +552,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
for (int i = 0; i < frame->lines.size(); i++) {
- _process_line(frame, Point2(), ly, available_width, i, PROCESS_CACHE, cfont, Color());
+ _process_line(frame, Point2(), ly, available_width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs);
table->columns[column].min_width = MAX(table->columns[column].min_width, frame->lines[i].minimum_width);
table->columns[column].max_width = MAX(table->columns[column].max_width, frame->lines[i].maximum_width);
}
@@ -560,7 +625,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
for (int i = 0; i < frame->lines.size(); i++) {
int ly = 0;
- _process_line(frame, Point2(), ly, table->columns[column].width, i, PROCESS_CACHE, cfont, Color());
+ _process_line(frame, Point2(), ly, table->columns[column].width, i, PROCESS_CACHE, cfont, Color(), font_color_shadow, use_outline, shadow_ofs);
frame->lines[i].height_cache = ly; //actual height
frame->lines[i].height_accum_cache = ly; //actual height
}
@@ -593,9 +658,9 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
if (visible) {
if (p_mode == PROCESS_DRAW) {
- nonblank_line_count += _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_DRAW, cfont, ccolor);
+ nonblank_line_count += _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_DRAW, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs);
} else if (p_mode == PROCESS_POINTER) {
- _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_POINTER, cfont, ccolor, p_click_pos, r_click_item, r_click_char, r_outside);
+ _process_line(frame, p_ofs + offset + draw_ofs + Vector2(0, yofs), ly, table->columns[column].width, i, PROCESS_POINTER, cfont, ccolor, font_color_shadow, use_outline, shadow_ofs, p_click_pos, r_click_item, r_click_char, r_outside);
if (r_click_item && *r_click_item) {
RETURN; // exit early
}
@@ -676,9 +741,7 @@ void RichTextLabel::_scroll_changed(double) {
void RichTextLabel::_update_scroll() {
- int total_height = 0;
- if (main->lines.size())
- total_height = main->lines[main->lines.size() - 1].height_accum_cache + get_stylebox("normal")->get_minimum_size().height;
+ int total_height = get_content_height();
bool exceeds = total_height > get_size().height && scroll_active;
@@ -767,12 +830,18 @@ void RichTextLabel::_notification(int p_what) {
int y = (main->lines[from_line].height_accum_cache - main->lines[from_line].height_cache) - ofs;
Ref<Font> base_font = get_font("normal_font");
Color base_color = get_color("default_color");
+ Color font_color_shadow = get_color("font_color_shadow");
+ bool use_outline = get_constant("shadow_as_outline");
+ Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
+
+ float x_ofs = 0;
visible_line_count = 0;
while (y < size.height && from_line < main->lines.size()) {
- visible_line_count += _process_line(main, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, Point2i(), NULL, NULL, NULL, total_chars);
+ visible_line_count += _process_line(main, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_DRAW, base_font, base_color, font_color_shadow, use_outline, shadow_ofs, Point2i(), NULL, NULL, NULL, total_chars);
total_chars += main->lines[from_line].char_count;
+
from_line++;
}
}
@@ -787,6 +856,9 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item
Size2 size = get_size();
Rect2 text_rect = _get_text_rect();
int ofs = vscroll->get_value();
+ Color font_color_shadow = get_color("font_color_shadow");
+ bool use_outline = get_constant("shadow_as_outline");
+ Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
//todo, change to binary search
int from_line = 0;
@@ -807,7 +879,7 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item
while (y < text_rect.get_size().height && from_line < p_frame->lines.size()) {
- _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_POINTER, base_font, base_color, p_click, r_click_item, r_click_char, r_outside);
+ _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, from_line, PROCESS_POINTER, base_font, base_color, font_color_shadow, use_outline, shadow_ofs, p_click, r_click_item, r_click_char, r_outside);
if (r_click_item && *r_click_item)
return;
from_line++;
@@ -1182,13 +1254,16 @@ void RichTextLabel::_validate_line_caches(ItemFrame *p_frame) {
//validate invalid lines
Size2 size = get_size();
Rect2 text_rect = _get_text_rect();
+ Color font_color_shadow = get_color("font_color_shadow");
+ bool use_outline = get_constant("shadow_as_outline");
+ Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
Ref<Font> base_font = get_font("normal_font");
for (int i = p_frame->first_invalid_line; i < p_frame->lines.size(); i++) {
int y = 0;
- _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, i, PROCESS_CACHE, base_font, Color());
+ _process_line(p_frame, text_rect.get_position(), y, text_rect.get_size().width - scroll_w, i, PROCESS_CACHE, base_font, Color(), font_color_shadow, use_outline, shadow_ofs);
p_frame->lines[i].height_cache = y;
p_frame->lines[i].height_accum_cache = y;
@@ -1862,7 +1937,7 @@ void RichTextLabel::set_selection_enabled(bool p_enabled) {
}
}
-bool RichTextLabel::search(const String &p_string, bool p_from_selection) {
+bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p_search_previous) {
ERR_FAIL_COND_V(!selection.enabled, false);
Item *it = main;
@@ -1911,7 +1986,10 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection) {
}
}
- it = _get_next_item(it, true);
+ if (p_search_previous)
+ it = _get_prev_item(it, true);
+ else
+ it = _get_next_item(it, true);
charidx = 0;
}
@@ -2030,6 +2108,13 @@ float RichTextLabel::get_percent_visible() const {
return percent_visible;
}
+int RichTextLabel::get_content_height() {
+ int total_height = 0;
+ if (main->lines.size())
+ total_height = main->lines[main->lines.size() - 1].height_accum_cache + get_stylebox("normal")->get_minimum_size().height;
+ return total_height;
+}
+
void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &RichTextLabel::_gui_input);
@@ -2096,6 +2181,8 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_line_count"), &RichTextLabel::get_line_count);
ClassDB::bind_method(D_METHOD("get_visible_line_count"), &RichTextLabel::get_visible_line_count);
+ ClassDB::bind_method(D_METHOD("get_content_height"), &RichTextLabel::get_content_height);
+
ADD_GROUP("BBCode", "bbcode_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "bbcode_enabled"), "set_use_bbcode", "is_using_bbcode");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "bbcode_text", PROPERTY_HINT_MULTILINE_TEXT), "set_bbcode", "get_bbcode");
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index 83938cff61..af368af46a 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -190,7 +190,6 @@ private:
struct ItemNewline : public Item {
- int line; // FIXME: Overriding base's line ?
ItemNewline() { type = ITEM_NEWLINE; }
};
@@ -270,7 +269,7 @@ private:
int visible_characters;
float percent_visible;
- int _process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Point2i &p_click_pos = Point2i(), Item **r_click_item = NULL, int *r_click_char = NULL, bool *r_outside = NULL, int p_char_count = 0);
+ int _process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &y, int p_width, int p_line, ProcessMode p_mode, const Ref<Font> &p_base_font, const Color &p_base_color, const Color &p_font_color_shadow, bool p_shadow_as_outline, const Point2 &shadow_ofs, const Point2i &p_click_pos = Point2i(), Item **r_click_item = NULL, int *r_click_char = NULL, bool *r_outside = NULL, int p_char_count = 0);
void _find_click(ItemFrame *p_frame, const Point2i &p_click, Item **r_click_item = NULL, int *r_click_char = NULL, bool *r_outside = NULL);
Ref<Font> _find_font(Item *p_item);
@@ -285,6 +284,7 @@ private:
void _gui_input(Ref<InputEvent> p_event);
Item *_get_next_item(Item *p_item, bool p_free = false);
+ Item *_get_prev_item(Item *p_item, bool p_free = false);
Rect2 _get_text_rect();
@@ -334,12 +334,14 @@ public:
void set_tab_size(int p_spaces);
int get_tab_size() const;
- bool search(const String &p_string, bool p_from_selection = false);
+ bool search(const String &p_string, bool p_from_selection = false, bool p_search_previous = false);
void scroll_to_line(int p_line);
int get_line_count() const;
int get_visible_line_count() const;
+ int get_content_height();
+
VScrollBar *get_v_scroll() { return vscroll; }
virtual CursorShape get_cursor_shape(const Point2 &p_pos) const;
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index bf7033e8ba..c38c411333 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -33,13 +33,6 @@
#include "label.h"
#include "margin_container.h"
-struct _MinSizeCache {
-
- int min_size;
- bool will_stretch;
- int final_size;
-};
-
Control *SplitContainer::_getch(int p_idx) const {
int idx = 0;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 24a13db3c3..553c2b7c39 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -117,7 +117,6 @@ void TextEdit::Text::set_indent_size(int p_indent_size) {
void TextEdit::Text::_update_line_cache(int p_line) const {
int w = 0;
- int tab_w = font->get_char_size(' ').width * indent_size;
int len = text[p_line].data.length();
const CharType *str = text[p_line].data.c_str();
@@ -125,22 +124,13 @@ void TextEdit::Text::_update_line_cache(int p_line) const {
//update width
for (int i = 0; i < len; i++) {
- if (str[i] == '\t') {
-
- int left = w % tab_w;
- if (left == 0)
- w += tab_w;
- else
- w += tab_w - w % tab_w; // is right...
-
- } else {
-
- w += font->get_char_size(str[i], str[i + 1]).width;
- }
+ w += get_char_width(str[i], str[i + 1], w);
}
text[p_line].width_cache = w;
+ text[p_line].wrap_amount_cache = -1;
+
//update regions
text[p_line].region_info.clear();
@@ -242,10 +232,32 @@ int TextEdit::Text::get_line_width(int p_line) const {
return text[p_line].width_cache;
}
-void TextEdit::Text::clear_caches() {
+void TextEdit::Text::set_line_wrap_amount(int p_line, int p_wrap_amount) const {
+
+ ERR_FAIL_INDEX(p_line, text.size());
+
+ text[p_line].wrap_amount_cache = p_wrap_amount;
+}
+
+int TextEdit::Text::get_line_wrap_amount(int p_line) const {
+
+ ERR_FAIL_INDEX_V(p_line, text.size(), -1);
+
+ return text[p_line].wrap_amount_cache;
+}
+
+void TextEdit::Text::clear_width_cache() {
- for (int i = 0; i < text.size(); i++)
+ for (int i = 0; i < text.size(); i++) {
text[i].width_cache = -1;
+ }
+}
+
+void TextEdit::Text::clear_wrap_cache() {
+
+ for (int i = 0; i < text.size(); i++) {
+ text[i].wrap_amount_cache = -1;
+ }
}
void TextEdit::Text::clear() {
@@ -270,6 +282,7 @@ void TextEdit::Text::set(int p_line, const String &p_text) {
ERR_FAIL_INDEX(p_line, text.size());
text[p_line].width_cache = -1;
+ text[p_line].wrap_amount_cache = -1;
text[p_line].data = p_text;
}
@@ -280,6 +293,7 @@ void TextEdit::Text::insert(int p_at, const String &p_text) {
line.breakpoint = false;
line.hidden = false;
line.width_cache = -1;
+ line.wrap_amount_cache = -1;
line.data = p_text;
text.insert(p_at, line);
}
@@ -288,6 +302,25 @@ void TextEdit::Text::remove(int p_at) {
text.remove(p_at);
}
+int TextEdit::Text::get_char_width(char c, char next_c, int px) const {
+
+ int tab_w = font->get_char_size(' ').width * indent_size;
+ int w = 0;
+
+ if (c == '\t') {
+
+ int left = px % tab_w;
+ if (left == 0)
+ w = tab_w;
+ else
+ w = tab_w - px % tab_w; // is right...
+ } else {
+
+ w = font->get_char_size(c, next_c).width;
+ }
+ return w;
+}
+
void TextEdit::_update_scrollbars() {
Size2 size = get_size();
@@ -302,9 +335,12 @@ void TextEdit::_update_scrollbars() {
int hscroll_rows = ((hmin.height - 1) / get_row_height()) + 1;
int visible_rows = get_visible_rows();
- int num_rows = MAX(visible_rows, num_lines_from(CLAMP(cursor.line_ofs, 0, text.size() - 1), MIN(visible_rows, text.size() - 1 - cursor.line_ofs)));
- int total_rows = (is_hiding_enabled() ? get_total_unhidden_rows() : text.size());
+ int first_vis_line = get_first_visible_line();
+ int wi;
+ int num_rows = MAX(visible_rows, num_lines_from_rows(first_vis_line, cursor.wrap_ofs, visible_rows, wi));
+
+ int total_rows = get_total_visible_rows();
if (scroll_past_end_of_file_enabled) {
total_rows += visible_rows - 1;
}
@@ -350,28 +386,24 @@ void TextEdit::_update_scrollbars() {
if (use_vscroll) {
v_scroll->show();
- v_scroll->set_max(total_rows);
- v_scroll->set_page(visible_rows);
+ v_scroll->set_max(total_rows + get_visible_rows_offset());
+ v_scroll->set_page(visible_rows + get_visible_rows_offset());
if (smooth_scroll_enabled) {
v_scroll->set_step(0.25);
} else {
v_scroll->set_step(1);
}
-
- update_line_scroll_pos();
- if (fabs(v_scroll->get_value() - get_line_scroll_pos()) >= 1) {
- cursor.line_ofs += v_scroll->get_value() - get_line_scroll_pos();
- }
+ set_v_scroll(get_v_scroll());
} else {
cursor.line_ofs = 0;
- line_scroll_pos = 0;
+ cursor.wrap_ofs = 0;
v_scroll->set_value(0);
v_scroll->hide();
}
- if (use_hscroll) {
+ if (use_hscroll && !is_wrap_enabled()) {
h_scroll->show();
h_scroll->set_max(total_width);
@@ -422,8 +454,8 @@ void TextEdit::_update_selection_mode_pointer() {
select(selection.selecting_line, selection.selecting_column, row, col);
- cursor_set_line(row);
- cursor_set_column(col);
+ cursor_set_line(row, false);
+ cursor_set_column(col, false);
update();
click_select_held->start();
@@ -476,7 +508,7 @@ void TextEdit::_update_selection_mode_word() {
cursor_set_column(selection.to_column);
}
}
- cursor_set_line(row);
+ cursor_set_line(row, false);
update();
click_select_held->start();
@@ -491,15 +523,15 @@ void TextEdit::_update_selection_mode_line() {
col = 0;
if (row < selection.selecting_line) {
// cursor is above us
- cursor_set_line(row - 1);
+ cursor_set_line(row - 1, false);
selection.selecting_column = text[selection.selecting_line].length();
} else {
// cursor is below us
- cursor_set_line(row + 1);
+ cursor_set_line(row + 1, false);
selection.selecting_column = 0;
col = text[row].length();
}
- cursor_set_column(0);
+ cursor_set_column(0, false);
select(selection.selecting_line, selection.selecting_column, row, col);
update();
@@ -517,13 +549,13 @@ void TextEdit::_notification(int p_what) {
MessageQueue::get_singleton()->push_call(this, "_cursor_changed_emit");
if (text_changed_dirty)
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
-
+ update_wrap_at();
} break;
case NOTIFICATION_RESIZED: {
cache.size = get_size();
- adjust_viewport_to_cursor();
-
+ _update_scrollbars();
+ update_wrap_at();
} break;
case NOTIFICATION_THEME_CHANGED: {
@@ -540,17 +572,17 @@ void TextEdit::_notification(int p_what) {
update();
} break;
case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
- if (scrolling && v_scroll->get_value() != target_v_scroll) {
- double target_y = target_v_scroll - v_scroll->get_value();
+ if (scrolling && get_v_scroll() != target_v_scroll) {
+ double target_y = target_v_scroll - get_v_scroll();
double dist = sqrt(target_y * target_y);
double vel = ((target_y / dist) * v_scroll_speed) * get_physics_process_delta_time();
if (Math::abs(vel) >= dist) {
- v_scroll->set_value(target_v_scroll);
+ set_v_scroll(target_v_scroll);
scrolling = false;
set_physics_process_internal(false);
} else {
- v_scroll->set_value(v_scroll->get_value() + vel);
+ set_v_scroll(get_v_scroll() + vel);
}
} else {
scrolling = false;
@@ -777,11 +809,14 @@ void TextEdit::_notification(int p_what) {
String highlighted_text = get_selection_text();
String line_num_padding = line_numbers_zero_padded ? "0" : " ";
- update_line_scroll_pos();
- int line = cursor.line_ofs - 1;
- // another row may be visible during smooth scrolling
+ int cursor_wrap_index = get_cursor_wrap_index();
+
+ FontDrawer drawer(cache.font, Color(1, 1, 1));
+
+ int line = get_first_visible_line() - 1;
int draw_amount = visible_rows + (smooth_scroll_enabled ? 1 : 0);
+ draw_amount += times_line_wraps(line + 1);
for (int i = 0; i < draw_amount; i++) {
line++;
@@ -799,269 +834,360 @@ void TextEdit::_notification(int p_what) {
if (line < 0 || line >= (int)text.size())
continue;
- const String &str = text[line];
+ const String &fullstr = text[line];
- int char_margin = xmargin_beg - cursor.x_ofs;
- int char_ofs = 0;
-
- int ofs_readonly = 0;
- int ofs_x = 0;
+ Map<int, HighlighterInfo> color_map;
+ if (syntax_coloring) {
+ color_map = _get_line_syntax_highlighting(line);
+ }
+ // ensure we at least use the font color
+ Color current_color = cache.font_color;
if (readonly) {
- ofs_readonly = cache.style_readonly->get_offset().y / 2;
- ofs_x = cache.style_readonly->get_offset().x / 2;
+ current_color.a *= readonly_alpha;
}
- int ofs_y = (i * get_row_height() + cache.line_spacing / 2) + ofs_readonly;
- if (smooth_scroll_enabled)
- ofs_y -= ((v_scroll->get_value() - get_line_scroll_pos()) * get_row_height());
bool underlined = false;
- // check if line contains highlighted word
- int highlighted_text_col = -1;
- int search_text_col = -1;
- int highlighted_word_col = -1;
+ int line_wrap_amount = times_line_wraps(line);
+ int last_wrap_column = 0;
+ Vector<String> wrap_rows = get_wrap_rows_text(line);
+
+ for (int line_wrap_index = 0; line_wrap_index < line_wrap_amount + 1; line_wrap_index++) {
+ if (line_wrap_index != 0) {
+ i++;
+ if (i >= draw_amount)
+ break;
+ }
+
+ const String &str = wrap_rows[line_wrap_index];
+ int indent_px = line_wrap_index != 0 ? get_indent_level(line) * cache.font->get_char_size(' ').width : 0;
- if (!search_text.empty())
- search_text_col = _get_column_pos_of_word(search_text, str, search_flags, 0);
+ if (line_wrap_index > 0)
+ last_wrap_column += wrap_rows[line_wrap_index - 1].length();
- if (highlighted_text.length() != 0 && highlighted_text != search_text)
- highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, 0);
+ int char_margin = xmargin_beg - cursor.x_ofs;
+ char_margin += indent_px;
+ int char_ofs = 0;
- if (select_identifiers_enabled && highlighted_word.length() != 0) {
- if (_is_char(highlighted_word[0])) {
- highlighted_word_col = _get_column_pos_of_word(highlighted_word, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, 0);
+ int ofs_readonly = 0;
+ int ofs_x = 0;
+ if (readonly) {
+ ofs_readonly = cache.style_readonly->get_offset().y / 2;
+ ofs_x = cache.style_readonly->get_offset().x / 2;
}
- }
- if (text.is_marked(line)) {
+ int ofs_y = (i * get_row_height() + cache.line_spacing / 2) + ofs_readonly;
+ ofs_y -= cursor.wrap_ofs * get_row_height();
+ if (smooth_scroll_enabled)
+ ofs_y += (-get_v_scroll_offset()) * get_row_height();
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color);
- }
+ // check if line contains highlighted word
+ int highlighted_text_col = -1;
+ int search_text_col = -1;
+ int highlighted_word_col = -1;
- if (str.length() == 0) {
- // draw line background if empty as we won't loop at at all
- if (line == cursor.line && highlight_current_line) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs_x, ofs_y, xmargin_end, get_row_height()), cache.current_line_color);
+ if (!search_text.empty())
+ search_text_col = _get_column_pos_of_word(search_text, str, search_flags, 0);
+
+ if (highlighted_text.length() != 0 && highlighted_text != search_text)
+ highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, 0);
+
+ if (select_identifiers_enabled && highlighted_word.length() != 0) {
+ if (_is_char(highlighted_word[0])) {
+ highlighted_word_col = _get_column_pos_of_word(highlighted_word, fullstr, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, 0);
+ }
}
- // give visual indication of empty selected line
- if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) {
- int char_w = cache.font->get_char_size(' ').width;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
+ if (text.is_marked(line)) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.mark_color);
}
- } else {
- // if it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later.
- if (line == cursor.line && highlight_current_line) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg + ofs_x, get_row_height()), cache.current_line_color);
+
+ if (str.length() == 0) {
+ // draw line background if empty as we won't loop at at all
+ if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs_x, ofs_y, xmargin_end, get_row_height()), cache.current_line_color);
+ }
+
+ // give visual indication of empty selected line
+ if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) {
+ int char_w = cache.font->get_char_size(' ').width;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
+ }
+ } else {
+ // if it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later.
+ if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg, get_row_height()), cache.current_line_color);
+ }
}
- }
- if (text.is_breakpoint(line) && !draw_breakpoint_gutter) {
+ if (line_wrap_index == 0) {
+ // only do these if we are on the first wrapped part of a line
+
+ if (text.is_breakpoint(line) && !draw_breakpoint_gutter) {
#ifdef TOOLS_ENABLED
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.breakpoint_color);
#else
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.breakpoint_color);
#endif
- }
+ }
- // draw breakpoint marker
- if (text.is_breakpoint(line)) {
- if (draw_breakpoint_gutter) {
- int vertical_gap = (get_row_height() * 40) / 100;
- int horizontal_gap = (cache.breakpoint_gutter_width * 30) / 100;
- int marker_height = get_row_height() - (vertical_gap * 2);
- int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2);
- // no transparency on marker
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap, marker_width, marker_height), Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b));
- }
- }
+ // draw breakpoint marker
+ if (text.is_breakpoint(line)) {
+ if (draw_breakpoint_gutter) {
+ int vertical_gap = (get_row_height() * 40) / 100;
+ int horizontal_gap = (cache.breakpoint_gutter_width * 30) / 100;
+ int marker_height = get_row_height() - (vertical_gap * 2);
+ int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2);
+ // no transparency on marker
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2, ofs_y + vertical_gap, marker_width, marker_height), Color(cache.breakpoint_color.r, cache.breakpoint_color.g, cache.breakpoint_color.b));
+ }
+ }
- // draw fold markers
- if (draw_fold_gutter) {
- int horizontal_gap = (cache.fold_gutter_width * 30) / 100;
- int gutter_left = cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + cache.line_number_w;
- if (is_folded(line)) {
- int xofs = horizontal_gap - (cache.can_fold_icon->get_width()) / 2;
- int yofs = (get_row_height() - cache.folded_icon->get_height()) / 2;
- cache.folded_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
- } else if (can_fold(line)) {
- int xofs = -cache.can_fold_icon->get_width() / 2 - horizontal_gap + 3;
- int yofs = (get_row_height() - cache.can_fold_icon->get_height()) / 2;
- cache.can_fold_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
- }
- }
+ // draw fold markers
+ if (draw_fold_gutter) {
+ int horizontal_gap = (cache.fold_gutter_width * 30) / 100;
+ int gutter_left = cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + cache.line_number_w;
+ if (is_folded(line)) {
+ int xofs = horizontal_gap - (cache.can_fold_icon->get_width()) / 2;
+ int yofs = (get_row_height() - cache.folded_icon->get_height()) / 2;
+ cache.folded_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
+ } else if (can_fold(line)) {
+ int xofs = -cache.can_fold_icon->get_width() / 2 - horizontal_gap + 3;
+ int yofs = (get_row_height() - cache.can_fold_icon->get_height()) / 2;
+ cache.can_fold_icon->draw(ci, Point2(gutter_left + xofs + ofs_x, ofs_y + yofs), cache.code_folding_color);
+ }
+ }
+
+ // draw line numbers
+ if (cache.line_number_w) {
+ String fc = String::num(line + 1);
+ while (fc.length() < line_number_char_count) {
+ fc = line_num_padding + fc;
+ }
- if (cache.line_number_w) {
- String fc = String::num(line + 1);
- while (fc.length() < line_number_char_count) {
- fc = line_num_padding + fc;
+ cache.font->draw(ci, Point2(cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + ofs_x, ofs_y + cache.font->get_ascent()), fc, cache.line_number_color);
+ }
}
- cache.font->draw(ci, Point2(cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + ofs_x, ofs_y + cache.font->get_ascent()), fc, cache.line_number_color);
- }
+ //loop through characters in one line
+ for (int j = 0; j < str.length(); j++) {
- //loop through characters in one line
- Map<int, HighlighterInfo> color_map;
- if (syntax_coloring) {
- color_map = _get_line_syntax_highlighting(line);
- }
+ if (syntax_coloring) {
+ if (color_map.has(last_wrap_column + j)) {
+ current_color = color_map[last_wrap_column + j].color;
+ if (readonly) {
+ current_color.a *= readonly_alpha;
+ }
+ }
+ color = current_color;
+ }
- // ensure we at least use the font color
- Color current_color = cache.font_color;
- if (readonly) {
- current_color.a *= readonly_alpha;
- }
- for (int j = 0; j < str.length(); j++) {
+ int char_w;
+
+ //handle tabulator
+ char_w = text.get_char_width(str[j], str[j + 1], char_ofs);
+
+ if ((char_ofs + char_margin) < xmargin_beg) {
+ char_ofs += char_w;
- if (syntax_coloring) {
- if (color_map.has(j)) {
- current_color = color_map[j].color;
- if (readonly) {
- current_color.a *= readonly_alpha;
+ // line highlighting handle horizontal clipping
+ if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
+
+ if (j == str.length() - 1) {
+ // end of line when last char is skipped
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ } else if ((char_ofs + char_margin) > xmargin_beg) {
+ // char next to margin is skipped
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color);
+ }
}
+ continue;
}
- color = current_color;
- }
- int char_w;
- //handle tabulator
+ if ((char_ofs + char_margin + char_w) >= xmargin_end) {
+ if (syntax_coloring)
+ continue;
+ else
+ break;
+ }
- if (str[j] == '\t') {
- int left = char_ofs % tab_w;
- if (left == 0)
- char_w = tab_w;
- else
- char_w = tab_w - char_ofs % tab_w; // is right...
+ bool in_search_result = false;
- } else {
- char_w = cache.font->get_char_size(str[j], str[j + 1]).width;
- }
+ if (search_text_col != -1) {
+ // if we are at the end check for new search result on same line
+ if (j >= search_text_col + search_text.length())
+ search_text_col = _get_column_pos_of_word(search_text, str, search_flags, j);
- if ((char_ofs + char_margin) < xmargin_beg) {
- char_ofs += char_w;
+ in_search_result = j >= search_text_col && j < search_text_col + search_text.length();
- // line highlighting handle horizontal clipping
- if (line == cursor.line && highlight_current_line) {
+ if (in_search_result) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin, ofs_y), Size2i(char_w, get_row_height())), cache.search_result_color);
+ }
+ }
- if (j == str.length() - 1) {
- // end of line when last char is skipped
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - (xmargin_beg + ofs_x), get_row_height()), cache.current_line_color);
+ //current line highlighting
+ bool in_selection = (selection.active && line >= selection.from_line && line <= selection.to_line && (line > selection.from_line || last_wrap_column + j >= selection.from_column) && (line < selection.to_line || last_wrap_column + j < selection.to_column));
- } else if ((char_ofs + char_margin) > xmargin_beg) {
- // char next to margin is skipped
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, (char_ofs + char_margin) - xmargin_beg, get_row_height()), cache.current_line_color);
+ if (line == cursor.line && cursor_wrap_index == line_wrap_index && highlight_current_line) {
+ // draw the wrap indent offset highlight
+ if (line_wrap_index != 0 && j == 0) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin - indent_px, ofs_y, (char_ofs + char_margin), get_row_height()), cache.current_line_color);
+ }
+ // if its the last char draw to end of the line
+ if (j == str.length() - 1) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ }
+ // actual text
+ if (!in_selection) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.current_line_color);
}
}
- continue;
- }
- if ((char_ofs + char_margin + char_w) >= xmargin_end) {
- if (syntax_coloring)
- continue;
- else
- break;
- }
-
- bool in_search_result = false;
+ if (in_selection) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.selection_color);
+ }
- if (search_text_col != -1) {
- // if we are at the end check for new search result on same line
- if (j >= search_text_col + search_text.length())
- search_text_col = _get_column_pos_of_word(search_text, str, search_flags, j);
+ if (in_search_result) {
+ Color border_color = (line == search_result_line && j >= search_result_col && j < search_result_col + search_text.length()) ? cache.font_color : cache.search_result_border_color;
- in_search_result = j >= search_text_col && j < search_text_col + search_text.length();
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, 1)), border_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y + get_row_height() - 1), Size2i(char_w, 1)), border_color);
- if (in_search_result) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin, ofs_y), Size2i(char_w, get_row_height())), cache.search_result_color);
+ if (j == search_text_col)
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(1, get_row_height())), border_color);
+ if (j == search_text_col + search_text.length() - 1)
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
}
- }
- //current line highlighting
- bool in_selection = (selection.active && line >= selection.from_line && line <= selection.to_line && (line > selection.from_line || j >= selection.from_column) && (line < selection.to_line || j < selection.to_column));
+ if (highlight_all_occurrences) {
+ if (highlighted_text_col != -1) {
+
+ // if we are at the end check for new word on same line
+ if (j > highlighted_text_col + highlighted_text.length()) {
+ highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, j);
+ }
+
+ bool in_highlighted_word = (j >= highlighted_text_col && j < highlighted_text_col + highlighted_text.length());
- if (line == cursor.line && highlight_current_line) {
- // if its the last char draw to end of the line
- if (j == str.length() - 1) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(char_ofs + char_margin + char_w, ofs_y, xmargin_end - (char_ofs + char_margin + char_w), get_row_height()), cache.current_line_color);
+ // if this is the original highlighted text we don't want to highlight it again
+ if (cursor.line == line && cursor_wrap_index == line_wrap_index && (cursor.column >= highlighted_text_col && cursor.column <= highlighted_text_col + highlighted_text.length())) {
+ in_highlighted_word = false;
+ }
+
+ if (in_highlighted_word) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.word_highlighted_color);
+ }
+ }
}
- // actual text
- if (!in_selection) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.current_line_color);
+
+ if (highlighted_word_col != -1) {
+ if (j + last_wrap_column > highlighted_word_col + highlighted_word.length()) {
+ highlighted_word_col = _get_column_pos_of_word(highlighted_word, fullstr, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, j + last_wrap_column);
+ }
+ underlined = (j + last_wrap_column >= highlighted_word_col && j + last_wrap_column < highlighted_word_col + highlighted_word.length());
}
- }
- if (in_selection) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.selection_color);
- }
+ if (brace_matching_enabled) {
+ if ((brace_open_match_line == line && brace_open_match_column == last_wrap_column + j) ||
+ (cursor.column == last_wrap_column + j && cursor.line == line && cursor_wrap_index == line_wrap_index && (brace_open_matching || brace_open_mismatch))) {
- if (in_search_result) {
- Color border_color = (line == search_result_line && j >= search_result_col && j < search_result_col + search_text.length()) ? cache.font_color : cache.search_result_border_color;
+ if (brace_open_mismatch)
+ color = cache.brace_mismatch_color;
+ drawer.draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), '_', str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ }
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, 1)), border_color);
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y + get_row_height() - 1), Size2i(char_w, 1)), border_color);
+ if ((brace_close_match_line == line && brace_close_match_column == last_wrap_column + j) ||
+ (cursor.column == last_wrap_column + j + 1 && cursor.line == line && cursor_wrap_index == line_wrap_index && (brace_close_matching || brace_close_mismatch))) {
- if (j == search_text_col)
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(1, get_row_height())), border_color);
- if (j == search_text_col + search_text.length() - 1)
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + char_w + ofs_x - 1, ofs_y), Size2i(1, get_row_height())), border_color);
- }
+ if (brace_close_mismatch)
+ color = cache.brace_mismatch_color;
+ drawer.draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), '_', str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ }
+ }
+
+ if (cursor.column == last_wrap_column + j && cursor.line == line && cursor_wrap_index == line_wrap_index) {
- if (highlight_all_occurrences) {
- if (highlighted_text_col != -1) {
+ cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
- // if we are at the end check for new word on same line
- if (j > highlighted_text_col + highlighted_text.length()) {
- highlighted_text_col = _get_column_pos_of_word(highlighted_text, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, j);
+ if (insert_mode) {
+ cursor_pos.y += (get_row_height() - 3);
}
- bool in_highlighted_word = (j >= highlighted_text_col && j < highlighted_text_col + highlighted_text.length());
+ int caret_w = (str[j] == '\t') ? cache.font->get_char_size(' ').width : char_w;
+ if (ime_text.length() > 0) {
+ int ofs = 0;
+ while (true) {
+ if (ofs >= ime_text.length())
+ break;
+
+ CharType cchar = ime_text[ofs];
+ CharType next = ime_text[ofs + 1];
+ int im_char_width = cache.font->get_char_size(cchar, next).width;
- /* if this is the original highlighted text we don't want to highlight it again */
- if (cursor.line == line && (cursor.column >= highlighted_text_col && cursor.column <= highlighted_text_col + highlighted_text.length())) {
- in_highlighted_word = false;
- }
+ if ((char_ofs + char_margin + im_char_width) >= xmargin_end)
+ break;
+
+ bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
+ if (selected) {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
+ } else {
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
+ }
+
+ drawer.draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
- if (in_highlighted_word) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(char_ofs + char_margin + ofs_x, ofs_y), Size2i(char_w, get_row_height())), cache.word_highlighted_color);
+ char_ofs += im_char_width;
+ ofs++;
+ }
+ }
+ if (ime_text.length() == 0) {
+ if (draw_caret) {
+ if (insert_mode) {
+ int caret_h = (block_caret) ? 4 : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
+ } else {
+ caret_w = (block_caret) ? caret_w : 1;
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
+ }
+ }
}
}
- }
- if (highlighted_word_col != -1) {
- if (j > highlighted_word_col + highlighted_word.length()) {
- highlighted_word_col = _get_column_pos_of_word(highlighted_word, str, SEARCH_MATCH_CASE | SEARCH_WHOLE_WORDS, j);
+ if (cursor.column == last_wrap_column + j && cursor.line == line && cursor_wrap_index == line_wrap_index && block_caret && draw_caret && !insert_mode) {
+ color = cache.caret_background_color;
+ } else if (!syntax_coloring && block_caret) {
+ color = cache.font_color;
+ color.a *= readonly_alpha;
}
- underlined = (j >= highlighted_word_col && j < highlighted_word_col + highlighted_word.length());
- }
- if (brace_matching_enabled) {
- if ((brace_open_match_line == line && brace_open_match_column == j) ||
- (cursor.column == j && cursor.line == line && (brace_open_matching || brace_open_mismatch))) {
-
- if (brace_open_mismatch)
- color = cache.brace_mismatch_color;
- cache.font->draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), '_', str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ if (str[j] >= 32) {
+ int w = drawer.draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), str[j], str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ if (underlined) {
+ draw_rect(Rect2(char_ofs + char_margin + ofs_x, ofs_y + ascent + 2, w, 1), in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ }
+ } else if (draw_tabs && str[j] == '\t') {
+ int yofs = (get_row_height() - cache.tab_icon->get_height()) / 2;
+ cache.tab_icon->draw(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + yofs), in_selection && override_selected_font_color ? cache.font_selected_color : color);
}
- if (
- (brace_close_match_line == line && brace_close_match_column == j) ||
- (cursor.column == j + 1 && cursor.line == line && (brace_close_matching || brace_close_mismatch))) {
+ char_ofs += char_w;
- if (brace_close_mismatch)
- color = cache.brace_mismatch_color;
- cache.font->draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), '_', str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
+ if (line_wrap_index == line_wrap_amount && j == str.length() - 1 && is_folded(line)) {
+ int yofs = (get_row_height() - cache.folded_eol_icon->get_height()) / 2;
+ int xofs = cache.folded_eol_icon->get_width() / 2;
+ Color eol_color = cache.code_folding_color;
+ eol_color.a = 1;
+ cache.folded_eol_icon->draw(ci, Point2(char_ofs + char_margin + xofs + ofs_x, ofs_y + yofs), eol_color);
}
}
- if (cursor.column == j && cursor.line == line) {
+ if (cursor.column == last_wrap_column + str.length() && cursor.line == line && cursor_wrap_index == line_wrap_index && (char_ofs + char_margin) >= xmargin_beg) {
cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
if (insert_mode) {
cursor_pos.y += (get_row_height() - 3);
}
-
- int caret_w = (str[j] == '\t') ? cache.font->get_char_size(' ').width : char_w;
if (ime_text.length() > 0) {
int ofs = 0;
while (true) {
@@ -1082,7 +1208,7 @@ void TextEdit::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
}
- cache.font->draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
+ drawer.draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
char_ofs += im_char_width;
ofs++;
@@ -1091,92 +1217,17 @@ void TextEdit::_notification(int p_what) {
if (ime_text.length() == 0) {
if (draw_caret) {
if (insert_mode) {
+ int char_w = cache.font->get_char_size(' ').width;
int caret_h = (block_caret) ? 4 : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, caret_h)), cache.caret_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
} else {
- caret_w = (block_caret) ? caret_w : 1;
+ int char_w = cache.font->get_char_size(' ').width;
+ int caret_w = (block_caret) ? char_w : 1;
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
}
}
}
}
-
- if (cursor.column == j && cursor.line == line && block_caret && draw_caret && !insert_mode) {
- color = cache.caret_background_color;
- } else if (!syntax_coloring && block_caret) {
- color = cache.font_color;
- color.a *= readonly_alpha;
- }
-
- if (str[j] >= 32) {
- int w = cache.font->draw_char(ci, Point2i(char_ofs + char_margin + ofs_x, ofs_y + ascent), str[j], str[j + 1], in_selection && override_selected_font_color ? cache.font_selected_color : color);
- if (underlined) {
- draw_rect(Rect2(char_ofs + char_margin + ofs_x, ofs_y + ascent + 2, w, 1), in_selection && override_selected_font_color ? cache.font_selected_color : color);
- }
- }
-
- else if (draw_tabs && str[j] == '\t') {
- int yofs = (get_row_height() - cache.tab_icon->get_height()) / 2;
- cache.tab_icon->draw(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + yofs), in_selection && override_selected_font_color ? cache.font_selected_color : color);
- }
-
- char_ofs += char_w;
-
- if (j == str.length() - 1 && is_folded(line)) {
- int yofs = (get_row_height() - cache.folded_eol_icon->get_height()) / 2;
- int xofs = cache.folded_eol_icon->get_width() / 2;
- Color eol_color = cache.code_folding_color;
- eol_color.a = 1;
- cache.folded_eol_icon->draw(ci, Point2(char_ofs + char_margin + xofs + ofs_x, ofs_y + yofs), eol_color);
- }
- }
-
- if (cursor.column == str.length() && cursor.line == line && (char_ofs + char_margin) >= xmargin_beg) {
-
- cursor_pos = Point2i(char_ofs + char_margin + ofs_x, ofs_y);
-
- if (insert_mode) {
- cursor_pos.y += (get_row_height() - 3);
- }
- if (ime_text.length() > 0) {
- int ofs = 0;
- while (true) {
- if (ofs >= ime_text.length())
- break;
-
- CharType cchar = ime_text[ofs];
- CharType next = ime_text[ofs + 1];
- int im_char_width = cache.font->get_char_size(cchar, next).width;
-
- if ((char_ofs + char_margin + im_char_width) >= xmargin_end)
- break;
-
- bool selected = ofs >= ime_selection.x && ofs < ime_selection.x + ime_selection.y;
- if (selected) {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 3)), color);
- } else {
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(char_ofs + char_margin, ofs_y + get_row_height()), Size2(im_char_width, 1)), color);
- }
-
- cache.font->draw_char(ci, Point2(char_ofs + char_margin + ofs_x, ofs_y + ascent), cchar, next, color);
-
- char_ofs += im_char_width;
- ofs++;
- }
- }
- if (ime_text.length() == 0) {
- if (draw_caret) {
- if (insert_mode) {
- int char_w = cache.font->get_char_size(' ').width;
- int caret_h = (block_caret) ? 4 : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(char_w, caret_h)), cache.caret_color);
- } else {
- int char_w = cache.font->get_char_size(' ').width;
- int caret_w = (block_caret) ? char_w : 1;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(cursor_pos, Size2i(caret_w, get_row_height())), cache.caret_color);
- }
- }
- }
}
}
@@ -1603,16 +1654,17 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co
float rows = p_mouse.y;
rows -= cache.style_normal->get_margin(MARGIN_TOP);
- rows += (CLAMP(v_scroll->get_value() - get_line_scroll_pos(true), 0, 1) * get_row_height());
rows /= get_row_height();
- int first_vis_line = CLAMP(cursor.line_ofs, 0, text.size() - 1);
+ rows += get_v_scroll_offset();
+ int first_vis_line = get_first_visible_line();
int row = first_vis_line + Math::floor(rows);
+ int wrap_index = 0;
- if (is_hiding_enabled()) {
- // row will be offset by the hidden rows
- int f_ofs = num_lines_from(first_vis_line, rows + 1) - 1;
+ if (is_wrap_enabled() || is_hiding_enabled()) {
+
+ int f_ofs = num_lines_from_rows(first_vis_line, cursor.wrap_ofs, rows + 1, wrap_index) - 1;
row = first_vis_line + f_ofs;
- row = CLAMP(row, 0, text.size() - num_lines_from(text.size() - 1, -1));
+ row = CLAMP(row, 0, get_last_visible_line() + 1);
}
if (row < 0)
@@ -1626,9 +1678,19 @@ void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) co
col = text[row].size();
} else {
- col = p_mouse.x - (cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.fold_gutter_width);
- col += cursor.x_ofs;
- col = get_char_pos_for(col, get_line(row));
+ int colx = p_mouse.x - (cache.style_normal->get_margin(MARGIN_LEFT) + cache.line_number_w + cache.breakpoint_gutter_width + cache.fold_gutter_width);
+ colx += cursor.x_ofs;
+ col = get_char_pos_for_line(colx, row, wrap_index);
+ if (is_wrap_enabled() && wrap_index < times_line_wraps(row)) {
+ // move back one if we are at the end of the row
+ Vector<String> rows = get_wrap_rows_text(row);
+ int row_end_col = 0;
+ for (int i = 0; i < wrap_index + 1; i++) {
+ row_end_col += rows[i].length();
+ }
+ if (col >= row_end_col)
+ col -= 1;
+ }
}
r_row = row;
@@ -1703,7 +1765,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_reset_caret_blink_timer();
int row, col;
- update_line_scroll_pos();
_get_mouse_pos(Point2i(mb->get_position().x, mb->get_position().y), row, col);
if (mb->get_command() && highlighted_word != String()) {
@@ -1835,7 +1896,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_reset_caret_blink_timer();
int row, col;
- update_line_scroll_pos();
_get_mouse_pos(Point2i(mb->get_position().x, mb->get_position().y), row, col);
if (is_right_click_moving_caret()) {
@@ -2410,6 +2470,12 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
cursor_set_line(line);
cursor_set_column(column);
+#ifdef APPLE_STYLE_KEYS
+ } else if (k->get_command()) {
+ int cursor_current_column = cursor.column;
+ cursor.column = 0;
+ _remove_text(cursor.line, 0, cursor.line, cursor_current_column);
+#endif
} else {
if (cursor.line > 0 && is_line_hidden(cursor.line - 1))
unfold_line(cursor.line - 1);
@@ -2446,13 +2512,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
} else if (k->get_command()) {
#endif
- bool prev_char = false;
int cc = cursor.column;
if (cc == 0 && cursor.line > 0) {
cursor_set_line(cursor.line - 1);
cursor_set_column(text[cursor.line].length());
} else {
+ bool prev_char = false;
+
while (cc > 0) {
bool ischar = _is_text_char(text[cursor.line][cc - 1]);
@@ -2507,13 +2574,14 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
} else if (k->get_command()) {
#endif
- bool prev_char = false;
int cc = cursor.column;
if (cc == text[cursor.line].length() && cursor.line < text.size() - 1) {
cursor_set_line(cursor.line + 1);
cursor_set_column(0);
} else {
+ bool prev_char = false;
+
while (cc < text[cursor.line].length()) {
bool ischar = _is_text_char(text[cursor.line][cc]);
@@ -2565,11 +2633,25 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
}
- if (k->get_command())
+ if (k->get_command()) {
cursor_set_line(0);
- else
+ } else
#endif
- cursor_set_line(cursor_get_line() - num_lines_from(CLAMP(cursor.line - 1, 0, text.size() - 1), -1));
+ {
+ int cur_wrap_index = get_cursor_wrap_index();
+ if (cur_wrap_index > 0) {
+ cursor_set_line(cursor.line, true, false, cur_wrap_index - 1);
+ } else if (cursor.line == 0) {
+ cursor_set_column(0);
+ } else {
+ int new_line = cursor.line - num_lines_from(cursor.line - 1, -1);
+ if (line_wraps(new_line)) {
+ cursor_set_line(new_line, true, false, times_line_wraps(new_line));
+ } else {
+ cursor_set_line(new_line, true, false);
+ }
+ }
+ }
if (k->get_shift())
_post_shift_selection();
@@ -2597,22 +2679,25 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
break;
}
- {
#else
if (k->get_command() && k->get_alt()) {
_scroll_lines_down();
break;
}
- if (k->get_command())
- cursor_set_line(text.size() - 1, true, false);
- else {
+ if (k->get_command()) {
+ cursor_set_line(get_last_unhidden_line(), true, false, 9999);
+ } else
#endif
- if (!is_last_visible_line(cursor.line)) {
- cursor_set_line(cursor_get_line() + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1), true, false);
+ {
+ int cur_wrap_index = get_cursor_wrap_index();
+ if (cur_wrap_index < times_line_wraps(cursor.line)) {
+ cursor_set_line(cursor.line, true, false, cur_wrap_index + 1);
+ } else if (cursor.line == get_last_unhidden_line()) {
+ cursor_set_column(text[cursor.line].length());
} else {
- cursor_set_line(text.size() - 1);
- cursor_set_column(get_line(cursor.line).length(), true);
+ int new_line = cursor.line + num_lines_from(CLAMP(cursor.line + 1, 0, text.size() - 1), 1);
+ cursor_set_line(new_line, true, false, 0);
}
}
@@ -2621,7 +2706,6 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_cancel_code_hint();
} break;
-
case KEY_DELETE: {
if (readonly)
@@ -2684,7 +2768,11 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
next_line = line;
next_column = column;
-
+#ifdef APPLE_STYLE_KEYS
+ } else if (k->get_command()) {
+ next_column = curline_len;
+ next_line = cursor.line;
+#endif
} else {
next_column = cursor.column < curline_len ? (cursor.column + 1) : 0;
}
@@ -2724,19 +2812,31 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
cursor_set_line(0);
cursor_set_column(0);
} else {
- // compute whitespace symbols seq length
- int current_line_whitespace_len = 0;
- while (current_line_whitespace_len < text[cursor.line].length()) {
- CharType c = text[cursor.line][current_line_whitespace_len];
- if (c != '\t' && c != ' ')
- break;
- current_line_whitespace_len++;
+
+ // move cursor column to start of wrapped row and then to start of text
+ Vector<String> rows = get_wrap_rows_text(cursor.line);
+ int wi = get_cursor_wrap_index();
+ int row_start_col = 0;
+ for (int i = 0; i < wi; i++) {
+ row_start_col += rows[i].length();
}
+ if (cursor.column == row_start_col || wi == 0) {
+ // compute whitespace symbols seq length
+ int current_line_whitespace_len = 0;
+ while (current_line_whitespace_len < text[cursor.line].length()) {
+ CharType c = text[cursor.line][current_line_whitespace_len];
+ if (c != '\t' && c != ' ')
+ break;
+ current_line_whitespace_len++;
+ }
- if (cursor_get_column() == current_line_whitespace_len)
- cursor_set_column(0);
- else
- cursor_set_column(current_line_whitespace_len);
+ if (cursor_get_column() == current_line_whitespace_len)
+ cursor_set_column(0);
+ else
+ cursor_set_column(current_line_whitespace_len);
+ } else {
+ cursor_set_column(row_start_col);
+ }
}
if (k->get_shift())
@@ -2761,7 +2861,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (k->get_shift())
_pre_shift_selection();
- cursor_set_line(text.size() - 1, true, false);
+ cursor_set_line(get_last_unhidden_line(), true, false, 9999);
if (k->get_shift())
_post_shift_selection();
@@ -2776,8 +2876,20 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_pre_shift_selection();
if (k->get_command())
- cursor_set_line(text.size() - 1, true, false);
- cursor_set_column(text[cursor.line].length());
+ cursor_set_line(get_last_unhidden_line(), true, false, 9999);
+
+ // move cursor column to end of wrapped row and then to end of text
+ Vector<String> rows = get_wrap_rows_text(cursor.line);
+ int wi = get_cursor_wrap_index();
+ int row_end_col = -1;
+ for (int i = 0; i < wi + 1; i++) {
+ row_end_col += rows[i].length();
+ }
+ if (wi == rows.size() - 1 || cursor.column == row_end_col) {
+ cursor_set_column(text[cursor.line].length());
+ } else {
+ cursor_set_column(row_end_col);
+ }
if (k->get_shift())
_post_shift_selection();
@@ -2801,7 +2913,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (k->get_shift())
_pre_shift_selection();
- cursor_set_line(cursor_get_line() - num_lines_from(cursor.line, -get_visible_rows()), true, false);
+ int wi;
+ int n_line = cursor.line - num_lines_from_rows(cursor.line, get_cursor_wrap_index(), -get_visible_rows(), wi) + 1;
+ cursor_set_line(n_line, true, false, wi);
if (k->get_shift())
_post_shift_selection();
@@ -2815,14 +2929,16 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
scancode_handled = false;
break;
}
- // numlock disabled. fallthrough to key_pageup
+ // numlock disabled. fallthrough to key_pagedown
}
case KEY_PAGEDOWN: {
if (k->get_shift())
_pre_shift_selection();
- cursor_set_line(cursor_get_line() + num_lines_from(cursor.line, get_visible_rows()), true, false);
+ int wi;
+ int n_line = cursor.line + num_lines_from_rows(cursor.line, get_cursor_wrap_index(), get_visible_rows(), wi) - 1;
+ cursor_set_line(n_line, true, false, wi);
if (k->get_shift())
_post_shift_selection();
@@ -2833,13 +2949,64 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
} break;
case KEY_A: {
+#ifndef APPLE_STYLE_KEYS
if (!k->get_command() || k->get_shift() || k->get_alt()) {
scancode_handled = false;
break;
}
-
select_all();
+#else
+ if (k->get_alt() || (!k->get_shift() && !k->get_command() && !k->get_control())) {
+ scancode_handled = false;
+ break;
+ }
+ if (!k->get_shift() && k->get_command())
+ select_all();
+ else if (k->get_control()) {
+ if (k->get_shift())
+ _pre_shift_selection();
+
+ int current_line_whitespace_len = 0;
+ while (current_line_whitespace_len < text[cursor.line].length()) {
+ CharType c = text[cursor.line][current_line_whitespace_len];
+ if (c != '\t' && c != ' ')
+ break;
+ current_line_whitespace_len++;
+ }
+
+ if (cursor_get_column() == current_line_whitespace_len)
+ cursor_set_column(0);
+ else
+ cursor_set_column(current_line_whitespace_len);
+
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
+ }
+ } break;
+ case KEY_E: {
+
+ if (!k->get_control() || k->get_command() || k->get_alt()) {
+ scancode_handled = false;
+ break;
+ }
+
+ if (k->get_shift())
+ _pre_shift_selection();
+
+ if (k->get_command())
+ cursor_set_line(text.size() - 1, true, false);
+ cursor_set_column(text[cursor.line].length());
+
+ if (k->get_shift())
+ _post_shift_selection();
+ else if (k->get_command() || k->get_control())
+ deselect();
+ _cancel_completion();
+ completion_hint = "";
+#endif
} break;
case KEY_X: {
if (readonly) {
@@ -3016,7 +3183,7 @@ void TextEdit::_scroll_up(real_t p_delta) {
if (scrolling) {
target_v_scroll = (target_v_scroll - p_delta);
} else {
- target_v_scroll = (v_scroll->get_value() - p_delta);
+ target_v_scroll = (get_v_scroll() - p_delta);
}
if (smooth_scroll_enabled) {
@@ -3030,7 +3197,7 @@ void TextEdit::_scroll_up(real_t p_delta) {
set_physics_process_internal(true);
}
} else {
- v_scroll->set_value(target_v_scroll);
+ set_v_scroll(target_v_scroll);
}
}
@@ -3042,20 +3209,15 @@ void TextEdit::_scroll_down(real_t p_delta) {
if (scrolling) {
target_v_scroll = (target_v_scroll + p_delta);
} else {
- target_v_scroll = (v_scroll->get_value() + p_delta);
+ target_v_scroll = (get_v_scroll() + p_delta);
}
if (smooth_scroll_enabled) {
- int max_v_scroll = get_total_unhidden_rows();
- if (!scroll_past_end_of_file_enabled) {
- max_v_scroll -= get_visible_rows();
- max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows());
- }
-
+ int max_v_scroll = v_scroll->get_max() - v_scroll->get_page();
if (target_v_scroll > max_v_scroll) {
target_v_scroll = max_v_scroll;
+ v_scroll->set_value(target_v_scroll);
}
-
if (Math::abs(target_v_scroll - v_scroll->get_value()) < 1.0) {
v_scroll->set_value(target_v_scroll);
} else {
@@ -3063,7 +3225,7 @@ void TextEdit::_scroll_down(real_t p_delta) {
set_physics_process_internal(true);
}
} else {
- v_scroll->set_value(target_v_scroll);
+ set_v_scroll(target_v_scroll);
}
}
@@ -3094,35 +3256,37 @@ void TextEdit::_scroll_lines_up() {
scrolling = false;
// adjust the vertical scroll
- if (get_v_scroll() >= 0) {
- set_v_scroll(get_v_scroll() - 1);
- }
+ set_v_scroll(get_v_scroll() - 1);
- // adjust the cursor
- int num_lines = num_lines_from(CLAMP(cursor.line_ofs, 0, text.size() - 1), get_visible_rows());
- if (cursor.line >= cursor.line_ofs + num_lines && !selection.active) {
- cursor_set_line(cursor.line_ofs + num_lines, false, false);
+ // adjust the cursor to viewport
+ if (!selection.active) {
+ int cur_line = cursor.line;
+ int cur_wrap = get_cursor_wrap_index();
+ int last_vis_line = get_last_visible_line();
+ int last_vis_wrap = get_last_visible_line_wrap_index();
+
+ if (cur_line > last_vis_line || (cur_line == last_vis_line && cur_wrap > last_vis_wrap)) {
+ cursor_set_line(last_vis_line, false, false, last_vis_wrap);
+ }
}
}
void TextEdit::_scroll_lines_down() {
scrolling = false;
- // calculate the maximum vertical scroll position
- int max_v_scroll = get_total_unhidden_rows();
- if (!scroll_past_end_of_file_enabled) {
- max_v_scroll -= get_visible_rows();
- max_v_scroll = CLAMP(max_v_scroll, 0, get_total_unhidden_rows());
- }
-
// adjust the vertical scroll
- if (get_v_scroll() < max_v_scroll) {
- set_v_scroll(get_v_scroll() + 1);
- }
+ set_v_scroll(get_v_scroll() + 1);
+
+ // adjust the cursor to viewport
+ if (!selection.active) {
+ int cur_line = cursor.line;
+ int cur_wrap = get_cursor_wrap_index();
+ int first_vis_line = get_first_visible_line();
+ int first_vis_wrap = cursor.wrap_ofs;
- // adjust the cursor
- if (cursor.line <= cursor.line_ofs - 1 && !selection.active) {
- cursor_set_line(cursor.line_ofs, false, false);
+ if (cur_line < first_vis_line || (cur_line == first_vis_line && cur_wrap < first_vis_wrap)) {
+ cursor_set_line(first_vis_line, false, false, first_vis_wrap);
+ }
}
}
@@ -3176,6 +3340,8 @@ void TextEdit::_base_insert_text(int p_line, int p_char, const String &p_text, i
text.set_hidden(p_line, false);
}
+ text.set_line_wrap_amount(p_line, -1);
+
r_end_line = p_line + substrings.size() - 1;
r_end_column = text[r_end_line].length() - postinsert_text.length();
@@ -3230,6 +3396,8 @@ void TextEdit::_base_remove_text(int p_from_line, int p_from_column, int p_to_li
text.set(p_from_line, pre_text + post_text);
+ text.set_line_wrap_amount(p_from_line, -1);
+
if (!text_changed_dirty && !setting_text) {
if (is_inside_tree())
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
@@ -3388,61 +3556,63 @@ int TextEdit::get_visible_rows() const {
int total = cache.size.height;
total -= cache.style_normal->get_minimum_size().height;
+ if (h_scroll->is_visible_in_tree())
+ total -= h_scroll->get_size().height;
total /= get_row_height();
return total;
}
-int TextEdit::get_total_unhidden_rows() const {
- if (!is_hiding_enabled())
+int TextEdit::get_total_visible_rows() const {
+
+ // returns the total amount of rows we need in the editor.
+ // This skips hidden lines and counts each wrapping of a line.
+ if (!is_hiding_enabled() && !is_wrap_enabled())
return text.size();
- int total_unhidden = 0;
+ int total_rows = 0;
for (int i = 0; i < text.size(); i++) {
- if (!text.is_hidden(i))
- total_unhidden++;
+ if (!text.is_hidden(i)) {
+ total_rows++;
+ total_rows += times_line_wraps(i);
+ }
}
- return total_unhidden;
+ return total_rows;
}
-double TextEdit::get_line_scroll_pos(bool p_recalculate) const {
+void TextEdit::update_wrap_at() {
- if (!is_hiding_enabled())
- return cursor.line_ofs;
- if (!p_recalculate)
- return line_scroll_pos;
+ wrap_at = cache.size.width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - wrap_right_offset;
+ update_cursor_wrap_offset();
+ text.clear_wrap_cache();
- // count num unhidden lines to the cursor line ofs
- double new_line_scroll_pos = 0;
- int to = CLAMP(cursor.line_ofs, 0, text.size() - 1);
- for (int i = 0; i < to; i++) {
- if (!text.is_hidden(i))
- new_line_scroll_pos++;
+ for (int i = 0; i < text.size(); i++) {
+ // update all values that wrap
+ if (!line_wraps(i))
+ continue;
+ Vector<String> rows = get_wrap_rows_text(i);
+ text.set_line_wrap_amount(i, rows.size() - 1);
}
- return new_line_scroll_pos;
}
-void TextEdit::update_line_scroll_pos() {
+void TextEdit::adjust_viewport_to_cursor() {
- if (!is_hiding_enabled()) {
- line_scroll_pos = cursor.line_ofs;
- return;
- }
+ // make sure cursor is visible on the screen
+ scrolling = false;
- // count num unhidden lines to the cursor line ofs
- double new_line_scroll_pos = 0;
- int to = CLAMP(cursor.line_ofs, 0, text.size() - 1);
- for (int i = 0; i < to; i++) {
- if (!text.is_hidden(i))
- new_line_scroll_pos++;
- }
- line_scroll_pos = new_line_scroll_pos;
-}
+ int cur_line = cursor.line;
+ int cur_wrap = get_cursor_wrap_index();
-void TextEdit::adjust_viewport_to_cursor() {
- scrolling = false;
+ int first_vis_line = get_first_visible_line();
+ int first_vis_wrap = cursor.wrap_ofs;
+ int last_vis_line = get_last_visible_line();
+ int last_vis_wrap = get_last_visible_line_wrap_index();
- if (cursor.line_ofs > cursor.line) {
- cursor.line_ofs = cursor.line;
+ if (cur_line < first_vis_line || (cur_line == first_vis_line && cur_wrap < first_vis_wrap)) {
+ // cursor is above screen
+ set_line_as_first_visible(cur_line, cur_wrap);
+ } else if (cur_line > last_vis_line || (cur_line == last_vis_line && cur_wrap > last_vis_wrap)) {
+ // cursor is below screen
+ set_line_as_last_visible(cur_line, cur_wrap);
}
int visible_width = cache.size.width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width;
@@ -3450,91 +3620,174 @@ void TextEdit::adjust_viewport_to_cursor() {
visible_width -= v_scroll->get_combined_minimum_size().width;
visible_width -= 20; // give it a little more space
- int visible_rows = get_visible_rows();
- if (h_scroll->is_visible_in_tree() && !scroll_past_end_of_file_enabled)
- visible_rows -= ((h_scroll->get_combined_minimum_size().height - 1) / get_row_height());
- int num_rows = num_lines_from(CLAMP(cursor.line_ofs, 0, text.size() - 1), MIN(visible_rows, text.size() - 1 - cursor.line_ofs));
-
- // make sure the cursor is on the screen
- // above the caret
- if (cursor.line > (cursor.line_ofs + MAX(num_rows, visible_rows))) {
- cursor.line_ofs = cursor.line - num_lines_from(cursor.line, -visible_rows) + 1;
- }
- // below the caret
- if (cursor.line_ofs == cursor.line) {
- cursor.line_ofs = cursor.line - 2;
- }
- int line_ofs_max = text.size() - 1;
- if (!scroll_past_end_of_file_enabled) {
- line_ofs_max -= num_lines_from(text.size() - 1, -visible_rows) - 1;
- line_ofs_max += (h_scroll->is_visible_in_tree() ? 1 : 0);
- line_ofs_max += (cursor.line == text.size() - 1 ? 1 : 0);
- }
- line_ofs_max = MAX(line_ofs_max, 0);
- cursor.line_ofs = CLAMP(cursor.line_ofs, 0, line_ofs_max);
-
- // adjust x offset
- int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]);
+ if (is_wrap_enabled()) {
+ // adjust x offset
+ int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]);
- if (cursor_x > (cursor.x_ofs + visible_width))
- cursor.x_ofs = cursor_x - visible_width + 1;
+ if (cursor_x > (cursor.x_ofs + visible_width))
+ cursor.x_ofs = cursor_x - visible_width + 1;
- if (cursor_x < cursor.x_ofs)
- cursor.x_ofs = cursor_x;
-
- updating_scrolls = true;
- h_scroll->set_value(cursor.x_ofs);
- update_line_scroll_pos();
- double new_v_scroll = get_line_scroll_pos();
- // keep offset if smooth scroll is enabled
- if (smooth_scroll_enabled) {
- new_v_scroll += fmod(v_scroll->get_value(), 1.0);
+ if (cursor_x < cursor.x_ofs)
+ cursor.x_ofs = cursor_x;
+ } else {
+ cursor.x_ofs = 0;
}
- v_scroll->set_value(new_v_scroll);
- updating_scrolls = false;
+ h_scroll->set_value(cursor.x_ofs);
+
update();
}
void TextEdit::center_viewport_to_cursor() {
- scrolling = false;
- if (cursor.line_ofs > cursor.line)
- cursor.line_ofs = cursor.line;
+ // move viewport so the cursor is in the center of the screen
+ scrolling = false;
if (is_line_hidden(cursor.line))
unfold_line(cursor.line);
+ set_line_as_center_visible(cursor.line, get_cursor_wrap_index());
int visible_width = cache.size.width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width;
if (v_scroll->is_visible_in_tree())
visible_width -= v_scroll->get_combined_minimum_size().width;
visible_width -= 20; // give it a little more space
- int visible_rows = get_visible_rows();
- if (h_scroll->is_visible_in_tree())
- visible_rows -= ((h_scroll->get_combined_minimum_size().height - 1) / get_row_height());
- if (text.size() >= visible_rows) {
- int max_ofs = text.size() - (scroll_past_end_of_file_enabled ? 1 : MAX(num_lines_from(text.size() - 1, -visible_rows), 0));
- cursor.line_ofs = CLAMP(cursor.line - num_lines_from(MAX(cursor.line - visible_rows / 2, 0), -visible_rows / 2), 0, max_ofs);
+ if (is_wrap_enabled()) {
+ // center x offset
+ int cursor_x = get_column_x_offset_for_line(cursor.column, cursor.line);
+
+ if (cursor_x > (cursor.x_ofs + visible_width))
+ cursor.x_ofs = cursor_x - visible_width + 1;
+
+ if (cursor_x < cursor.x_ofs)
+ cursor.x_ofs = cursor_x;
+ } else {
+ cursor.x_ofs = 0;
}
- int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]);
+ h_scroll->set_value(cursor.x_ofs);
- if (cursor_x > (cursor.x_ofs + visible_width))
- cursor.x_ofs = cursor_x - visible_width + 1;
+ update();
+}
+
+void TextEdit::update_cursor_wrap_offset() {
+ int first_vis_line = get_first_visible_line();
+ if (line_wraps(first_vis_line)) {
+ cursor.wrap_ofs = MIN(cursor.wrap_ofs, times_line_wraps(first_vis_line));
+ } else {
+ cursor.wrap_ofs = 0;
+ }
+ set_line_as_first_visible(cursor.line_ofs, cursor.wrap_ofs);
+}
- if (cursor_x < cursor.x_ofs)
- cursor.x_ofs = cursor_x;
+bool TextEdit::line_wraps(int line) const {
- updating_scrolls = true;
- h_scroll->set_value(cursor.x_ofs);
- update_line_scroll_pos();
- double new_v_scroll = get_line_scroll_pos();
- // keep offset if smooth scroll is enabled
- if (smooth_scroll_enabled) {
- new_v_scroll += fmod(v_scroll->get_value(), 1.0);
+ ERR_FAIL_INDEX_V(line, text.size(), 0);
+ if (!is_wrap_enabled())
+ return false;
+ return text.get_line_width(line) > wrap_at;
+}
+
+int TextEdit::times_line_wraps(int line) const {
+
+ ERR_FAIL_INDEX_V(line, text.size(), 0);
+ if (!line_wraps(line))
+ return 0;
+
+ int wrap_amount = text.get_line_wrap_amount(line);
+ if (wrap_amount == -1) {
+ // update the value
+ Vector<String> rows = get_wrap_rows_text(line);
+ wrap_amount = rows.size() - 1;
+ text.set_line_wrap_amount(line, wrap_amount);
}
- v_scroll->set_value(new_v_scroll);
- updating_scrolls = false;
- update();
+
+ return wrap_amount;
+}
+
+Vector<String> TextEdit::get_wrap_rows_text(int p_line) const {
+
+ ERR_FAIL_INDEX_V(p_line, text.size(), Vector<String>());
+
+ Vector<String> lines;
+ if (!line_wraps(p_line)) {
+ lines.push_back(text[p_line]);
+ return lines;
+ }
+
+ int px = 0;
+ int col = 0;
+ String line_text = text[p_line];
+ String wrap_substring = "";
+
+ int word_px = 0;
+ String word_str = "";
+ int cur_wrap_index = 0;
+
+ int tab_offset_px = get_indent_level(p_line) * cache.font->get_char_size(' ').width;
+
+ while (col < line_text.length()) {
+ char c = line_text[col];
+ int w = text.get_char_width(c, line_text[col + 1], px + word_px);
+
+ int indent_ofs = (cur_wrap_index != 0 ? tab_offset_px : 0);
+
+ word_str += c;
+ word_px += w;
+ if (c == ' ') {
+ // end of a word; add this word to the substring
+ wrap_substring += word_str;
+ px += word_px;
+ word_str = "";
+ word_px = 0;
+ }
+
+ if ((indent_ofs + px + word_px) > wrap_at) {
+ // do not want to add this word
+ if (indent_ofs + word_px > wrap_at) {
+ // not enough space; add it anyway
+ wrap_substring += word_str;
+ px += word_px;
+ word_str = "";
+ word_px = 0;
+ }
+ lines.push_back(wrap_substring);
+ // reset for next wrap
+ cur_wrap_index++;
+ wrap_substring = "";
+ px = 0;
+ }
+ col++;
+ }
+ // line ends before hit wrap_at; add this word to the substring
+ wrap_substring += word_str;
+ px += word_px;
+ lines.push_back(wrap_substring);
+ return lines;
+}
+
+int TextEdit::get_cursor_wrap_index() const {
+
+ return get_line_wrap_index_at_col(cursor.line, cursor.column);
+}
+
+int TextEdit::get_line_wrap_index_at_col(int p_line, int p_column) const {
+
+ ERR_FAIL_INDEX_V(p_line, text.size(), 0);
+
+ if (!line_wraps(p_line))
+ return 0;
+
+ // loop through wraps in the line text until we get to the column
+ int wrap_index = 0;
+ int col = 0;
+ Vector<String> rows = get_wrap_rows_text(p_line);
+ for (int i = 0; i < rows.size(); i++) {
+ wrap_index = i;
+ String s = rows[wrap_index];
+ col += s.length();
+ if (col > p_column)
+ break;
+ }
+ return wrap_index;
}
void TextEdit::cursor_set_column(int p_col, bool p_adjust_viewport) {
@@ -3546,7 +3799,7 @@ void TextEdit::cursor_set_column(int p_col, bool p_adjust_viewport) {
if (cursor.column > get_line(cursor.line).length())
cursor.column = get_line(cursor.line).length();
- cursor.last_fit_x = get_column_x_offset(cursor.column, get_line(cursor.line));
+ cursor.last_fit_x = get_column_x_offset_for_line(cursor.column, cursor.line);
if (p_adjust_viewport)
adjust_viewport_to_cursor();
@@ -3558,7 +3811,7 @@ void TextEdit::cursor_set_column(int p_col, bool p_adjust_viewport) {
}
}
-void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_hidden) {
+void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_hidden, int p_wrap_index) {
if (setting_row)
return;
@@ -3567,8 +3820,8 @@ void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_
if (p_row < 0)
p_row = 0;
- if (p_row >= (int)text.size())
- p_row = (int)text.size() - 1;
+ if (p_row >= text.size())
+ p_row = text.size() - 1;
if (!p_can_be_hidden) {
if (is_line_hidden(CLAMP(p_row, 0, text.size() - 1))) {
@@ -3586,7 +3839,18 @@ void TextEdit::cursor_set_line(int p_row, bool p_adjust_viewport, bool p_can_be_
}
}
cursor.line = p_row;
- cursor.column = get_char_pos_for(cursor.last_fit_x, get_line(cursor.line));
+
+ int n_col = get_char_pos_for_line(cursor.last_fit_x, p_row, p_wrap_index);
+ if (is_wrap_enabled() && p_wrap_index < times_line_wraps(p_row)) {
+ Vector<String> rows = get_wrap_rows_text(p_row);
+ int row_end_col = 0;
+ for (int i = 0; i < p_wrap_index + 1; i++) {
+ row_end_col += rows[i].length();
+ }
+ if (n_col >= row_end_col)
+ n_col -= 1;
+ }
+ cursor.column = n_col;
if (p_adjust_viewport)
adjust_viewport_to_cursor();
@@ -3663,9 +3927,25 @@ void TextEdit::_scroll_moved(double p_to_val) {
if (h_scroll->is_visible_in_tree())
cursor.x_ofs = h_scroll->get_value();
if (v_scroll->is_visible_in_tree()) {
- double val = v_scroll->get_value();
- cursor.line_ofs = num_lines_from(0, (int)floor(val));
- line_scroll_pos = (int)floor(val);
+
+ // set line ofs and wrap ofs
+ int v_scroll_i = floor(get_v_scroll());
+ int sc = 0;
+ int n_line;
+ for (n_line = 0; n_line < text.size(); n_line++) {
+ if (!is_line_hidden(n_line)) {
+ sc++;
+ sc += times_line_wraps(n_line);
+ if (sc > v_scroll_i)
+ break;
+ }
+ }
+ int line_wrap_amount = times_line_wraps(n_line);
+ int wi = line_wrap_amount - (sc - v_scroll_i - 1);
+ wi = CLAMP(wi, 0, line_wrap_amount);
+
+ cursor.line_ofs = n_line;
+ cursor.wrap_ofs = wi;
}
update();
}
@@ -3675,29 +3955,73 @@ int TextEdit::get_row_height() const {
return cache.font->get_height() + cache.line_spacing;
}
-int TextEdit::get_char_pos_for(int p_px, String p_str) const {
+int TextEdit::get_char_pos_for_line(int p_px, int p_line, int p_wrap_index) const {
- int px = 0;
- int c = 0;
+ ERR_FAIL_INDEX_V(p_line, text.size(), 0);
- int tab_w = cache.font->get_char_size(' ').width * indent_size;
+ if (line_wraps(p_line)) {
- while (c < p_str.length()) {
+ int line_wrap_amount = times_line_wraps(p_line);
+ int wrap_offset_px = get_indent_level(p_line) * cache.font->get_char_size(' ').width;
+ if (p_wrap_index > line_wrap_amount)
+ p_wrap_index = line_wrap_amount;
+ if (p_wrap_index > 0)
+ p_px -= wrap_offset_px;
+ else
+ p_wrap_index = 0;
+ Vector<String> rows = get_wrap_rows_text(p_line);
+ int c_pos = get_char_pos_for(p_px, rows[p_wrap_index]);
+ for (int i = 0; i < p_wrap_index; i++) {
+ String s = rows[i];
+ c_pos += s.length();
+ }
- int w = 0;
+ return c_pos;
+ } else {
- if (p_str[c] == '\t') {
+ return get_char_pos_for(p_px, text[p_line]);
+ }
+}
- int left = px % tab_w;
- if (left == 0)
- w = tab_w;
- else
- w = tab_w - px % tab_w; // is right...
+int TextEdit::get_column_x_offset_for_line(int p_char, int p_line) const {
- } else {
+ ERR_FAIL_INDEX_V(p_line, text.size(), 0);
- w = cache.font->get_char_size(p_str[c], p_str[c + 1]).width;
+ if (line_wraps(p_line)) {
+
+ int n_char = p_char;
+ int col = 0;
+ Vector<String> rows = get_wrap_rows_text(p_line);
+ int wrap_index = 0;
+ for (int i = 0; i < rows.size(); i++) {
+ wrap_index = i;
+ String s = rows[wrap_index];
+ col += s.length();
+ if (col > p_char)
+ break;
+ n_char -= s.length();
}
+ int px = get_column_x_offset(n_char, rows[wrap_index]);
+
+ int wrap_offset_px = get_indent_level(p_line) * cache.font->get_char_size(' ').width;
+ if (wrap_index != 0)
+ px += wrap_offset_px;
+
+ return px;
+ } else {
+
+ return get_column_x_offset(p_char, text[p_line]);
+ }
+}
+
+int TextEdit::get_char_pos_for(int p_px, String p_str) const {
+
+ int px = 0;
+ int c = 0;
+
+ while (c < p_str.length()) {
+
+ int w = text.get_char_width(p_str[c], p_str[c + 1], px);
if (p_px < (px + w / 2))
break;
@@ -3708,28 +4032,16 @@ int TextEdit::get_char_pos_for(int p_px, String p_str) const {
return c;
}
-int TextEdit::get_column_x_offset(int p_char, String p_str) {
+int TextEdit::get_column_x_offset(int p_char, String p_str) const {
int px = 0;
- int tab_w = cache.font->get_char_size(' ').width * indent_size;
-
for (int i = 0; i < p_char; i++) {
if (i >= p_str.length())
break;
- if (p_str[i] == '\t') {
-
- int left = px % tab_w;
- if (left == 0)
- px += tab_w;
- else
- px += tab_w - px % tab_w; // is right...
-
- } else {
- px += cache.font->get_char_size(p_str[i], p_str[i + 1]).width;
- }
+ px += text.get_char_width(p_str[i], p_str[i + 1], px);
}
return px;
@@ -3805,7 +4117,7 @@ void TextEdit::set_text(String p_text) {
cursor.line = 0;
cursor.x_ofs = 0;
cursor.line_ofs = 0;
- line_scroll_pos = 0;
+ cursor.wrap_ofs = 0;
cursor.last_fit_x = 0;
cursor_set_line(0);
cursor_set_column(0);
@@ -3891,7 +4203,7 @@ void TextEdit::_clear() {
cursor.line = 0;
cursor.x_ofs = 0;
cursor.line_ofs = 0;
- line_scroll_pos = 0;
+ cursor.wrap_ofs = 0;
cursor.last_fit_x = 0;
}
@@ -3913,14 +4225,14 @@ bool TextEdit::is_readonly() const {
return readonly;
}
-void TextEdit::set_wrap(bool p_wrap) {
+void TextEdit::set_wrap_enabled(bool p_wrap_enabled) {
- wrap = p_wrap;
+ wrap_enabled = p_wrap_enabled;
}
-bool TextEdit::is_wrapping() const {
+bool TextEdit::is_wrap_enabled() const {
- return wrap;
+ return wrap_enabled;
}
void TextEdit::set_max_chars(int p_max_chars) {
@@ -4069,7 +4381,7 @@ void TextEdit::clear_colors() {
keywords.clear();
color_regions.clear();
color_region_cache.clear();
- text.clear_caches();
+ text.clear_width_cache();
}
void TextEdit::add_keyword_color(const String &p_keyword, const Color &p_color) {
@@ -4089,7 +4401,7 @@ Color TextEdit::get_keyword_color(String p_keyword) const {
void TextEdit::add_color_region(const String &p_begin_key, const String &p_end_key, const Color &p_color, bool p_line_only) {
color_regions.push_back(ColorRegion(p_begin_key, p_end_key, p_color, p_line_only));
- text.clear_caches();
+ text.clear_width_cache();
update();
}
@@ -4174,6 +4486,7 @@ void TextEdit::paste() {
String clipboard = OS::get_singleton()->get_clipboard();
+ begin_complex_operation();
if (selection.active) {
selection.active = false;
@@ -4190,6 +4503,8 @@ void TextEdit::paste() {
}
_insert_text_at_cursor(clipboard);
+ end_complex_operation();
+
update();
}
@@ -4583,52 +4898,99 @@ void TextEdit::unhide_all_lines() {
update();
}
-int TextEdit::num_lines_from(int p_line_from, int unhidden_amount) const {
+int TextEdit::num_lines_from(int p_line_from, int visible_amount) const {
- // returns the number of hidden and unhidden lines from p_line_from to p_line_from + amount of visible lines
- ERR_FAIL_INDEX_V(p_line_from, text.size(), ABS(unhidden_amount));
+ // returns the number of lines (hidden and unhidden) from p_line_from to (p_line_from + visible_amount of unhidden lines)
+ ERR_FAIL_INDEX_V(p_line_from, text.size(), ABS(visible_amount));
if (!is_hiding_enabled())
- return ABS(unhidden_amount);
+ return ABS(visible_amount);
+
int num_visible = 0;
int num_total = 0;
- if (unhidden_amount >= 0) {
+ if (visible_amount >= 0) {
for (int i = p_line_from; i < text.size(); i++) {
num_total++;
- if (!is_line_hidden(i))
+ if (!is_line_hidden(i)) {
num_visible++;
- if (num_visible >= unhidden_amount)
+ }
+ if (num_visible >= visible_amount)
break;
}
} else {
- unhidden_amount = ABS(unhidden_amount);
+ visible_amount = ABS(visible_amount);
for (int i = p_line_from; i >= 0; i--) {
num_total++;
- if (!is_line_hidden(i))
+ if (!is_line_hidden(i)) {
num_visible++;
- if (num_visible >= unhidden_amount)
+ }
+ if (num_visible >= visible_amount)
break;
}
}
return num_total;
}
-bool TextEdit::is_last_visible_line(int p_line) const {
+int TextEdit::num_lines_from_rows(int p_line_from, int p_wrap_index_from, int visible_amount, int &wrap_index) const {
- ERR_FAIL_INDEX_V(p_line, text.size(), false);
+ // returns the number of lines (hidden and unhidden) from (p_line_from + p_wrap_index_from) row to (p_line_from + visible_amount of unhidden and wrapped rows)
+ // wrap index is set to the wrap index of the last line
+ wrap_index = 0;
+ ERR_FAIL_INDEX_V(p_line_from, text.size(), ABS(visible_amount));
- if (p_line == text.size() - 1)
- return true;
+ if (!is_hiding_enabled() && !is_wrap_enabled())
+ return ABS(visible_amount);
+ int num_visible = 0;
+ int num_total = 0;
+ if (visible_amount == 0) {
+ num_total = 0;
+ wrap_index = 0;
+ } else if (visible_amount > 0) {
+ int i;
+ num_visible -= p_wrap_index_from;
+ for (i = p_line_from; i < text.size(); i++) {
+ num_total++;
+ if (!is_line_hidden(i)) {
+ num_visible++;
+ num_visible += times_line_wraps(i);
+ }
+ if (num_visible >= visible_amount)
+ break;
+ }
+ wrap_index = times_line_wraps(MIN(i, text.size() - 1)) - (num_visible - visible_amount);
+ } else {
+ visible_amount = ABS(visible_amount);
+ int i;
+ num_visible -= times_line_wraps(p_line_from) - p_wrap_index_from;
+ for (i = p_line_from; i >= 0; i--) {
+ num_total++;
+ if (!is_line_hidden(i)) {
+ num_visible++;
+ num_visible += times_line_wraps(i);
+ }
+ if (num_visible >= visible_amount)
+ break;
+ }
+ wrap_index = (num_visible - visible_amount);
+ }
+ wrap_index = MAX(wrap_index, 0);
+ return num_total;
+}
+
+int TextEdit::get_last_unhidden_line() const {
+
+ // returns the last line in the text that is not hidden
if (!is_hiding_enabled())
- return false;
+ return text.size() - 1;
- for (int i = p_line + 1; i < text.size(); i++) {
- if (!is_line_hidden(i))
- return false;
+ int last_line;
+ for (last_line = text.size() - 1; last_line > 0; last_line--) {
+ if (!is_line_hidden(last_line)) {
+ break;
+ }
}
-
- return true;
+ return last_line;
}
int TextEdit::get_indent_level(int p_line) const {
@@ -4648,7 +5010,7 @@ int TextEdit::get_indent_level(int p_line) const {
break;
}
}
- return tab_count + whitespace_count / indent_size;
+ return tab_count * indent_size + whitespace_count;
}
bool TextEdit::is_line_comment(int p_line) const {
@@ -4978,6 +5340,11 @@ void TextEdit::set_indent_size(const int p_size) {
update();
}
+int TextEdit::get_indent_size() {
+
+ return indent_size;
+}
+
void TextEdit::set_draw_tabs(bool p_draw) {
draw_tabs = p_draw;
@@ -4991,6 +5358,7 @@ bool TextEdit::is_drawing_tabs() const {
void TextEdit::set_override_selected_font_color(bool p_override_selected_font_color) {
override_selected_font_color = p_override_selected_font_color;
}
+
bool TextEdit::is_overriding_selected_font_color() const {
return override_selected_font_color;
}
@@ -5011,58 +5379,143 @@ bool TextEdit::is_insert_text_operation() {
uint32_t TextEdit::get_version() const {
return current_op.version;
}
+
uint32_t TextEdit::get_saved_version() const {
return saved_version;
}
+
void TextEdit::tag_saved_version() {
saved_version = get_version();
}
-int TextEdit::get_v_scroll() const {
+double TextEdit::get_scroll_pos_for_line(int p_line, int p_wrap_index) const {
- return v_scroll->get_value();
-}
-void TextEdit::set_v_scroll(int p_scroll) {
+ if (!is_wrap_enabled() && !is_hiding_enabled())
+ return p_line;
- if (p_scroll < 0) {
- p_scroll = 0;
- }
- if (!scroll_past_end_of_file_enabled) {
- if (p_scroll + get_visible_rows() > get_total_unhidden_rows()) {
- int num_rows = num_lines_from(CLAMP(p_scroll, 0, text.size() - 1), MIN(get_visible_rows(), text.size() - 1 - p_scroll));
- p_scroll = text.size() - num_rows;
+ // count the number of visible lines up to this line
+ double new_line_scroll_pos = 0;
+ int to = CLAMP(p_line, 0, text.size() - 1);
+ for (int i = 0; i < to; i++) {
+ if (!text.is_hidden(i)) {
+ new_line_scroll_pos++;
+ new_line_scroll_pos += times_line_wraps(i);
}
}
+ new_line_scroll_pos += p_wrap_index;
+ return new_line_scroll_pos;
+}
+
+void TextEdit::set_line_as_first_visible(int p_line, int p_wrap_index) {
+
+ set_v_scroll(get_scroll_pos_for_line(p_line, p_wrap_index));
+}
+
+void TextEdit::set_line_as_center_visible(int p_line, int p_wrap_index) {
+
+ int visible_rows = get_visible_rows();
+ int wi;
+ int first_line = p_line - num_lines_from_rows(p_line, p_wrap_index, -visible_rows / 2, wi) + 1;
+
+ set_v_scroll(get_scroll_pos_for_line(first_line, wi));
+}
+
+void TextEdit::set_line_as_last_visible(int p_line, int p_wrap_index) {
+
+ int wi;
+ int first_line = p_line - num_lines_from_rows(p_line, p_wrap_index, -get_visible_rows() - 1, wi) + 1;
+
+ set_v_scroll(get_scroll_pos_for_line(first_line, wi) + get_visible_rows_offset());
+}
+
+int TextEdit::get_first_visible_line() const {
+
+ return CLAMP(cursor.line_ofs, 0, text.size() - 1);
+}
+
+int TextEdit::get_last_visible_line() const {
+
+ int first_vis_line = get_first_visible_line();
+ int last_vis_line = 0;
+ int wi;
+ last_vis_line = first_vis_line + num_lines_from_rows(first_vis_line, cursor.wrap_ofs, get_visible_rows() + 1, wi) - 1;
+ last_vis_line = CLAMP(last_vis_line, 0, text.size() - 1);
+ return last_vis_line;
+}
+
+int TextEdit::get_last_visible_line_wrap_index() const {
+
+ int first_vis_line = get_first_visible_line();
+ int last_vis_line = 0;
+ int wi;
+ last_vis_line = first_vis_line + num_lines_from_rows(first_vis_line, cursor.wrap_ofs, get_visible_rows() + 1, wi) - 1;
+ return wi;
+}
+
+double TextEdit::get_visible_rows_offset() const {
+
+ double total = cache.size.height;
+ total -= cache.style_normal->get_minimum_size().height;
+ if (h_scroll->is_visible_in_tree())
+ total -= h_scroll->get_size().height;
+ total /= (double)get_row_height();
+ total = total - floor(total);
+ total = -CLAMP(total, 0.001, 1) + 1;
+ return total;
+}
+
+double TextEdit::get_v_scroll_offset() const {
+
+ double val = get_v_scroll() - floor(get_v_scroll());
+ return CLAMP(val, 0, 1);
+}
+
+double TextEdit::get_v_scroll() const {
+
+ return v_scroll->get_value();
+}
+
+void TextEdit::set_v_scroll(double p_scroll) {
+
v_scroll->set_value(p_scroll);
- cursor.line_ofs = num_lines_from(0, p_scroll);
- line_scroll_pos = p_scroll;
+ int max_v_scroll = v_scroll->get_max() - v_scroll->get_page();
+ if (p_scroll >= max_v_scroll - 1.0)
+ _scroll_moved(v_scroll->get_value());
}
int TextEdit::get_h_scroll() const {
return h_scroll->get_value();
}
+
void TextEdit::set_h_scroll(int p_scroll) {
+ if (p_scroll < 0) {
+ p_scroll = 0;
+ }
h_scroll->set_value(p_scroll);
}
void TextEdit::set_smooth_scroll_enabled(bool p_enable) {
+
v_scroll->set_smooth_scroll_enabled(p_enable);
smooth_scroll_enabled = p_enable;
}
bool TextEdit::is_smooth_scroll_enabled() const {
+
return smooth_scroll_enabled;
}
void TextEdit::set_v_scroll_speed(float p_speed) {
+
v_scroll_speed = p_speed;
}
float TextEdit::get_v_scroll_speed() const {
+
return v_scroll_speed;
}
@@ -5559,8 +6012,8 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_readonly", "enable"), &TextEdit::set_readonly);
ClassDB::bind_method(D_METHOD("is_readonly"), &TextEdit::is_readonly);
- ClassDB::bind_method(D_METHOD("set_wrap", "enable"), &TextEdit::set_wrap);
- ClassDB::bind_method(D_METHOD("is_wrapping"), &TextEdit::is_wrapping);
+ ClassDB::bind_method(D_METHOD("set_wrap_enabled", "enable"), &TextEdit::set_wrap_enabled);
+ ClassDB::bind_method(D_METHOD("is_wrap_enabled"), &TextEdit::is_wrap_enabled);
// ClassDB::bind_method(D_METHOD("set_max_chars", "amount"), &TextEdit::set_max_chars);
// ClassDB::bind_method(D_METHOD("get_max_char"), &TextEdit::get_max_chars);
ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &TextEdit::set_context_menu_enabled);
@@ -5638,7 +6091,7 @@ void TextEdit::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "smooth_scrolling"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_scroll_speed"), "set_v_scroll_speed", "get_v_scroll_speed");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hiding_enabled"), "set_hiding_enabled", "is_hiding_enabled");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_lines"), "set_wrap", "is_wrapping");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "wrap_enabled"), "set_wrap_enabled", "is_wrap_enabled");
// ADD_PROPERTY(PropertyInfo(Variant::BOOL, "max_chars"), "set_max_chars", "get_max_chars");
ADD_GROUP("Caret", "caret_");
@@ -5673,7 +6126,8 @@ TextEdit::TextEdit() {
draw_caret = true;
max_chars = 0;
clear();
- wrap = false;
+ wrap_enabled = false;
+ wrap_right_offset = 10;
set_focus_mode(FOCUS_ALL);
syntax_highlighter = NULL;
_update_caches();
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index 30e70bfd0b..6f4eb01a70 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -76,6 +76,7 @@ public:
bool marked : 1;
bool breakpoint : 1;
bool hidden : 1;
+ int wrap_amount_cache : 24;
Map<int, ColorRegionInfo> region_info;
String data;
};
@@ -94,6 +95,9 @@ public:
void set_color_regions(const Vector<ColorRegion> *p_regions) { color_regions = p_regions; }
int get_line_width(int p_line) const;
int get_max_width(bool p_exclude_hidden = false) const;
+ int get_char_width(char c, char next_c, int px) const;
+ void set_line_wrap_amount(int p_line, int p_wrap_amount) const;
+ int get_line_wrap_amount(int p_line) const;
const Map<int, ColorRegionInfo> &get_color_region_info(int p_line) const;
void set(int p_line, const String &p_text);
void set_marked(int p_line, bool p_marked) { text[p_line].marked = p_marked; }
@@ -106,7 +110,8 @@ public:
void remove(int p_at);
int size() const { return text.size(); }
void clear();
- void clear_caches();
+ void clear_width_cache();
+ void clear_wrap_cache();
_FORCE_INLINE_ const String &operator[](int p_line) const { return text[p_line].data; }
Text() { indent_size = 4; }
};
@@ -115,7 +120,7 @@ private:
struct Cursor {
int last_fit_x;
int line, column; ///< cursor
- int x_ofs, line_ofs;
+ int x_ofs, line_ofs, wrap_ofs;
} cursor;
struct Selection {
@@ -263,8 +268,11 @@ private:
bool block_caret;
bool right_click_moves_caret;
+ bool wrap_enabled;
+ int wrap_at;
+ int wrap_right_offset;
+
bool setting_row;
- bool wrap;
bool draw_tabs;
bool override_selected_font_color;
bool cursor_changed_dirty;
@@ -321,19 +329,34 @@ private:
int search_result_line;
int search_result_col;
- double line_scroll_pos;
-
bool context_menu_enabled;
int get_visible_rows() const;
- int get_total_unhidden_rows() const;
- double get_line_scroll_pos(bool p_recalculate = false) const;
- void update_line_scroll_pos();
-
+ int get_total_visible_rows() const;
+
+ void update_cursor_wrap_offset();
+ void update_wrap_at();
+ bool line_wraps(int line) const;
+ int times_line_wraps(int line) const;
+ Vector<String> get_wrap_rows_text(int p_line) const;
+ int get_cursor_wrap_index() const;
+ int get_line_wrap_index_at_col(int p_line, int p_column) const;
int get_char_count();
+ double get_scroll_pos_for_line(int p_line, int p_wrap_index = 0) const;
+ void set_line_as_first_visible(int p_line, int p_wrap_index = 0);
+ void set_line_as_center_visible(int p_line, int p_wrap_index = 0);
+ void set_line_as_last_visible(int p_line, int p_wrap_index = 0);
+ int get_first_visible_line() const;
+ int get_last_visible_line() const;
+ int get_last_visible_line_wrap_index() const;
+ double get_visible_rows_offset() const;
+ double get_v_scroll_offset() const;
+
+ int get_char_pos_for_line(int p_px, int p_line, int p_wrap_index = 0) const;
+ int get_column_x_offset_for_line(int p_char, int p_line) const;
int get_char_pos_for(int p_px, String p_str) const;
- int get_column_x_offset(int p_char, String p_str);
+ int get_column_x_offset(int p_char, String p_str) const;
void adjust_viewport_to_cursor();
double get_scroll_line_diff() const;
@@ -455,8 +478,10 @@ public:
bool is_line_hidden(int p_line) const;
void fold_all_lines();
void unhide_all_lines();
- int num_lines_from(int p_line_from, int unhidden_amount) const;
- bool is_last_visible_line(int p_line) const;
+ int num_lines_from(int p_line_from, int visible_amount) const;
+ int num_lines_from_rows(int p_line_from, int p_wrap_index_from, int visible_amount, int &wrap_index) const;
+ int get_last_unhidden_line() const;
+
bool can_fold(int p_line) const;
bool is_folded(int p_line) const;
void fold_line(int p_line);
@@ -493,7 +518,7 @@ public:
void center_viewport_to_cursor();
void cursor_set_column(int p_col, bool p_adjust_viewport = true);
- void cursor_set_line(int p_row, bool p_adjust_viewport = true, bool p_can_be_hidden = true);
+ void cursor_set_line(int p_row, bool p_adjust_viewport = true, bool p_can_be_hidden = true, int p_wrap_index = 0);
int cursor_get_column() const;
int cursor_get_line() const;
@@ -516,8 +541,8 @@ public:
void set_max_chars(int p_max_chars);
int get_max_chars() const;
- void set_wrap(bool p_wrap);
- bool is_wrapping() const;
+ void set_wrap_enabled(bool p_wrap_enabled);
+ bool is_wrap_enabled() const;
void clear();
@@ -557,6 +582,7 @@ public:
void set_indent_using_spaces(const bool p_use_spaces);
bool is_indent_using_spaces() const;
void set_indent_size(const int p_size);
+ int get_indent_size();
void set_draw_tabs(bool p_draw);
bool is_drawing_tabs() const;
void set_override_selected_font_color(bool p_override_selected_font_color);
@@ -577,8 +603,8 @@ public:
Color get_member_color(String p_member) const;
void clear_member_keywords();
- int get_v_scroll() const;
- void set_v_scroll(int p_scroll);
+ double get_v_scroll() const;
+ void set_v_scroll(double p_scroll);
int get_h_scroll() const;
void set_h_scroll(int p_scroll);
diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp
index 24b04c0c4a..1443d5efbf 100644
--- a/scene/main/instance_placeholder.cpp
+++ b/scene/main/instance_placeholder.cpp
@@ -52,6 +52,7 @@ bool InstancePlaceholder::_get(const StringName &p_name, Variant &r_ret) const {
}
return false;
}
+
void InstancePlaceholder::_get_property_list(List<PropertyInfo> *p_list) const {
for (const List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
@@ -73,13 +74,14 @@ String InstancePlaceholder::get_instance_path() const {
return path;
}
-void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_scene) {
- ERR_FAIL_COND(!is_inside_tree());
+Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene> &p_custom_scene) {
+
+ ERR_FAIL_COND_V(!is_inside_tree(), NULL);
Node *base = get_parent();
if (!base)
- return;
+ return NULL;
Ref<PackedScene> ps;
if (p_custom_scene.is_valid())
@@ -88,7 +90,7 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s
ps = ResourceLoader::load(path, "PackedScene");
if (!ps.is_valid())
- return;
+ return NULL;
Node *scene = ps->instance();
scene->set_name(get_name());
int pos = get_position_in_parent();
@@ -97,11 +99,20 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s
scene->set(E->get().name, E->get().value);
}
- queue_delete();
+ if (p_replace) {
+ queue_delete();
+ base->remove_child(this);
+ }
- base->remove_child(this);
base->add_child(scene);
base->move_child(scene, pos);
+
+ return scene;
+}
+
+void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_scene) {
+ //Deprecated by
+ create_instance(true, p_custom_scene);
}
Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
@@ -124,6 +135,7 @@ Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
void InstancePlaceholder::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_stored_values", "with_order"), &InstancePlaceholder::get_stored_values, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("create_instance", "replace", "custom_scene"), &InstancePlaceholder::create_instance, DEFVAL(false), DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("replace_by_instance", "custom_scene"), &InstancePlaceholder::replace_by_instance, DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("get_instance_path"), &InstancePlaceholder::get_instance_path);
}
diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h
index d70f1318ea..2158257c93 100644
--- a/scene/main/instance_placeholder.h
+++ b/scene/main/instance_placeholder.h
@@ -60,6 +60,7 @@ public:
Dictionary get_stored_values(bool p_with_order = false);
+ Node *create_instance(bool p_replace = false, const Ref<PackedScene> &p_custom_scene = Ref<PackedScene>());
void replace_by_instance(const Ref<PackedScene> &p_custom_scene = Ref<PackedScene>());
InstancePlaceholder();
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 001b8cfd0b..e6ea4e4b4a 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -136,7 +136,6 @@ void Node::_notification(int p_notification) {
get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready, NULL, 0);
}
- //emit_signal(SceneStringNames::get_singleton()->enter_tree);
} break;
case NOTIFICATION_POSTINITIALIZE: {
@@ -180,6 +179,7 @@ void Node::_propagate_ready() {
if (data.ready_first) {
data.ready_first = false;
notification(NOTIFICATION_READY);
+ emit_signal(SceneStringNames::get_singleton()->ready);
}
}
@@ -477,7 +477,7 @@ bool Node::is_network_master() const {
ERR_FAIL_COND_V(!is_inside_tree(), false);
- return get_multiplayer_api()->get_network_unique_id() == data.network_master;
+ return get_multiplayer()->get_network_unique_id() == data.network_master;
}
/***** RPC CONFIG ********/
@@ -668,12 +668,12 @@ Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Va
void Node::rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount) {
ERR_FAIL_COND(!is_inside_tree());
- get_multiplayer_api()->rpcp(this, p_peer_id, p_unreliable, p_method, p_arg, p_argcount);
+ get_multiplayer()->rpcp(this, p_peer_id, p_unreliable, p_method, p_arg, p_argcount);
}
void Node::rsetp(int p_peer_id, bool p_unreliable, const StringName &p_property, const Variant &p_value) {
ERR_FAIL_COND(!is_inside_tree());
- get_multiplayer_api()->rsetp(this, p_peer_id, p_unreliable, p_property, p_value);
+ get_multiplayer()->rsetp(this, p_peer_id, p_unreliable, p_property, p_value);
}
/******** RSET *********/
@@ -698,21 +698,21 @@ void Node::rset_unreliable_id(int p_peer_id, const StringName &p_property, const
}
//////////// end of rpc
-Ref<MultiplayerAPI> Node::get_multiplayer_api() const {
- if (multiplayer_api.is_valid())
- return multiplayer_api;
+Ref<MultiplayerAPI> Node::get_multiplayer() const {
+ if (multiplayer.is_valid())
+ return multiplayer;
if (!is_inside_tree())
return Ref<MultiplayerAPI>();
- return get_tree()->get_multiplayer_api();
+ return get_tree()->get_multiplayer();
}
-Ref<MultiplayerAPI> Node::get_custom_multiplayer_api() const {
- return multiplayer_api;
+Ref<MultiplayerAPI> Node::get_custom_multiplayer() const {
+ return multiplayer;
}
-void Node::set_custom_multiplayer_api(Ref<MultiplayerAPI> p_multiplayer_api) {
+void Node::set_custom_multiplayer(Ref<MultiplayerAPI> p_multiplayer) {
- multiplayer_api = p_multiplayer_api;
+ multiplayer = p_multiplayer;
}
const Map<StringName, Node::RPCMode>::Element *Node::get_node_rpc_mode(const StringName &p_method) {
@@ -2581,18 +2581,21 @@ Array Node::_get_children() const {
return arr;
}
-#ifdef TOOLS_ENABLED
void Node::set_import_path(const NodePath &p_import_path) {
+#ifdef TOOLS_ENABLED
data.import_path = p_import_path;
+#endif
}
NodePath Node::get_import_path() const {
+#ifdef TOOLS_ENABLED
return data.import_path;
-}
-
+#else
+ return NodePath();
#endif
+}
static void _add_nodes_to_options(const Node *p_base, const Node *p_node, List<String> *r_options) {
@@ -2745,19 +2748,16 @@ void Node::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_network_master"), &Node::is_network_master);
- ClassDB::bind_method(D_METHOD("get_multiplayer_api"), &Node::get_multiplayer_api);
- ClassDB::bind_method(D_METHOD("get_custom_multiplayer_api"), &Node::get_custom_multiplayer_api);
- ClassDB::bind_method(D_METHOD("set_custom_multiplayer_api", "api"), &Node::set_custom_multiplayer_api);
+ ClassDB::bind_method(D_METHOD("get_multiplayer"), &Node::get_multiplayer);
+ ClassDB::bind_method(D_METHOD("get_custom_multiplayer"), &Node::get_custom_multiplayer);
+ ClassDB::bind_method(D_METHOD("set_custom_multiplayer", "api"), &Node::set_custom_multiplayer);
ClassDB::bind_method(D_METHOD("rpc_config", "method", "mode"), &Node::rpc_config);
ClassDB::bind_method(D_METHOD("rset_config", "property", "mode"), &Node::rset_config);
-#ifdef TOOLS_ENABLED
ClassDB::bind_method(D_METHOD("_set_import_path", "import_path"), &Node::set_import_path);
ClassDB::bind_method(D_METHOD("_get_import_path"), &Node::get_import_path);
ADD_PROPERTYNZ(PropertyInfo(Variant::NODE_PATH, "_import_path", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL), "_set_import_path", "_get_import_path");
-#endif
-
{
MethodInfo mi;
@@ -2814,6 +2814,7 @@ void Node::_bind_methods() {
BIND_ENUM_CONSTANT(DUPLICATE_SCRIPTS);
BIND_ENUM_CONSTANT(DUPLICATE_USE_INSTANCING);
+ ADD_SIGNAL(MethodInfo("ready"));
ADD_SIGNAL(MethodInfo("renamed"));
ADD_SIGNAL(MethodInfo("tree_entered"));
ADD_SIGNAL(MethodInfo("tree_exiting"));
@@ -2829,8 +2830,8 @@ void Node::_bind_methods() {
ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "name", PROPERTY_HINT_NONE, "", 0), "set_name", "get_name");
ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "filename", PROPERTY_HINT_NONE, "", 0), "set_filename", "get_filename");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "owner", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_owner", "get_owner");
- ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "multiplayer_api", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer_api");
- ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "custom_multiplayer_api", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer_api", "get_custom_multiplayer_api");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "", "get_multiplayer");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "custom_multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_custom_multiplayer", "get_custom_multiplayer");
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
BIND_VMETHOD(MethodInfo("_physics_process", PropertyInfo(Variant::REAL, "delta")));
diff --git a/scene/main/node.h b/scene/main/node.h
index a0b6399486..4ff1247e14 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -151,7 +151,7 @@ private:
NAME_CASING_SNAKE_CASE
};
- Ref<MultiplayerAPI> multiplayer_api;
+ Ref<MultiplayerAPI> multiplayer;
void _print_tree_pretty(const String prefix, const bool last);
void _print_tree(const Node *p_node);
@@ -380,10 +380,8 @@ public:
void force_parent_owned() { data.parent_owned = true; } //hack to avoid duplicate nodes
-#ifdef TOOLS_ENABLED
void set_import_path(const NodePath &p_import_path); //path used when imported, used by scene editors to keep tracking
NodePath get_import_path() const;
-#endif
bool is_owned_by_parent() const;
@@ -421,9 +419,9 @@ public:
void rpcp(int p_peer_id, bool p_unreliable, const StringName &p_method, const Variant **p_arg, int p_argcount);
void rsetp(int p_peer_id, bool p_unreliable, const StringName &p_property, const Variant &p_value);
- Ref<MultiplayerAPI> get_multiplayer_api() const;
- Ref<MultiplayerAPI> get_custom_multiplayer_api() const;
- void set_custom_multiplayer_api(Ref<MultiplayerAPI> p_multiplayer_api);
+ Ref<MultiplayerAPI> get_multiplayer() const;
+ Ref<MultiplayerAPI> get_custom_multiplayer() const;
+ void set_custom_multiplayer(Ref<MultiplayerAPI> p_multiplayer);
const Map<StringName, RPCMode>::Element *get_node_rpc_mode(const StringName &p_method);
const Map<StringName, RPCMode>::Element *get_node_rset_mode(const StringName &p_property);
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index 727807dbcd..607dbebf6c 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -485,7 +485,7 @@ bool SceneTree::idle(float p_time) {
idle_process_time = p_time;
- multiplayer_api->poll();
+ multiplayer->poll();
emit_signal("idle_frame");
@@ -1205,16 +1205,20 @@ void SceneTree::set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, c
_update_root_rect();
}
-#ifdef TOOLS_ENABLED
void SceneTree::set_edited_scene_root(Node *p_node) {
+#ifdef TOOLS_ENABLED
edited_scene_root = p_node;
+#endif
}
Node *SceneTree::get_edited_scene_root() const {
+#ifdef TOOLS_ENABLED
return edited_scene_root;
-}
+#else
+ return NULL;
#endif
+}
void SceneTree::set_current_scene(Node *p_scene) {
@@ -1664,70 +1668,70 @@ void SceneTree::_server_disconnected() {
emit_signal("server_disconnected");
}
-Ref<MultiplayerAPI> SceneTree::get_multiplayer_api() const {
- return multiplayer_api;
+Ref<MultiplayerAPI> SceneTree::get_multiplayer() const {
+ return multiplayer;
}
-void SceneTree::set_multiplayer_api(Ref<MultiplayerAPI> p_multiplayer_api) {
- ERR_FAIL_COND(!p_multiplayer_api.is_valid());
+void SceneTree::set_multiplayer(Ref<MultiplayerAPI> p_multiplayer) {
+ ERR_FAIL_COND(!p_multiplayer.is_valid());
- if (multiplayer_api.is_valid()) {
- multiplayer_api->disconnect("network_peer_connected", this, "_network_peer_connected");
- multiplayer_api->disconnect("network_peer_disconnected", this, "_network_peer_disconnected");
- multiplayer_api->disconnect("connected_to_server", this, "_connected_to_server");
- multiplayer_api->disconnect("connection_failed", this, "_connection_failed");
- multiplayer_api->disconnect("server_disconnected", this, "_server_disconnected");
+ if (multiplayer.is_valid()) {
+ multiplayer->disconnect("network_peer_connected", this, "_network_peer_connected");
+ multiplayer->disconnect("network_peer_disconnected", this, "_network_peer_disconnected");
+ multiplayer->disconnect("connected_to_server", this, "_connected_to_server");
+ multiplayer->disconnect("connection_failed", this, "_connection_failed");
+ multiplayer->disconnect("server_disconnected", this, "_server_disconnected");
}
- multiplayer_api = p_multiplayer_api;
- multiplayer_api->set_root_node(root);
+ multiplayer = p_multiplayer;
+ multiplayer->set_root_node(root);
- multiplayer_api->connect("network_peer_connected", this, "_network_peer_connected");
- multiplayer_api->connect("network_peer_disconnected", this, "_network_peer_disconnected");
- multiplayer_api->connect("connected_to_server", this, "_connected_to_server");
- multiplayer_api->connect("connection_failed", this, "_connection_failed");
- multiplayer_api->connect("server_disconnected", this, "_server_disconnected");
+ multiplayer->connect("network_peer_connected", this, "_network_peer_connected");
+ multiplayer->connect("network_peer_disconnected", this, "_network_peer_disconnected");
+ multiplayer->connect("connected_to_server", this, "_connected_to_server");
+ multiplayer->connect("connection_failed", this, "_connection_failed");
+ multiplayer->connect("server_disconnected", this, "_server_disconnected");
}
void SceneTree::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_network_peer) {
- multiplayer_api->set_network_peer(p_network_peer);
+ multiplayer->set_network_peer(p_network_peer);
}
Ref<NetworkedMultiplayerPeer> SceneTree::get_network_peer() const {
- return multiplayer_api->get_network_peer();
+ return multiplayer->get_network_peer();
}
bool SceneTree::is_network_server() const {
- return multiplayer_api->is_network_server();
+ return multiplayer->is_network_server();
}
bool SceneTree::has_network_peer() const {
- return multiplayer_api->has_network_peer();
+ return multiplayer->has_network_peer();
}
int SceneTree::get_network_unique_id() const {
- return multiplayer_api->get_network_unique_id();
+ return multiplayer->get_network_unique_id();
}
Vector<int> SceneTree::get_network_connected_peers() const {
- return multiplayer_api->get_network_connected_peers();
+ return multiplayer->get_network_connected_peers();
}
int SceneTree::get_rpc_sender_id() const {
- return multiplayer_api->get_rpc_sender_id();
+ return multiplayer->get_rpc_sender_id();
}
void SceneTree::set_refuse_new_network_connections(bool p_refuse) {
- multiplayer_api->set_refuse_new_network_connections(p_refuse);
+ multiplayer->set_refuse_new_network_connections(p_refuse);
}
bool SceneTree::is_refusing_new_network_connections() const {
- return multiplayer_api->is_refusing_new_network_connections();
+ return multiplayer->is_refusing_new_network_connections();
}
void SceneTree::_bind_methods() {
@@ -1745,10 +1749,8 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_debug_navigation_hint", "enable"), &SceneTree::set_debug_navigation_hint);
ClassDB::bind_method(D_METHOD("is_debugging_navigation_hint"), &SceneTree::is_debugging_navigation_hint);
-#ifdef TOOLS_ENABLED
ClassDB::bind_method(D_METHOD("set_edited_scene_root", "scene"), &SceneTree::set_edited_scene_root);
ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &SceneTree::get_edited_scene_root);
-#endif
ClassDB::bind_method(D_METHOD("set_pause", "enable"), &SceneTree::set_pause);
ClassDB::bind_method(D_METHOD("is_paused"), &SceneTree::is_paused);
@@ -1798,8 +1800,8 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("_change_scene"), &SceneTree::_change_scene);
- ClassDB::bind_method(D_METHOD("set_multiplayer_api", "multiplayer_api"), &SceneTree::set_multiplayer_api);
- ClassDB::bind_method(D_METHOD("get_multiplayer_api"), &SceneTree::get_multiplayer_api);
+ ClassDB::bind_method(D_METHOD("set_multiplayer", "multiplayer"), &SceneTree::set_multiplayer);
+ ClassDB::bind_method(D_METHOD("get_multiplayer"), &SceneTree::get_multiplayer);
ClassDB::bind_method(D_METHOD("set_network_peer", "peer"), &SceneTree::set_network_peer);
ClassDB::bind_method(D_METHOD("get_network_peer"), &SceneTree::get_network_peer);
ClassDB::bind_method(D_METHOD("is_network_server"), &SceneTree::is_network_server);
@@ -1823,13 +1825,11 @@ void SceneTree::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "paused"), "set_pause", "is_paused");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "refuse_new_network_connections"), "set_refuse_new_network_connections", "is_refusing_new_network_connections");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_font_oversampling"), "set_use_font_oversampling", "is_using_font_oversampling");
-#ifdef TOOLS_ENABLED
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "edited_scene_root", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_edited_scene_root", "get_edited_scene_root");
-#endif
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "current_scene", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "set_current_scene", "get_current_scene");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "network_peer", PROPERTY_HINT_RESOURCE_TYPE, "NetworkedMultiplayerPeer", 0), "set_network_peer", "get_network_peer");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "root", PROPERTY_HINT_RESOURCE_TYPE, "Node", 0), "", "get_root");
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer_api", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_multiplayer_api", "get_multiplayer_api");
+ ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "multiplayer", PROPERTY_HINT_RESOURCE_TYPE, "MultiplayerAPI", 0), "set_multiplayer", "get_multiplayer");
ADD_SIGNAL(MethodInfo("tree_changed"));
ADD_SIGNAL(MethodInfo("node_added", PropertyInfo(Variant::OBJECT, "node")));
@@ -1934,7 +1934,7 @@ SceneTree::SceneTree() {
root->set_world(Ref<World>(memnew(World)));
// Initialize network state
- set_multiplayer_api(Ref<MultiplayerAPI>(memnew(MultiplayerAPI)));
+ set_multiplayer(Ref<MultiplayerAPI>(memnew(MultiplayerAPI)));
//root->set_world_2d( Ref<World2D>( memnew( World2D )));
root->set_as_audio_listener(true);
diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h
index 203c1d9c9c..6e0156546e 100644
--- a/scene/main/scene_tree.h
+++ b/scene/main/scene_tree.h
@@ -185,7 +185,7 @@ private:
///network///
- Ref<MultiplayerAPI> multiplayer_api;
+ Ref<MultiplayerAPI> multiplayer;
void _network_peer_connected(int p_id);
void _network_peer_disconnected(int p_id);
@@ -390,10 +390,8 @@ public:
//void change_scene(const String& p_path);
//Node *get_loaded_scene();
-#ifdef TOOLS_ENABLED
void set_edited_scene_root(Node *p_node);
Node *get_edited_scene_root() const;
-#endif
void set_current_scene(Node *p_scene);
Node *get_current_scene() const;
@@ -412,8 +410,8 @@ public:
//network API
- Ref<MultiplayerAPI> get_multiplayer_api() const;
- void set_multiplayer_api(Ref<MultiplayerAPI> p_multiplayer_api);
+ Ref<MultiplayerAPI> get_multiplayer() const;
+ void set_multiplayer(Ref<MultiplayerAPI> p_multiplayer);
void set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_network_peer);
Ref<NetworkedMultiplayerPeer> get_network_peer() const;
bool is_network_server() const;
diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp
index ad2cdbfd0f..c285694dfa 100755
--- a/scene/main/timer.cpp
+++ b/scene/main/timer.cpp
@@ -107,7 +107,10 @@ bool Timer::has_autostart() const {
return autostart;
}
-void Timer::start() {
+void Timer::start(float p_time) {
+ if (p_time > 0) {
+ set_wait_time(p_time);
+ }
time_left = wait_time;
_set_process(true);
}
@@ -185,7 +188,7 @@ void Timer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_autostart", "enable"), &Timer::set_autostart);
ClassDB::bind_method(D_METHOD("has_autostart"), &Timer::has_autostart);
- ClassDB::bind_method(D_METHOD("start"), &Timer::start);
+ ClassDB::bind_method(D_METHOD("start", "time_sec"), &Timer::start, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("stop"), &Timer::stop);
ClassDB::bind_method(D_METHOD("set_paused", "paused"), &Timer::set_paused);
diff --git a/scene/main/timer.h b/scene/main/timer.h
index 410d985407..2f42252a7e 100755
--- a/scene/main/timer.h
+++ b/scene/main/timer.h
@@ -64,7 +64,7 @@ public:
void set_autostart(bool p_start);
bool has_autostart() const;
- void start();
+ void start(float p_time = -1);
void stop();
void set_paused(bool p_paused);
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 568a765420..295f131db3 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -189,6 +189,7 @@ Viewport::GUI::GUI() {
tooltip = NULL;
tooltip_popup = NULL;
tooltip_label = NULL;
+ subwindow_visibility_dirty = false;
subwindow_order_dirty = false;
}
@@ -1251,6 +1252,24 @@ void Viewport::warp_mouse(const Vector2 &p_pos) {
Input::get_singleton()->warp_mouse_position(gpos);
}
+void Viewport::_gui_prepare_subwindows() {
+
+ if (gui.subwindow_visibility_dirty) {
+
+ gui.subwindows.clear();
+ for (List<Control *>::Element *E = gui.all_known_subwindows.front(); E; E = E->next()) {
+ if (E->get()->is_visible_in_tree()) {
+ gui.subwindows.push_back(E->get());
+ }
+ }
+
+ gui.subwindow_visibility_dirty = false;
+ gui.subwindow_order_dirty = true;
+ }
+
+ _gui_sort_subwindows();
+}
+
void Viewport::_gui_sort_subwindows() {
if (!gui.subwindow_order_dirty)
@@ -1393,7 +1412,7 @@ void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
Control *Viewport::_gui_find_control(const Point2 &p_global) {
- _gui_sort_subwindows();
+ _gui_prepare_subwindows();
for (List<Control *>::Element *E = gui.subwindows.back(); E; E = E->prev()) {
@@ -2093,8 +2112,14 @@ List<Control *>::Element *Viewport::_gui_add_root_control(Control *p_control) {
List<Control *>::Element *Viewport::_gui_add_subwindow_control(Control *p_control) {
- gui.subwindow_order_dirty = true;
- return gui.subwindows.push_back(p_control);
+ p_control->connect("visibility_changed", this, "_subwindow_visibility_changed");
+
+ if (p_control->is_visible_in_tree()) {
+ gui.subwindow_order_dirty = true;
+ gui.subwindows.push_back(p_control);
+ }
+
+ return gui.all_known_subwindows.push_back(p_control);
}
void Viewport::_gui_set_subwindow_order_dirty() {
@@ -2168,9 +2193,7 @@ void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) {
p_control->set_position(gui.last_mouse_pos);
p_base->get_root_parent_control()->add_child(p_control); //add as child of viewport
p_control->raise();
- if (gui.drag_preview) {
- memdelete(gui.drag_preview);
- }
+
gui.drag_preview = p_control;
}
@@ -2181,7 +2204,17 @@ void Viewport::_gui_remove_root_control(List<Control *>::Element *RI) {
void Viewport::_gui_remove_subwindow_control(List<Control *>::Element *SI) {
- gui.subwindows.erase(SI);
+ ERR_FAIL_COND(!SI);
+
+ Control *control = SI->get();
+
+ control->disconnect("visibility_changed", this, "_subwindow_visibility_changed");
+
+ List<Control *>::Element *E = gui.subwindows.find(control);
+ if (E)
+ gui.subwindows.erase(E);
+
+ gui.all_known_subwindows.erase(SI);
}
void Viewport::_gui_unfocus_control(Control *p_control) {
@@ -2208,7 +2241,7 @@ void Viewport::_gui_hid_control(Control *p_control) {
*/
if (gui.key_focus == p_control)
- gui.key_focus = NULL;
+ _gui_remove_focus();
if (gui.mouse_over == p_control)
gui.mouse_over = NULL;
if (gui.tooltip == p_control)
@@ -2477,6 +2510,16 @@ bool Viewport::is_3d_disabled() const {
return disable_3d;
}
+void Viewport::set_keep_3d_linear(bool p_keep_3d_linear) {
+ keep_3d_linear = p_keep_3d_linear;
+ VS::get_singleton()->viewport_set_keep_3d_linear(viewport, keep_3d_linear);
+}
+
+bool Viewport::get_keep_3d_linear() const {
+
+ return keep_3d_linear;
+}
+
Variant Viewport::gui_get_drag_data() const {
return gui.drag_data;
}
@@ -2660,6 +2703,9 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_disable_3d", "disable"), &Viewport::set_disable_3d);
ClassDB::bind_method(D_METHOD("is_3d_disabled"), &Viewport::is_3d_disabled);
+ ClassDB::bind_method(D_METHOD("set_keep_3d_linear", "keep_3d_linear"), &Viewport::set_keep_3d_linear);
+ ClassDB::bind_method(D_METHOD("get_keep_3d_linear"), &Viewport::get_keep_3d_linear);
+
ClassDB::bind_method(D_METHOD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip);
ClassDB::bind_method(D_METHOD("_gui_remove_focus"), &Viewport::_gui_remove_focus);
ClassDB::bind_method(D_METHOD("_post_gui_grab_click_focus"), &Viewport::_post_gui_grab_click_focus);
@@ -2673,6 +2719,8 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_shadow_atlas_quadrant_subdiv", "quadrant", "subdiv"), &Viewport::set_shadow_atlas_quadrant_subdiv);
ClassDB::bind_method(D_METHOD("get_shadow_atlas_quadrant_subdiv", "quadrant"), &Viewport::get_shadow_atlas_quadrant_subdiv);
+ ClassDB::bind_method(D_METHOD("_subwindow_visibility_changed"), &Viewport::_subwindow_visibility_changed);
+
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "arvr"), "set_use_arvr", "use_arvr");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "size"), "set_size", "get_size");
@@ -2684,6 +2732,7 @@ void Viewport::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x"), "set_msaa", "get_msaa");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hdr"), "set_hdr", "get_hdr");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_3d"), "set_disable_3d", "is_3d_disabled");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "keep_3d_linear"), "set_keep_3d_linear", "get_keep_3d_linear");
ADD_PROPERTY(PropertyInfo(Variant::INT, "usage", PROPERTY_HINT_ENUM, "2D,2D No-Sampling,3D,3D No-Effects"), "set_usage", "get_usage");
ADD_PROPERTY(PropertyInfo(Variant::INT, "debug_draw", PROPERTY_HINT_ENUM, "Disabled,Unshaded,Overdraw,Wireframe"), "set_debug_draw", "get_debug_draw");
ADD_GROUP("Render Target", "render_target_");
@@ -2752,6 +2801,13 @@ void Viewport::_bind_methods() {
BIND_ENUM_CONSTANT(CLEAR_MODE_ONLY_NEXT_FRAME);
}
+void Viewport::_subwindow_visibility_changed() {
+
+ // unfortunately, we don't know the sender, i.e. which subwindow changed;
+ // so we have to check them all.
+ gui.subwindow_visibility_dirty = true;
+}
+
Viewport::Viewport() {
world_2d = Ref<World2D>(memnew(World2D));
@@ -2806,6 +2862,7 @@ Viewport::Viewport() {
disable_input = false;
disable_3d = false;
+ keep_3d_linear = false;
//window tooltip
gui.tooltip_timer = -1;
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 94e49033e0..363414bbad 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -226,6 +226,7 @@ private:
void _update_global_transform();
bool disable_3d;
+ bool keep_3d_linear;
UpdateMode update_mode;
RID texture_rid;
uint32_t texture_flags;
@@ -266,7 +267,9 @@ private:
List<Control *> modal_stack;
Transform2D focus_inv_xform;
bool subwindow_order_dirty;
- List<Control *> subwindows;
+ bool subwindow_visibility_dirty;
+ List<Control *> subwindows; // visible subwindows
+ List<Control *> all_known_subwindows;
bool roots_order_dirty;
List<Control *> roots;
int canvas_sort_index; //for sorting items with canvas as root
@@ -277,6 +280,7 @@ private:
bool disable_input;
void _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
+ void _gui_prepare_subwindows();
void _gui_sort_subwindows();
void _gui_sort_roots();
void _gui_sort_modal_stack();
@@ -433,6 +437,9 @@ public:
void set_disable_3d(bool p_disable);
bool is_3d_disabled() const;
+ void set_keep_3d_linear(bool p_keep_3d_linear);
+ bool get_keep_3d_linear() const;
+
void set_attach_to_screen_rect(const Rect2 &p_rect);
Rect2 get_attach_to_screen_rect() const;
@@ -463,6 +470,8 @@ public:
void set_snap_controls_to_pixels(bool p_enable);
bool is_snap_controls_to_pixels_enabled() const;
+ void _subwindow_visibility_changed();
+
Viewport();
~Viewport();
};
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index d94b32afd7..7533fa5f6c 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -390,6 +390,7 @@ void register_scene_types() {
ClassDB::register_class<RigidBody>();
ClassDB::register_class<KinematicCollision>();
ClassDB::register_class<KinematicBody>();
+ ClassDB::register_class<PhysicalBone>();
ClassDB::register_class<VehicleBody>();
ClassDB::register_class<VehicleWheel>();
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index 5fd6f6c74d..4ec1e8973d 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -806,6 +806,87 @@ float Curve2D::get_bake_interval() const {
return bake_interval;
}
+Vector2 Curve2D::get_closest_point(const Vector2 &p_to_point) const {
+ // Brute force method
+
+ if (baked_cache_dirty)
+ _bake();
+
+ //validate//
+ int pc = baked_point_cache.size();
+ if (pc == 0) {
+ ERR_EXPLAIN("No points in Curve2D");
+ ERR_FAIL_COND_V(pc == 0, Vector2());
+ }
+
+ if (pc == 1)
+ return baked_point_cache.get(0);
+
+ PoolVector2Array::Read r = baked_point_cache.read();
+
+ Vector2 nearest;
+ float nearest_dist = -1.0f;
+
+ for (int i = 0; i < pc - 1; i++) {
+ Vector2 origin = r[i];
+ Vector2 direction = (r[i + 1] - origin) / bake_interval;
+
+ float d = CLAMP((p_to_point - origin).dot(direction), 0.0f, bake_interval);
+ Vector2 proj = origin + direction * d;
+
+ float dist = proj.distance_squared_to(p_to_point);
+
+ if (nearest_dist < 0.0f || dist < nearest_dist) {
+ nearest = proj;
+ nearest_dist = dist;
+ }
+ }
+
+ return nearest;
+}
+
+float Curve2D::get_closest_offset(const Vector2 &p_to_point) const {
+ // Brute force method
+
+ if (baked_cache_dirty)
+ _bake();
+
+ //validate//
+ int pc = baked_point_cache.size();
+ if (pc == 0) {
+ ERR_EXPLAIN("No points in Curve2D");
+ ERR_FAIL_COND_V(pc == 0, 0.0f);
+ }
+
+ if (pc == 1)
+ return 0.0f;
+
+ PoolVector2Array::Read r = baked_point_cache.read();
+
+ float nearest = 0.0f;
+ float nearest_dist = -1.0f;
+ float offset = 0.0f;
+
+ for (int i = 0; i < pc - 1; i++) {
+ Vector2 origin = r[i];
+ Vector2 direction = (r[i + 1] - origin) / bake_interval;
+
+ float d = CLAMP((p_to_point - origin).dot(direction), 0.0f, bake_interval);
+ Vector2 proj = origin + direction * d;
+
+ float dist = proj.distance_squared_to(p_to_point);
+
+ if (nearest_dist < 0.0f || dist < nearest_dist) {
+ nearest = offset + d;
+ nearest_dist = dist;
+ }
+
+ offset += bake_interval;
+ }
+
+ return nearest;
+}
+
Dictionary Curve2D::_get_data() const {
Dictionary dc;
@@ -909,6 +990,8 @@ void Curve2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_baked_length"), &Curve2D::get_baked_length);
ClassDB::bind_method(D_METHOD("interpolate_baked", "offset", "cubic"), &Curve2D::interpolate_baked, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_baked_points"), &Curve2D::get_baked_points);
+ ClassDB::bind_method(D_METHOD("get_closest_point", "to_point"), &Curve2D::get_closest_point);
+ ClassDB::bind_method(D_METHOD("get_closest_offset", "to_point"), &Curve2D::get_closest_offset);
ClassDB::bind_method(D_METHOD("tessellate", "max_stages", "tolerance_degrees"), &Curve2D::tessellate, DEFVAL(5), DEFVAL(4));
ClassDB::bind_method(D_METHOD("_get_data"), &Curve2D::_get_data);
@@ -1276,6 +1359,87 @@ PoolRealArray Curve3D::get_baked_tilts() const {
return baked_tilt_cache;
}
+Vector3 Curve3D::get_closest_point(const Vector3 &p_to_point) const {
+ // Brute force method
+
+ if (baked_cache_dirty)
+ _bake();
+
+ //validate//
+ int pc = baked_point_cache.size();
+ if (pc == 0) {
+ ERR_EXPLAIN("No points in Curve3D");
+ ERR_FAIL_COND_V(pc == 0, Vector3());
+ }
+
+ if (pc == 1)
+ return baked_point_cache.get(0);
+
+ PoolVector3Array::Read r = baked_point_cache.read();
+
+ Vector3 nearest;
+ float nearest_dist = -1.0f;
+
+ for (int i = 0; i < pc - 1; i++) {
+ Vector3 origin = r[i];
+ Vector3 direction = (r[i + 1] - origin) / bake_interval;
+
+ float d = CLAMP((p_to_point - origin).dot(direction), 0.0f, bake_interval);
+ Vector3 proj = origin + direction * d;
+
+ float dist = proj.distance_squared_to(p_to_point);
+
+ if (nearest_dist < 0.0f || dist < nearest_dist) {
+ nearest = proj;
+ nearest_dist = dist;
+ }
+ }
+
+ return nearest;
+}
+
+float Curve3D::get_closest_offset(const Vector3 &p_to_point) const {
+ // Brute force method
+
+ if (baked_cache_dirty)
+ _bake();
+
+ //validate//
+ int pc = baked_point_cache.size();
+ if (pc == 0) {
+ ERR_EXPLAIN("No points in Curve3D");
+ ERR_FAIL_COND_V(pc == 0, 0.0f);
+ }
+
+ if (pc == 1)
+ return 0.0f;
+
+ PoolVector3Array::Read r = baked_point_cache.read();
+
+ float nearest = 0.0f;
+ float nearest_dist = -1.0f;
+ float offset = 0.0f;
+
+ for (int i = 0; i < pc - 1; i++) {
+ Vector3 origin = r[i];
+ Vector3 direction = (r[i + 1] - origin) / bake_interval;
+
+ float d = CLAMP((p_to_point - origin).dot(direction), 0.0f, bake_interval);
+ Vector3 proj = origin + direction * d;
+
+ float dist = proj.distance_squared_to(p_to_point);
+
+ if (nearest_dist < 0.0f || dist < nearest_dist) {
+ nearest = offset + d;
+ nearest_dist = dist;
+ }
+
+ offset += bake_interval;
+ }
+
+ return nearest;
+}
+
void Curve3D::set_bake_interval(float p_tolerance) {
bake_interval = p_tolerance;
@@ -1404,6 +1568,8 @@ void Curve3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("interpolate_baked", "offset", "cubic"), &Curve3D::interpolate_baked, DEFVAL(false));
ClassDB::bind_method(D_METHOD("get_baked_points"), &Curve3D::get_baked_points);
ClassDB::bind_method(D_METHOD("get_baked_tilts"), &Curve3D::get_baked_tilts);
+ ClassDB::bind_method(D_METHOD("get_closest_point", "to_point"), &Curve3D::get_closest_point);
+ ClassDB::bind_method(D_METHOD("get_closest_offset", "to_point"), &Curve3D::get_closest_offset);
ClassDB::bind_method(D_METHOD("tessellate", "max_stages", "tolerance_degrees"), &Curve3D::tessellate, DEFVAL(5), DEFVAL(4));
ClassDB::bind_method(D_METHOD("_get_data"), &Curve3D::_get_data);
diff --git a/scene/resources/curve.h b/scene/resources/curve.h
index 4f55e4055c..492eb05d1e 100644
--- a/scene/resources/curve.h
+++ b/scene/resources/curve.h
@@ -199,6 +199,8 @@ public:
float get_baked_length() const;
Vector2 interpolate_baked(float p_offset, bool p_cubic = false) const;
PoolVector2Array get_baked_points() const; //useful for going through
+ Vector2 get_closest_point(const Vector2 &p_to_point) const;
+ float get_closest_offset(const Vector2 &p_to_point) const;
PoolVector2Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
@@ -268,6 +270,8 @@ public:
float interpolate_baked_tilt(float p_offset) const;
PoolVector3Array get_baked_points() const; //useful for going through
PoolRealArray get_baked_tilts() const; //useful for going through
+ Vector3 get_closest_point(const Vector3 &p_to_point) const;
+ float get_closest_offset(const Vector3 &p_to_point) const;
PoolVector3Array tessellate(int p_max_stages = 5, float p_tolerance = 4) const; //useful for display
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index ea70797530..5ac9344f31 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -415,6 +415,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_color", "Label", Color(1, 1, 1));
theme->set_color("font_color_shadow", "Label", Color(0, 0, 0, 0));
+ theme->set_color("font_outline_modulate", "Label", Color(1, 1, 1));
theme->set_constant("shadow_offset_x", "Label", 1 * scale);
theme->set_constant("shadow_offset_y", "Label", 1 * scale);
@@ -818,6 +819,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_color_selected", "RichTextLabel", font_color_selection);
theme->set_color("selection_color", "RichTextLabel", Color(0.1, 0.1, 1, 0.8));
+ theme->set_color("font_color_shadow", "RichTextLabel", Color(0, 0, 0, 0));
+
+ theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * scale);
+ theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * scale);
+ theme->set_constant("shadow_as_outline", "RichTextLabel", 0 * scale);
+
theme->set_constant("line_separation", "RichTextLabel", 1 * scale);
theme->set_constant("table_hseparation", "RichTextLabel", 3 * scale);
theme->set_constant("table_vseparation", "RichTextLabel", 3 * scale);
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 26e29b3ccb..f0870349d9 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -33,8 +33,12 @@
#include "os/file_access.h"
#include "os/os.h"
-bool DynamicFontData::CacheID::operator<(CacheID right) const {
+#include FT_STROKER_H
+
+#define __STDC_LIMIT_MACROS
+#include <stdint.h>
+bool DynamicFontData::CacheID::operator<(CacheID right) const {
return key < right.key;
}
@@ -212,8 +216,8 @@ Error DynamicFontAtSize::_load() {
error = FT_Set_Pixel_Sizes(face, 0, id.size * oversampling);
}
- ascent = (face->size->metrics.ascender >> 6) / oversampling * scale_color_font;
- descent = (-face->size->metrics.descender >> 6) / oversampling * scale_color_font;
+ ascent = (face->size->metrics.ascender / 64.0) / oversampling * scale_color_font;
+ descent = (-face->size->metrics.descender / 64.0) / oversampling * scale_color_font;
linegap = 0;
texture_flags = 0;
if (id.mipmaps)
@@ -241,18 +245,11 @@ float DynamicFontAtSize::get_descent() const {
return descent;
}
-Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const {
+const Pair<const DynamicFontAtSize::Character *, DynamicFontAtSize *> DynamicFontAtSize::_find_char_with_font(CharType p_char, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const {
+ const Character *chr = char_map.getptr(p_char);
+ ERR_FAIL_COND_V(!chr, (Pair<const Character *, DynamicFontAtSize *>(NULL, NULL)));
- if (!valid)
- return Size2(1, 1);
- const_cast<DynamicFontAtSize *>(this)->_update_char(p_char);
-
- const Character *c = char_map.getptr(p_char);
- ERR_FAIL_COND_V(!c, Size2());
-
- Size2 ret(0, get_height());
-
- if (!c->found) {
+ if (!chr->found) {
//not found, try in fallbacks
for (int i = 0; i < p_fallbacks.size(); i++) {
@@ -262,52 +259,56 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const V
continue;
fb->_update_char(p_char);
- const Character *ch = fb->char_map.getptr(p_char);
- ERR_CONTINUE(!ch);
+ const Character *fallback_chr = fb->char_map.getptr(p_char);
+ ERR_CONTINUE(!fallback_chr);
- if (!ch->found)
+ if (!fallback_chr->found)
continue;
- c = ch;
- break;
+ return Pair<const Character *, DynamicFontAtSize *>(fallback_chr, fb);
}
- //not found, try 0xFFFD to display 'not found'.
- if (!c->found) {
-
- const_cast<DynamicFontAtSize *>(this)->_update_char(0xFFFD);
- c = char_map.getptr(0xFFFD);
- ERR_FAIL_COND_V(!c, Size2());
- }
+ //not found, try 0xFFFD to display 'not found'.
+ const_cast<DynamicFontAtSize *>(this)->_update_char(0xFFFD);
+ chr = char_map.getptr(0xFFFD);
+ ERR_FAIL_COND_V(!chr, (Pair<const Character *, DynamicFontAtSize *>(NULL, NULL)));
}
- if (c->found) {
- ret.x = c->advance;
- }
+ return Pair<const Character *, DynamicFontAtSize *>(chr, const_cast<DynamicFontAtSize *>(this));
+}
+
+float DynamicFontAtSize::_get_kerning_advance(const DynamicFontAtSize *font, CharType p_char, CharType p_next) const {
+ float advance = 0.0;
if (p_next) {
FT_Vector delta;
- FT_Get_Kerning(face, p_char, p_next, FT_KERNING_DEFAULT, &delta);
+ FT_Get_Kerning(font->face, p_char, p_next, FT_KERNING_DEFAULT, &delta);
+ advance = (delta.x / 64.0) / oversampling;
+ }
+
+ return advance;
+}
- if (delta.x == 0) {
- for (int i = 0; i < p_fallbacks.size(); i++) {
+Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const {
- DynamicFontAtSize *fb = const_cast<DynamicFontAtSize *>(p_fallbacks[i].ptr());
- if (!fb->valid)
- continue;
+ if (!valid)
+ return Size2(1, 1);
+ const_cast<DynamicFontAtSize *>(this)->_update_char(p_char);
- FT_Get_Kerning(fb->face, p_char, p_next, FT_KERNING_DEFAULT, &delta);
+ Pair<const Character *, DynamicFontAtSize *> char_pair_with_font = _find_char_with_font(p_char, p_fallbacks);
+ const Character *ch = char_pair_with_font.first;
+ DynamicFontAtSize *font = char_pair_with_font.second;
+ ERR_FAIL_COND_V(!ch, Size2());
- if (delta.x == 0)
- continue;
+ Size2 ret(0, get_height());
- ret.x += (delta.x >> 6) / oversampling;
- break;
- }
- } else {
- ret.x += (delta.x >> 6) / oversampling;
- }
+ if (ch->found) {
+ ret.x = ch->advance;
}
+ ret.x += _get_kerning_advance(font, p_char, p_next);
+
+ // ensures oversampled glyphs will have enough space when this value is used by clipping/wrapping algorithms
+ ret.x = Math::ceil(ret.x);
return ret;
}
@@ -321,102 +322,42 @@ void DynamicFontAtSize::set_texture_flags(uint32_t p_flags) {
}
}
-float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const {
+float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks, bool p_advance_only) const {
if (!valid)
return 0;
const_cast<DynamicFontAtSize *>(this)->_update_char(p_char);
- const Character *c = char_map.getptr(p_char);
+ Pair<const Character *, DynamicFontAtSize *> char_pair_with_font = _find_char_with_font(p_char, p_fallbacks);
+ const Character *ch = char_pair_with_font.first;
+ DynamicFontAtSize *font = char_pair_with_font.second;
- float advance = 0;
+ ERR_FAIL_COND_V(!ch, 0.0);
- if (!c->found) {
+ float advance = 0.0;
- //not found, try in fallbacks
- bool used_fallback = false;
-
- for (int i = 0; i < p_fallbacks.size(); i++) {
+ if (ch->found) {
+ ERR_FAIL_COND_V(ch->texture_idx < -1 || ch->texture_idx >= font->textures.size(), 0);
- DynamicFontAtSize *fb = const_cast<DynamicFontAtSize *>(p_fallbacks[i].ptr());
- if (!fb->valid)
- continue;
-
- fb->_update_char(p_char);
- const Character *ch = fb->char_map.getptr(p_char);
- ERR_CONTINUE(!ch);
-
- if (!ch->found)
- continue;
+ if (!p_advance_only && ch->texture_idx != -1) {
Point2 cpos = p_pos;
cpos.x += ch->h_align;
- cpos.y -= fb->get_ascent();
+ cpos.y -= font->get_ascent();
cpos.y += ch->v_align;
- ERR_FAIL_COND_V(ch->texture_idx < -1 || ch->texture_idx >= fb->textures.size(), 0);
- if (ch->texture_idx != -1) {
- Color modulate = p_modulate;
- if (FT_HAS_COLOR(fb->face)) {
- modulate.r = modulate.g = modulate.b = 1;
- }
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size * Vector2(fb->scale_color_font, fb->scale_color_font)), fb->textures[ch->texture_idx].texture->get_rid(), ch->rect_uv, modulate, false, RID(), false);
- }
- advance = ch->advance;
- used_fallback = true;
- break;
- }
- //not found, try 0xFFFD to display 'not found'.
-
- if (!used_fallback) {
-
- const_cast<DynamicFontAtSize *>(this)->_update_char(0xFFFD);
- c = char_map.getptr(0xFFFD);
- }
- }
-
- if (c->found) {
-
- Point2 cpos = p_pos;
- cpos.x += c->h_align;
- cpos.y -= get_ascent();
- cpos.y += c->v_align;
- ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
- if (c->texture_idx != -1) {
Color modulate = p_modulate;
if (FT_HAS_COLOR(face)) {
- modulate.r = modulate.g = modulate.b = 1;
+ modulate.r = modulate.g = modulate.b = 1.0;
}
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size * Vector2(scale_color_font, scale_color_font)), textures[c->texture_idx].texture->get_rid(), c->rect_uv, modulate, false, RID(), false);
+ RID texture = font->textures[ch->texture_idx].texture->get_rid();
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, ch->rect.size * Vector2(font->scale_color_font, font->scale_color_font)), texture, ch->rect_uv, modulate, false, RID(), false);
}
- advance = c->advance;
- //textures[c->texture_idx].texture->draw(p_canvas_item,Vector2());
- }
- if (p_next) {
-
- FT_Vector delta;
- FT_Get_Kerning(face, p_char, p_next, FT_KERNING_DEFAULT, &delta);
-
- if (delta.x == 0) {
- for (int i = 0; i < p_fallbacks.size(); i++) {
-
- DynamicFontAtSize *fb = const_cast<DynamicFontAtSize *>(p_fallbacks[i].ptr());
- if (!fb->valid)
- continue;
-
- FT_Get_Kerning(fb->face, p_char, p_next, FT_KERNING_DEFAULT, &delta);
-
- if (delta.x == 0)
- continue;
-
- advance += (delta.x >> 6) / oversampling;
- break;
- }
- } else {
- advance += (delta.x >> 6) / oversampling;
- }
+ advance = ch->advance;
}
+ advance += _get_kerning_advance(font, p_char, p_next);
+
return advance;
}
@@ -440,96 +381,37 @@ void DynamicFontAtSize::_ft_stream_close(FT_Stream stream) {
memdelete(f);
}
-void DynamicFontAtSize::_update_char(CharType p_char) {
-
- if (char_map.has(p_char))
- return;
-
- _THREAD_SAFE_METHOD_
-
- FT_GlyphSlot slot = face->glyph;
-
- if (FT_Get_Char_Index(face, p_char) == 0) {
- //not found
- Character ch;
- ch.texture_idx = -1;
- ch.advance = 0;
- ch.h_align = 0;
- ch.v_align = 0;
- ch.found = false;
-
- char_map[p_char] = ch;
- return;
- }
-
- int ft_hinting;
-
- switch (font->hinting) {
- case DynamicFontData::HINTING_NONE:
- ft_hinting = FT_LOAD_NO_HINTING;
- break;
- case DynamicFontData::HINTING_LIGHT:
- ft_hinting = FT_LOAD_TARGET_LIGHT;
- break;
- default:
- ft_hinting = FT_LOAD_TARGET_NORMAL;
- break;
- }
-
- int error = FT_Load_Char(face, p_char, FT_HAS_COLOR(face) ? FT_LOAD_COLOR : FT_LOAD_DEFAULT | (font->force_autohinter ? FT_LOAD_FORCE_AUTOHINT : 0) | ft_hinting);
- if (!error) {
- error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
- }
- if (error) {
-
- int advance = 0;
- Character ch;
- ch.texture_idx = -1;
- ch.advance = advance;
- ch.h_align = 0;
- ch.v_align = 0;
- ch.found = false;
-
- char_map[p_char] = ch;
-
- return;
- }
-
- int w = slot->bitmap.width;
- int h = slot->bitmap.rows;
- int yofs = slot->bitmap_top;
- int xofs = slot->bitmap_left;
- int advance = slot->advance.x >> 6;
-
- int mw = w + rect_margin * 2;
- int mh = h + rect_margin * 2;
-
- if (mw > 4096 || mh > 4096) {
-
- ERR_FAIL_COND(mw > 4096);
- ERR_FAIL_COND(mh > 4096);
- }
+DynamicFontAtSize::Character DynamicFontAtSize::Character::not_found() {
+ Character ch;
+ ch.texture_idx = -1;
+ ch.advance = 0;
+ ch.h_align = 0;
+ ch.v_align = 0;
+ ch.found = false;
+ return ch;
+}
- //find a texture to fit this...
+DynamicFontAtSize::TexturePosition DynamicFontAtSize::_find_texture_pos_for_glyph(int p_color_size, Image::Format p_image_format, int p_width, int p_height) {
+ TexturePosition ret;
+ ret.index = -1;
+ ret.x = 0;
+ ret.y = 0;
- int color_size = slot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA ? 4 : 2;
- Image::Format require_format = color_size == 4 ? Image::FORMAT_RGBA8 : Image::FORMAT_LA8;
- int tex_index = -1;
- int tex_x = 0;
- int tex_y = 0;
+ int mw = p_width;
+ int mh = p_height;
for (int i = 0; i < textures.size(); i++) {
CharTexture &ct = textures[i];
- if (ct.texture->get_format() != require_format)
+ if (ct.texture->get_format() != p_image_format)
continue;
if (mw > ct.texture_size || mh > ct.texture_size) //too big for this texture
continue;
- tex_y = 0x7FFFFFFF;
- tex_x = 0;
+ ret.y = 0x7FFFFFFF;
+ ret.x = 0;
for (int j = 0; j < ct.texture_size - mw; j++) {
@@ -542,25 +424,27 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
max_y = y;
}
- if (max_y < tex_y) {
- tex_y = max_y;
- tex_x = j;
+ if (max_y < ret.y) {
+ ret.y = max_y;
+ ret.x = j;
}
}
- if (tex_y == 0x7FFFFFFF || tex_y + mh > ct.texture_size)
+ if (ret.y == 0x7FFFFFFF || ret.y + mh > ct.texture_size)
continue; //fail, could not fit it here
- tex_index = i;
+ ret.index = i;
break;
}
- if (tex_index == -1) {
+ //print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y));
+
+ if (ret.index == -1) {
//could not find texture to fit, create one
- tex_x = 0;
- tex_y = 0;
+ ret.x = 0;
+ ret.y = 0;
- int texsize = MAX(id.size * 8, 256);
+ int texsize = MAX(id.size * oversampling * 8, 256);
if (mw > texsize)
texsize = mw; //special case, adapt to it?
if (mh > texsize)
@@ -572,13 +456,13 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
CharTexture tex;
tex.texture_size = texsize;
- tex.imgdata.resize(texsize * texsize * color_size);
+ tex.imgdata.resize(texsize * texsize * p_color_size); //grayscale alpha
{
//zero texture
PoolVector<uint8_t>::Write w = tex.imgdata.write();
- ERR_FAIL_COND(texsize * texsize * color_size > tex.imgdata.size());
- for (int i = 0; i < texsize * texsize * color_size; i++) {
+ ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.imgdata.size(), ret);
+ for (int i = 0; i < texsize * texsize * p_color_size; i++) {
w[i] = 0;
}
}
@@ -587,12 +471,31 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
tex.offsets[i] = 0;
textures.push_back(tex);
- tex_index = textures.size() - 1;
+ ret.index = textures.size() - 1;
}
+ return ret;
+}
+
+DynamicFontAtSize::Character DynamicFontAtSize::_bitmap_to_character(FT_Bitmap bitmap, int yofs, int xofs, float advance) {
+ int w = bitmap.width;
+ int h = bitmap.rows;
+
+ int mw = w + rect_margin * 2;
+ int mh = h + rect_margin * 2;
+
+ ERR_FAIL_COND_V(mw > 4096, Character::not_found());
+ ERR_FAIL_COND_V(mh > 4096, Character::not_found());
+
+ int color_size = bitmap.pixel_mode == FT_PIXEL_MODE_BGRA ? 4 : 2;
+ Image::Format require_format = color_size == 4 ? Image::FORMAT_RGBA8 : Image::FORMAT_LA8;
+
+ TexturePosition tex_pos = _find_texture_pos_for_glyph(color_size, require_format, mw, mh);
+ ERR_FAIL_COND_V(tex_pos.index < 0, Character::not_found());
+
//fit character in char texture
- CharTexture &tex = textures[tex_index];
+ CharTexture &tex = textures[tex_pos.index];
{
PoolVector<uint8_t>::Write wr = tex.imgdata.write();
@@ -600,30 +503,30 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
- int ofs = ((i + tex_y + rect_margin) * tex.texture_size + j + tex_x + rect_margin) * color_size;
- ERR_FAIL_COND(ofs >= tex.imgdata.size());
- switch (slot->bitmap.pixel_mode) {
+ int ofs = ((i + tex_pos.y + rect_margin) * tex.texture_size + j + tex_pos.x + rect_margin) * color_size;
+ ERR_FAIL_COND_V(ofs >= tex.imgdata.size(), Character::not_found());
+ switch (bitmap.pixel_mode) {
case FT_PIXEL_MODE_MONO: {
- int byte = i * slot->bitmap.pitch + (j >> 3);
+ int byte = i * bitmap.pitch + (j >> 3);
int bit = 1 << (7 - (j % 8));
wr[ofs + 0] = 255; //grayscale as 1
- wr[ofs + 1] = slot->bitmap.buffer[byte] & bit ? 255 : 0;
+ wr[ofs + 1] = bitmap.buffer[byte] & bit ? 255 : 0;
} break;
case FT_PIXEL_MODE_GRAY:
wr[ofs + 0] = 255; //grayscale as 1
- wr[ofs + 1] = slot->bitmap.buffer[i * slot->bitmap.pitch + j];
+ wr[ofs + 1] = bitmap.buffer[i * bitmap.pitch + j];
break;
case FT_PIXEL_MODE_BGRA: {
- int ofs_color = i * slot->bitmap.pitch + (j << 2);
- wr[ofs + 2] = slot->bitmap.buffer[ofs_color + 0];
- wr[ofs + 1] = slot->bitmap.buffer[ofs_color + 1];
- wr[ofs + 0] = slot->bitmap.buffer[ofs_color + 2];
- wr[ofs + 3] = slot->bitmap.buffer[ofs_color + 3];
+ int ofs_color = i * bitmap.pitch + (j << 2);
+ wr[ofs + 2] = bitmap.buffer[ofs_color + 0];
+ wr[ofs + 1] = bitmap.buffer[ofs_color + 1];
+ wr[ofs + 0] = bitmap.buffer[ofs_color + 2];
+ wr[ofs + 3] = bitmap.buffer[ofs_color + 3];
} break;
// TODO: FT_PIXEL_MODE_LCD
default:
- ERR_EXPLAIN("Font uses unsupported pixel format: " + itos(slot->bitmap.pixel_mode));
- ERR_FAIL();
+ ERR_EXPLAIN("Font uses unsupported pixel format: " + itos(bitmap.pixel_mode));
+ ERR_FAIL_V(Character::not_found());
break;
}
}
@@ -645,31 +548,105 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
// update height array
- for (int k = tex_x; k < tex_x + mw; k++) {
-
- tex.offsets[k] = tex_y + mh;
+ for (int k = tex_pos.x; k < tex_pos.x + mw; k++) {
+ tex.offsets[k] = tex_pos.y + mh;
}
Character chr;
chr.h_align = xofs * scale_color_font / oversampling;
chr.v_align = ascent - (yofs * scale_color_font / oversampling); // + ascent - descent;
chr.advance = advance * scale_color_font / oversampling;
- chr.texture_idx = tex_index;
+ chr.texture_idx = tex_pos.index;
chr.found = true;
- chr.rect_uv = Rect2(tex_x + rect_margin, tex_y + rect_margin, w, h);
+ chr.rect_uv = Rect2(tex_pos.x + rect_margin, tex_pos.y + rect_margin, w, h);
chr.rect = chr.rect_uv;
chr.rect.position /= oversampling;
- chr.rect.size /= oversampling;
+ chr.rect.size = chr.rect.size * scale_color_font / oversampling;
+ return chr;
+}
+
+DynamicFontAtSize::Character DynamicFontAtSize::_make_outline_char(CharType p_char) {
+ Character ret = Character::not_found();
- char_map[p_char] = chr;
+ if (FT_Load_Char(face, p_char, FT_LOAD_NO_BITMAP | (font->force_autohinter ? FT_LOAD_FORCE_AUTOHINT : 0)) != 0)
+ return ret;
+
+ FT_Stroker stroker;
+ if (FT_Stroker_New(library, &stroker) != 0)
+ return ret;
+
+ FT_Stroker_Set(stroker, (int)(id.outline_size * oversampling * 64.0), FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, 0);
+ FT_Glyph glyph;
+ FT_BitmapGlyph glyph_bitmap;
+
+ if (FT_Get_Glyph(face->glyph, &glyph) != 0)
+ goto cleanup_stroker;
+ if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0)
+ goto cleanup_glyph;
+ if (FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL, 0, 1) != 0)
+ goto cleanup_glyph;
+
+ glyph_bitmap = (FT_BitmapGlyph)glyph;
+ ret = _bitmap_to_character(glyph_bitmap->bitmap, glyph_bitmap->top, glyph_bitmap->left, glyph->advance.x / 65536.0);
+
+cleanup_glyph:
+ FT_Done_Glyph(glyph);
+cleanup_stroker:
+ FT_Stroker_Done(stroker);
+ return ret;
}
-bool DynamicFontAtSize::update_oversampling() {
- if (oversampling == font_oversampling)
- return false;
- if (!valid)
- return false;
+void DynamicFontAtSize::_update_char(CharType p_char) {
+
+ if (char_map.has(p_char))
+ return;
+
+ _THREAD_SAFE_METHOD_
+
+ Character character = Character::not_found();
+
+ FT_GlyphSlot slot = face->glyph;
+
+ if (FT_Get_Char_Index(face, p_char) == 0) {
+ char_map[p_char] = character;
+ return;
+ }
+
+ int ft_hinting;
+
+ switch (font->hinting) {
+ case DynamicFontData::HINTING_NONE:
+ ft_hinting = FT_LOAD_NO_HINTING;
+ break;
+ case DynamicFontData::HINTING_LIGHT:
+ ft_hinting = FT_LOAD_TARGET_LIGHT;
+ break;
+ default:
+ ft_hinting = FT_LOAD_TARGET_NORMAL;
+ break;
+ }
+
+ int error = FT_Load_Char(face, p_char, FT_HAS_COLOR(face) ? FT_LOAD_COLOR : FT_LOAD_DEFAULT | (font->force_autohinter ? FT_LOAD_FORCE_AUTOHINT : 0));
+ if (error) {
+ char_map[p_char] = character;
+ return;
+ }
+
+ if (id.outline_size > 0) {
+ character = _make_outline_char(p_char);
+ } else {
+ error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
+ if (!error)
+ character = _bitmap_to_character(slot->bitmap, slot->bitmap_top, slot->bitmap_left, slot->advance.x / 64.0);
+ }
+
+ char_map[p_char] = character;
+}
+
+void DynamicFontAtSize::update_oversampling() {
+ if (oversampling == font_oversampling || !valid)
+ return;
FT_Done_FreeType(library);
textures.clear();
@@ -677,8 +654,6 @@ bool DynamicFontAtSize::update_oversampling() {
oversampling = font_oversampling;
valid = false;
_load();
-
- return true;
}
DynamicFontAtSize::DynamicFontAtSize() {
@@ -707,11 +682,27 @@ DynamicFontAtSize::~DynamicFontAtSize() {
void DynamicFont::_reload_cache() {
ERR_FAIL_COND(cache_id.size < 1);
- if (!data.is_valid())
+ if (!data.is_valid()) {
+ data_at_size.unref();
+ outline_data_at_size.unref();
+ fallback_data_at_size.resize(0);
+ fallback_outline_data_at_size.resize(0);
return;
+ }
+
data_at_size = data->_get_dynamic_font_at_size(cache_id);
+ if (outline_cache_id.outline_size > 0) {
+ outline_data_at_size = data->_get_dynamic_font_at_size(outline_cache_id);
+ fallback_outline_data_at_size.resize(fallback_data_at_size.size());
+ } else {
+ outline_data_at_size.unref();
+ fallback_outline_data_at_size.resize(0);
+ }
+
for (int i = 0; i < fallbacks.size(); i++) {
fallback_data_at_size[i] = fallbacks[i]->_get_dynamic_font_at_size(cache_id);
+ if (outline_cache_id.outline_size > 0)
+ fallback_outline_data_at_size[i] = fallbacks[i]->_get_dynamic_font_at_size(outline_cache_id);
}
emit_changed();
@@ -721,12 +712,10 @@ void DynamicFont::_reload_cache() {
void DynamicFont::set_font_data(const Ref<DynamicFontData> &p_data) {
data = p_data;
- if (data.is_valid())
- data_at_size = data->_get_dynamic_font_at_size(cache_id);
- else
- data_at_size = Ref<DynamicFontAtSize>();
+ _reload_cache();
emit_changed();
+ _change_notify();
}
Ref<DynamicFontData> DynamicFont::get_font_data() const {
@@ -739,6 +728,7 @@ void DynamicFont::set_size(int p_size) {
if (cache_id.size == p_size)
return;
cache_id.size = p_size;
+ outline_cache_id.size = p_size;
_reload_cache();
}
@@ -747,6 +737,30 @@ int DynamicFont::get_size() const {
return cache_id.size;
}
+void DynamicFont::set_outline_size(int p_size) {
+ if (outline_cache_id.outline_size == p_size)
+ return;
+ ERR_FAIL_COND(p_size < 0 || p_size > UINT8_MAX);
+ outline_cache_id.outline_size = p_size;
+ _reload_cache();
+}
+
+int DynamicFont::get_outline_size() const {
+ return outline_cache_id.outline_size;
+}
+
+void DynamicFont::set_outline_color(Color p_color) {
+ if (p_color != outline_color) {
+ outline_color = p_color;
+ emit_changed();
+ _change_notify();
+ }
+}
+
+Color DynamicFont::get_outline_color() const {
+ return outline_color;
+}
+
bool DynamicFont::get_use_mipmaps() const {
return cache_id.mipmaps;
@@ -757,6 +771,7 @@ void DynamicFont::set_use_mipmaps(bool p_enable) {
if (cache_id.mipmaps == p_enable)
return;
cache_id.mipmaps = p_enable;
+ outline_cache_id.mipmaps = p_enable;
_reload_cache();
}
@@ -770,6 +785,7 @@ void DynamicFont::set_use_filter(bool p_enable) {
if (cache_id.filter == p_enable)
return;
cache_id.filter = p_enable;
+ outline_cache_id.filter = p_enable;
_reload_cache();
}
@@ -859,13 +875,24 @@ bool DynamicFont::is_distance_field_hint() const {
return false;
}
-float DynamicFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate) const {
+bool DynamicFont::has_outline() const {
+ return outline_cache_id.outline_size > 0;
+}
+
+float DynamicFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, bool p_outline) const {
+ const Ref<DynamicFontAtSize> &font_at_size = p_outline && outline_cache_id.outline_size > 0 ? outline_data_at_size : data_at_size;
- if (!data_at_size.is_valid())
+ if (!font_at_size.is_valid())
return 0;
- return data_at_size->draw_char(p_canvas_item, p_pos, p_char, p_next, p_modulate, fallback_data_at_size) + spacing_char;
+ const Vector<Ref<DynamicFontAtSize> > &fallbacks = p_outline && outline_cache_id.outline_size > 0 ? fallback_outline_data_at_size : fallback_data_at_size;
+ Color color = p_outline && outline_cache_id.outline_size > 0 ? p_modulate * outline_color : p_modulate;
+
+ // If requested outline draw, but no outline is present, simply return advance without drawing anything
+ bool advance_only = p_outline && outline_cache_id.outline_size == 0;
+ return font_at_size->draw_char(p_canvas_item, p_pos, p_char, p_next, color, fallbacks, advance_only) + spacing_char;
}
+
void DynamicFont::set_fallback(int p_idx, const Ref<DynamicFontData> &p_data) {
ERR_FAIL_COND(p_data.is_null());
@@ -879,6 +906,8 @@ void DynamicFont::add_fallback(const Ref<DynamicFontData> &p_data) {
ERR_FAIL_COND(p_data.is_null());
fallbacks.push_back(p_data);
fallback_data_at_size.push_back(fallbacks[fallbacks.size() - 1]->_get_dynamic_font_at_size(cache_id)); //const..
+ if (outline_cache_id.outline_size > 0)
+ fallback_outline_data_at_size.push_back(fallbacks[fallbacks.size() - 1]->_get_dynamic_font_at_size(outline_cache_id));
_change_notify();
emit_changed();
@@ -963,6 +992,12 @@ void DynamicFont::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_size", "data"), &DynamicFont::set_size);
ClassDB::bind_method(D_METHOD("get_size"), &DynamicFont::get_size);
+ ClassDB::bind_method(D_METHOD("set_outline_size", "size"), &DynamicFont::set_outline_size);
+ ClassDB::bind_method(D_METHOD("get_outline_size"), &DynamicFont::get_outline_size);
+
+ ClassDB::bind_method(D_METHOD("set_outline_color", "color"), &DynamicFont::set_outline_color);
+ ClassDB::bind_method(D_METHOD("get_outline_color"), &DynamicFont::get_outline_color);
+
ClassDB::bind_method(D_METHOD("set_use_mipmaps", "enable"), &DynamicFont::set_use_mipmaps);
ClassDB::bind_method(D_METHOD("get_use_mipmaps"), &DynamicFont::get_use_mipmaps);
ClassDB::bind_method(D_METHOD("set_use_filter", "enable"), &DynamicFont::set_use_filter);
@@ -978,6 +1013,8 @@ void DynamicFont::_bind_methods() {
ADD_GROUP("Settings", "");
ADD_PROPERTY(PropertyInfo(Variant::INT, "size"), "set_size", "get_size");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size"), "set_outline_size", "get_outline_size");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "outline_color"), "set_outline_color", "get_outline_color");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_mipmaps"), "set_use_mipmaps", "get_use_mipmaps");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_filter"), "set_use_filter", "get_use_filter");
ADD_GROUP("Extra Spacing", "extra_spacing");
@@ -1005,6 +1042,7 @@ DynamicFont::DynamicFont() :
spacing_bottom = 0;
spacing_char = 0;
spacing_space = 0;
+ outline_color = Color(1, 1, 1);
if (dynamic_font_mutex)
dynamic_font_mutex->lock();
dynamic_fonts.add(&font_list);
@@ -1040,7 +1078,13 @@ void DynamicFont::update_oversampling() {
SelfList<DynamicFont> *E = dynamic_fonts.first();
while (E) {
- if (E->self()->data_at_size.is_valid() && E->self()->data_at_size->update_oversampling()) {
+ if (E->self()->data_at_size.is_valid()) {
+ E->self()->data_at_size->update_oversampling();
+
+ if (E->self()->outline_data_at_size.is_valid()) {
+ E->self()->outline_data_at_size->update_oversampling();
+ }
+
changed.push_back(Ref<DynamicFont>(E->self()));
}
E = E->next();
diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h
index db8bd87587..f460bca2d4 100644
--- a/scene/resources/dynamic_font.h
+++ b/scene/resources/dynamic_font.h
@@ -35,6 +35,7 @@
#include "io/resource_loader.h"
#include "os/mutex.h"
#include "os/thread_safe.h"
+#include "pair.h"
#include "scene/resources/font.h"
#include <ft2build.h>
@@ -49,10 +50,10 @@ class DynamicFontData : public Resource {
public:
struct CacheID {
-
union {
struct {
uint32_t size : 16;
+ uint32_t outline_size : 8;
bool mipmaps : 1;
bool filter : 1;
};
@@ -148,8 +149,22 @@ class DynamicFontAtSize : public Reference {
texture_idx = 0;
v_align = 0;
}
+
+ static Character not_found();
};
+ struct TexturePosition {
+ int index;
+ int x;
+ int y;
+ };
+
+ const Pair<const Character *, DynamicFontAtSize *> _find_char_with_font(CharType p_char, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const;
+ Character _make_outline_char(CharType p_char);
+ float _get_kerning_advance(const DynamicFontAtSize *font, CharType p_char, CharType p_next) const;
+ TexturePosition _find_texture_pos_for_glyph(int p_color_size, Image::Format p_image_format, int p_width, int p_height);
+ Character _bitmap_to_character(FT_Bitmap bitmap, int yofs, int xofs, float advance);
+
static unsigned long _ft_stream_io(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count);
static void _ft_stream_close(FT_Stream stream);
@@ -174,10 +189,10 @@ public:
Size2 get_char_size(CharType p_char, CharType p_next, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const;
- float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks) const;
+ float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, const Vector<Ref<DynamicFontAtSize> > &p_fallbacks, bool p_advance_only = false) const;
void set_texture_flags(uint32_t p_flags);
- bool update_oversampling();
+ void update_oversampling();
DynamicFontAtSize();
~DynamicFontAtSize();
@@ -200,17 +215,23 @@ public:
private:
Ref<DynamicFontData> data;
Ref<DynamicFontAtSize> data_at_size;
+ Ref<DynamicFontAtSize> outline_data_at_size;
Vector<Ref<DynamicFontData> > fallbacks;
Vector<Ref<DynamicFontAtSize> > fallback_data_at_size;
+ Vector<Ref<DynamicFontAtSize> > fallback_outline_data_at_size;
DynamicFontData::CacheID cache_id;
+ DynamicFontData::CacheID outline_cache_id;
+
bool valid;
int spacing_top;
int spacing_bottom;
int spacing_char;
int spacing_space;
+ Color outline_color;
+
protected:
void _reload_cache();
@@ -227,6 +248,12 @@ public:
void set_size(int p_size);
int get_size() const;
+ void set_outline_size(int p_size);
+ int get_outline_size() const;
+
+ void set_outline_color(Color p_color);
+ Color get_outline_color() const;
+
bool get_use_mipmaps() const;
void set_use_mipmaps(bool p_enable);
@@ -251,7 +278,9 @@ public:
virtual bool is_distance_field_hint() const;
- virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) const;
+ virtual bool has_outline() const;
+
+ virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1), bool p_outline = false) const;
SelfList<DynamicFont> font_list;
diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp
index 098b794a95..29f1106d16 100644
--- a/scene/resources/dynamic_font_stb.cpp
+++ b/scene/resources/dynamic_font_stb.cpp
@@ -162,7 +162,7 @@ Size2 DynamicFontAtSize::get_char_size(CharType p_char, CharType p_next) const {
return ret;
}
-float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate) const {
+float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, bool p_outline) const {
const_cast<DynamicFontAtSize *>(this)->_update_char(p_char);
@@ -172,13 +172,15 @@ float DynamicFontAtSize::draw_char(RID p_canvas_item, const Point2 &p_pos, CharT
return 0;
}
- Point2 cpos = p_pos;
- cpos.x += c->h_align;
- cpos.y -= get_ascent();
- cpos.y += c->v_align;
- ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
- if (c->texture_idx != -1)
- VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx].texture->get_rid(), c->rect, p_modulate);
+ if (!p_outline) {
+ Point2 cpos = p_pos;
+ cpos.x += c->h_align;
+ cpos.y -= get_ascent();
+ cpos.y += c->v_align;
+ ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
+ if (c->texture_idx != -1)
+ VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx].texture->get_rid(), c->rect, p_modulate);
+ }
//textures[c->texture_idx].texture->draw(p_canvas_item,Vector2());
@@ -459,12 +461,12 @@ bool DynamicFont::is_distance_field_hint() const {
return false;
}
-float DynamicFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate) const {
+float DynamicFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, bool p_outline) const {
if (!data_at_size.is_valid())
return 0;
- return data_at_size->draw_char(p_canvas_item, p_pos, p_char, p_next, p_modulate);
+ return data_at_size->draw_char(p_canvas_item, p_pos, p_char, p_next, p_modulate, p_outline);
}
DynamicFont::DynamicFont() {
diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h
index 4c1097d28b..feae29c0c2 100644
--- a/scene/resources/dynamic_font_stb.h
+++ b/scene/resources/dynamic_font_stb.h
@@ -136,7 +136,7 @@ public:
Size2 get_char_size(CharType p_char, CharType p_next = 0) const;
- float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) const;
+ float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1), bool p_outline = false) const;
DynamicFontAtSize();
~DynamicFontAtSize();
@@ -171,7 +171,7 @@ public:
virtual bool is_distance_field_hint() const;
- virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) const;
+ virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1), bool p_outline = false) const;
DynamicFont();
~DynamicFont();
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 6fc5778dd8..0bae9d9b2d 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -32,12 +32,12 @@
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
+#include "method_bind_ext.gen.inc"
-void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, float p_width, const String &p_text, const Color &p_modulate) const {
-
+void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, float p_width, const String &p_text, const Color &p_modulate, const Color &p_outline_modulate) const {
float length = get_string_size(p_text).width;
if (length >= p_width) {
- draw(p_canvas_item, p_pos, p_text, p_modulate, p_width);
+ draw(p_canvas_item, p_pos, p_text, p_modulate, p_width, p_outline_modulate);
return;
}
@@ -56,13 +56,14 @@ void Font::draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, f
ERR_PRINT("Unknown halignment type");
} break;
}
- draw(p_canvas_item, p_pos + Point2(ofs, 0), p_text, p_modulate, p_width);
+ draw(p_canvas_item, p_pos + Point2(ofs, 0), p_text, p_modulate, p_width, p_outline_modulate);
}
-void Font::draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w) const {
-
+void Font::draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate, int p_clip_w, const Color &p_outline_modulate) const {
Vector2 ofs;
+ int chars_drawn = 0;
+ bool with_outline = has_outline();
for (int i = 0; i < p_text.length(); i++) {
int width = get_char_size(p_text[i]).width;
@@ -70,7 +71,15 @@ void Font::draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, co
if (p_clip_w >= 0 && (ofs.x + width) > p_clip_w)
break; //clip
- ofs.x += draw_char(p_canvas_item, p_pos + ofs, p_text[i], p_text[i + 1], p_modulate);
+ ofs.x += draw_char(p_canvas_item, p_pos + ofs, p_text[i], p_text[i + 1], with_outline ? p_outline_modulate : p_modulate, with_outline);
+ ++chars_drawn;
+ }
+
+ if (has_outline()) {
+ ofs = Vector2(0, 0);
+ for (int i = 0; i < chars_drawn; i++) {
+ ofs.x += draw_char(p_canvas_item, p_pos + ofs, p_text[i], p_text[i + 1], p_modulate, false);
+ }
}
}
@@ -81,13 +90,14 @@ void Font::update_changes() {
void Font::_bind_methods() {
- ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "string", "modulate", "clip_w"), &Font::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("draw", "canvas_item", "position", "string", "modulate", "clip_w", "outline_modulate"), &Font::draw, DEFVAL(Color(1, 1, 1)), DEFVAL(-1), DEFVAL(Color(1, 1, 1)));
ClassDB::bind_method(D_METHOD("get_ascent"), &Font::get_ascent);
ClassDB::bind_method(D_METHOD("get_descent"), &Font::get_descent);
ClassDB::bind_method(D_METHOD("get_height"), &Font::get_height);
ClassDB::bind_method(D_METHOD("is_distance_field_hint"), &Font::is_distance_field_hint);
ClassDB::bind_method(D_METHOD("get_string_size", "string"), &Font::get_string_size);
- ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "position", "char", "next", "modulate"), &Font::draw_char, DEFVAL(-1), DEFVAL(Color(1, 1, 1)));
+ ClassDB::bind_method(D_METHOD("has_outline"), &Font::has_outline);
+ ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "position", "char", "next", "modulate", "outline"), &Font::draw_char, DEFVAL(-1), DEFVAL(Color(1, 1, 1)), DEFVAL(false));
ClassDB::bind_method(D_METHOD("update_changes"), &Font::update_changes);
}
@@ -494,23 +504,24 @@ Ref<BitmapFont> BitmapFont::get_fallback() const {
return fallback;
}
-float BitmapFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate) const {
+float BitmapFont::draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next, const Color &p_modulate, bool p_outline) const {
const Character *c = char_map.getptr(p_char);
if (!c) {
if (fallback.is_valid())
- return fallback->draw_char(p_canvas_item, p_pos, p_char, p_next, p_modulate);
+ return fallback->draw_char(p_canvas_item, p_pos, p_char, p_next, p_modulate, p_outline);
return 0;
}
- Point2 cpos = p_pos;
- cpos.x += c->h_align;
- cpos.y -= ascent;
- cpos.y += c->v_align;
ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), 0);
- if (c->texture_idx != -1)
+ if (!p_outline && c->texture_idx != -1) {
+ Point2 cpos = p_pos;
+ cpos.x += c->h_align;
+ cpos.y -= ascent;
+ cpos.y += c->v_align;
VisualServer::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, Rect2(cpos, c->rect.size), textures[c->texture_idx]->get_rid(), c->rect, p_modulate, false, RID(), false);
+ }
return get_char_size(p_char, p_next).width;
}
diff --git a/scene/resources/font.h b/scene/resources/font.h
index ae08890be3..4e295b6035 100644
--- a/scene/resources/font.h
+++ b/scene/resources/font.h
@@ -56,14 +56,55 @@ public:
virtual bool is_distance_field_hint() const = 0;
- void draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1) const;
- void draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, float p_width, const String &p_text, const Color &p_modulate = Color(1, 1, 1)) const;
- virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) const = 0;
+ void draw(RID p_canvas_item, const Point2 &p_pos, const String &p_text, const Color &p_modulate = Color(1, 1, 1), int p_clip_w = -1, const Color &p_outline_modulate = Color(1, 1, 1)) const;
+ void draw_halign(RID p_canvas_item, const Point2 &p_pos, HAlign p_align, float p_width, const String &p_text, const Color &p_modulate = Color(1, 1, 1), const Color &p_outline_modulate = Color(1, 1, 1)) const;
+
+ virtual bool has_outline() const { return false; }
+ virtual float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1), bool p_outline = false) const = 0;
void update_changes();
Font();
};
+// Helper class to that draws outlines immediately and draws characters in its destructor.
+class FontDrawer {
+ const Ref<Font> &font;
+ Color outline_color;
+ bool has_outline;
+
+ struct PendingDraw {
+ RID canvas_item;
+ Point2 pos;
+ CharType chr;
+ CharType next;
+ Color modulate;
+ };
+
+ Vector<PendingDraw> pending_draws;
+
+public:
+ FontDrawer(const Ref<Font> &p_font, const Color &p_outline_color) :
+ font(p_font),
+ outline_color(p_outline_color) {
+ has_outline = p_font->has_outline();
+ }
+
+ float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) {
+ if (has_outline) {
+ PendingDraw draw = { p_canvas_item, p_pos, p_char, p_next, p_modulate };
+ pending_draws.push_back(draw);
+ }
+ return font->draw_char(p_canvas_item, p_pos, p_char, p_next, has_outline ? outline_color : p_modulate, has_outline);
+ }
+
+ ~FontDrawer() {
+ for (int i = 0; i < pending_draws.size(); ++i) {
+ const PendingDraw &draw = pending_draws[i];
+ font->draw_char(draw.canvas_item, draw.pos, draw.chr, draw.next, draw.modulate, false);
+ }
+ }
+};
+
class BitmapFont : public Font {
GDCLASS(BitmapFont, Font);
@@ -153,7 +194,7 @@ public:
void set_distance_field_hint(bool p_distance_field);
bool is_distance_field_hint() const;
- float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1)) const;
+ float draw_char(RID p_canvas_item, const Point2 &p_pos, CharType p_char, CharType p_next = 0, const Color &p_modulate = Color(1, 1, 1), bool p_outline = false) const;
BitmapFont();
~BitmapFont();
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index a83ef198fb..5e7569586a 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -387,10 +387,12 @@ void SpatialMaterial::_update_shader() {
if (flags[FLAG_USE_VERTEX_LIGHTING]) {
code += ",vertex_lighting";
}
-
if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) {
code += ",world_vertex_coords";
}
+ if (flags[FLAG_DONT_RECEIVE_SHADOWS]) {
+ code += ",shadows_disabled";
+ }
code += ";\n";
code += "uniform vec4 albedo : hint_color;\n";
@@ -550,7 +552,7 @@ void SpatialMaterial::_update_shader() {
//handle animation
code += "\tint particle_total_frames = particles_anim_h_frames * particles_anim_v_frames;\n";
- code += "\tint particle_frame = int(INSTANCE_CUSTOM.y * float(particle_total_frames));\n";
+ code += "\tint particle_frame = int(INSTANCE_CUSTOM.z * float(particle_total_frames));\n";
code += "\tif (particles_anim_loop) particle_frame=clamp(particle_frame,0,particle_total_frames-1); else particle_frame=abs(particle_frame)%particle_total_frames;\n";
code += "\tUV /= vec2(float(particles_anim_h_frames),float(particles_anim_v_frames));\n";
code += "\tUV += vec2(float(particle_frame % particles_anim_h_frames) / float(particles_anim_h_frames),float(particle_frame / particles_anim_h_frames) / float(particles_anim_v_frames));\n";
@@ -1849,6 +1851,7 @@ void SpatialMaterial::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_world_triplanar"), "set_flag", "get_flag", FLAG_TRIPLANAR_USE_WORLD);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_fixed_size"), "set_flag", "get_flag", FLAG_FIXED_SIZE);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_albedo_tex_force_srgb"), "set_flag", "get_flag", FLAG_ALBEDO_TEXTURE_FORCE_SRGB);
+ ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "flags_do_not_receive_shadows"), "set_flag", "get_flag", FLAG_DONT_RECEIVE_SHADOWS);
ADD_GROUP("Vertex Color", "vertex_color");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "vertex_color_use_as_albedo"), "set_flag", "get_flag", FLAG_ALBEDO_FROM_VERTEX_COLOR);
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "vertex_color_is_srgb"), "set_flag", "get_flag", FLAG_SRGB_VERTEX_COLOR);
@@ -2038,6 +2041,7 @@ void SpatialMaterial::_bind_methods() {
BIND_ENUM_CONSTANT(FLAG_USE_ALPHA_SCISSOR);
BIND_ENUM_CONSTANT(FLAG_TRIPLANAR_USE_WORLD);
BIND_ENUM_CONSTANT(FLAG_ALBEDO_TEXTURE_FORCE_SRGB);
+ BIND_ENUM_CONSTANT(FLAG_DONT_RECEIVE_SHADOWS);
BIND_ENUM_CONSTANT(FLAG_MAX);
BIND_ENUM_CONSTANT(DIFFUSE_BURLEY);
diff --git a/scene/resources/material.h b/scene/resources/material.h
index 2c297cda41..ce733bfb8d 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -188,6 +188,7 @@ public:
FLAG_EMISSION_ON_UV2,
FLAG_USE_ALPHA_SCISSOR,
FLAG_ALBEDO_TEXTURE_FORCE_SRGB,
+ FLAG_DONT_RECEIVE_SHADOWS,
FLAG_MAX
};
@@ -236,7 +237,7 @@ private:
uint64_t blend_mode : 2;
uint64_t depth_draw_mode : 2;
uint64_t cull_mode : 2;
- uint64_t flags : 14;
+ uint64_t flags : 15;
uint64_t detail_blend_mode : 2;
uint64_t diffuse_mode : 3;
uint64_t specular_mode : 2;
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index d87644381c..b0620d3363 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -222,7 +222,6 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
continue;
Array a = surface_get_arrays(i);
- int vcount = 0;
if (i == 0) {
arrays = a;
@@ -230,6 +229,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const {
index_accum += v.size();
} else {
+ int vcount = 0;
for (int j = 0; j < arrays.size(); j++) {
if (arrays[j].get_type() == Variant::NIL || a[j].get_type() == Variant::NIL) {
@@ -1194,8 +1194,6 @@ Error ArrayMesh::lightmap_unwrap(const Transform &p_base_transform, float p_texe
for (int j = 0; j < 3; j++) {
- int vertex_idx = gen_vertices[gen_indices[i + j]];
-
SurfaceTool::Vertex v = surfaces[surface].vertices[uv_index[gen_vertices[gen_indices[i + j]]].second];
if (surfaces[surface].format & ARRAY_FORMAT_COLOR) {
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 056ac2772b..e0562d9e4a 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -57,6 +57,31 @@ void PrimitiveMesh::_update() const {
}
}
+ if (flip_faces) {
+ PoolVector<Vector3> normals = arr[VS::ARRAY_NORMAL];
+ PoolVector<int> indices = arr[VS::ARRAY_INDEX];
+ if (normals.size() && indices.size()) {
+
+ {
+ int nc = normals.size();
+ PoolVector<Vector3>::Write w = normals.write();
+ for (int i = 0; i < nc; i++) {
+ w[i] = -w[i];
+ }
+ }
+
+ {
+ int ic = indices.size();
+ PoolVector<int>::Write w = indices.write();
+ for (int i = 0; i < ic; i += 3) {
+ SWAP(w[i + 0], w[i + 1]);
+ }
+ }
+ arr[VS::ARRAY_NORMAL] = normals;
+ arr[VS::ARRAY_INDEX] = indices;
+ }
+ }
+
// in with the new
VisualServer::get_singleton()->mesh_clear(mesh);
VisualServer::get_singleton()->mesh_add_surface_from_arrays(mesh, (VisualServer::PrimitiveType)primitive_type, arr);
@@ -166,7 +191,15 @@ void PrimitiveMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_mesh_arrays"), &PrimitiveMesh::get_mesh_arrays);
+ ClassDB::bind_method(D_METHOD("set_custom_aabb", "aabb"), &PrimitiveMesh::set_custom_aabb);
+ ClassDB::bind_method(D_METHOD("get_custom_aabb"), &PrimitiveMesh::get_custom_aabb);
+
+ ClassDB::bind_method(D_METHOD("set_flip_faces", "flip_faces"), &PrimitiveMesh::set_flip_faces);
+ ClassDB::bind_method(D_METHOD("get_flip_faces"), &PrimitiveMesh::get_flip_faces);
+
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "SpatialMaterial,ShaderMaterial"), "set_material", "get_material");
+ ADD_PROPERTY(PropertyInfo(Variant::AABB, "custom_aabb", PROPERTY_HINT_NONE, ""), "set_custom_aabb", "get_custom_aabb");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_faces"), "set_flip_faces", "get_flip_faces");
}
void PrimitiveMesh::set_material(const Ref<Material> &p_material) {
@@ -187,7 +220,30 @@ Array PrimitiveMesh::get_mesh_arrays() const {
return surface_get_arrays(0);
}
+void PrimitiveMesh::set_custom_aabb(const AABB &p_custom) {
+
+ custom_aabb = p_custom;
+ VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb);
+ emit_changed();
+}
+
+AABB PrimitiveMesh::get_custom_aabb() const {
+
+ return custom_aabb;
+}
+
+void PrimitiveMesh::set_flip_faces(bool p_enable) {
+ flip_faces = p_enable;
+ _request_update();
+}
+
+bool PrimitiveMesh::get_flip_faces() const {
+ return flip_faces;
+}
+
PrimitiveMesh::PrimitiveMesh() {
+
+ flip_faces = false;
// defaults
mesh = VisualServer::get_singleton()->mesh_create();
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index 94a7a055a3..a91aa09ffe 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -48,8 +48,10 @@ class PrimitiveMesh : public Mesh {
private:
RID mesh;
mutable AABB aabb;
+ AABB custom_aabb;
Ref<Material> material;
+ bool flip_faces;
mutable bool pending_request;
void _update() const;
@@ -81,6 +83,12 @@ public:
Array get_mesh_arrays() const;
+ void set_custom_aabb(const AABB &p_custom);
+ AABB get_custom_aabb() const;
+
+ void set_flip_faces(bool p_enable);
+ bool get_flip_faces() const;
+
PrimitiveMesh();
~PrimitiveMesh();
};
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index ad5a0fd9ab..7da65ac984 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -186,7 +186,7 @@ Size2 StyleBoxTexture::get_center_size() const {
if (texture.is_null())
return Size2();
- return texture->get_size() - get_minimum_size();
+ return region_rect.size - get_minimum_size();
}
void StyleBoxTexture::set_expand_margin_size(Margin p_expand_margin, float p_size) {
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index fdce0eb2b6..2dc32b893d 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -51,6 +51,7 @@ SceneStringNames::SceneStringNames() {
tree_entered = StaticCString::create("tree_entered");
tree_exiting = StaticCString::create("tree_exiting");
tree_exited = StaticCString::create("tree_exited");
+ ready = StaticCString::create("ready");
item_rect_changed = StaticCString::create("item_rect_changed");
size_flags_changed = StaticCString::create("size_flags_changed");
minimum_size_changed = StaticCString::create("minimum_size_changed");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 63a9a5db4d..2e6da26d68 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -71,6 +71,7 @@ public:
StringName tree_entered;
StringName tree_exiting;
StringName tree_exited;
+ StringName ready;
StringName size_flags_changed;
StringName minimum_size_changed;
StringName sleeping_state_changed;
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 433942708e..2b0eab5999 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -1011,6 +1011,10 @@ void ConcavePolygonShape2DSW::cull(const Rect2 &p_local_aabb, Callback p_callbac
stack[i]=0;
*/
+ if (segments.size() == 0 || points.size() == 0 || bvh.size() == 0) {
+ return;
+ }
+
int level = 0;
const Segment *segmentptr = &segments[0];
diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp
index c29093d1af..503ca0af4a 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -33,6 +33,7 @@
#include "collision_solver_2d_sw.h"
#include "pair.h"
#include "physics_2d_server_sw.h"
+
_FORCE_INLINE_ static bool _can_collide_with(CollisionObject2DSW *p_object, uint32_t p_collision_mask) {
return p_object->get_collision_layer() & p_collision_mask;
diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp
index f01a4c2f64..08af26c24b 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server.cpp
@@ -603,6 +603,8 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS);
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_RESTITUTION);
BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_DAMPING);
+ BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY);
+ BIND_ENUM_CONSTANT(G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_LOWER_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_UPPER_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS);
@@ -616,6 +618,7 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT);
BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_MOTOR);
+ BIND_ENUM_CONSTANT(G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR);
ClassDB::bind_method(D_METHOD("joint_get_type", "joint"), &PhysicsServer::joint_get_type);
diff --git a/servers/physics_server.h b/servers/physics_server.h
index 6a342b36d4..6712bee8dc 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -594,6 +594,8 @@ public:
G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS,
G6DOF_JOINT_LINEAR_RESTITUTION,
G6DOF_JOINT_LINEAR_DAMPING,
+ G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY,
+ G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT,
G6DOF_JOINT_ANGULAR_LOWER_LIMIT,
G6DOF_JOINT_ANGULAR_UPPER_LIMIT,
G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS,
@@ -611,6 +613,7 @@ public:
G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT,
G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT,
G6DOF_JOINT_FLAG_ENABLE_MOTOR,
+ G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR,
G6DOF_JOINT_FLAG_MAX
};
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 8bf112b0de..8d8e9e693e 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -175,6 +175,7 @@ public:
virtual RID texture_create() = 0;
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = VS::TEXTURE_FLAGS_DEFAULT) = 0;
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
+ virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) = 0;
virtual Ref<Image> texture_get_data(RID p_texture, VS::CubeMapSide p_cube_side = VS::CUBEMAP_LEFT) const = 0;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
@@ -325,6 +326,7 @@ public:
virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const = 0;
virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) = 0;
virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const = 0;
+ virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) = 0;
/* Light API */
@@ -513,6 +515,7 @@ public:
RENDER_TARGET_NO_3D,
RENDER_TARGET_NO_SAMPLING,
RENDER_TARGET_HDR,
+ RENDER_TARGET_KEEP_3D_LINEAR,
RENDER_TARGET_FLAG_MAX
};
@@ -735,6 +738,8 @@ public:
Vector<Point2> points;
Vector<Point2> uvs;
Vector<Color> colors;
+ Vector<int> bones;
+ Vector<float> weights;
RID texture;
RID normal_map;
int count;
@@ -812,6 +817,8 @@ public:
mutable bool rect_dirty;
mutable Rect2 rect;
RID material;
+ RID skeleton;
+
Item *next;
struct CopyBackBuffer {
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index bfb9c871ce..d399c548f3 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2207,6 +2207,37 @@ ShaderLanguage::DataType ShaderLanguage::get_scalar_type(DataType p_type) {
return scalar_types[p_type];
}
+int ShaderLanguage::get_cardinality(DataType p_type) {
+ static const int cardinality_table[] = {
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 1,
+ 2,
+ 3,
+ 4,
+ 1,
+ 2,
+ 3,
+ 4,
+ 1,
+ 2,
+ 3,
+ 4,
+ 2,
+ 3,
+ 4,
+ 1,
+ 1,
+ 1,
+ 1,
+ };
+
+ return cardinality_table[p_type];
+}
+
bool ShaderLanguage::_get_completable_identifier(BlockNode *p_block, CompletionType p_type, StringName &identifier) {
identifier = StringName();
@@ -3111,9 +3142,18 @@ ShaderLanguage::Node *ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha
if (get_scalar_type(cn->datatype) == base) {
- for (int j = 0; j < cn->values.size(); j++) {
- values.push_back(cn->values[j]);
- }
+ int cardinality = get_cardinality(op->arguments[i]->get_datatype());
+ if (cn->values.size() == cardinality) {
+
+ for (int j = 0; j < cn->values.size(); j++) {
+ values.push_back(cn->values[j]);
+ }
+ } else if (cn->values.size() == 1) {
+
+ for (int j = 0; j < cardinality; j++) {
+ values.push_back(cn->values[0]);
+ }
+ } // else: should be filtered by the parser as it's an invalid constructor
} else if (get_scalar_type(cn->datatype) == cn->datatype) {
ConstantNode::Value v;
diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h
index 2e3881179a..720511e18d 100644
--- a/servers/visual/shader_language.h
+++ b/servers/visual/shader_language.h
@@ -533,6 +533,7 @@ public:
static bool convert_constant(ConstantNode *p_constant, DataType p_to_type, ConstantNode::Value *p_value = NULL);
static DataType get_scalar_type(DataType p_type);
+ static int get_cardinality(DataType p_type);
static bool is_scalar_type(DataType p_type);
static bool is_sampler_type(DataType p_type);
diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp
index a4053ad415..95193f7a8f 100644
--- a/servers/visual/shader_types.cpp
+++ b/servers/visual/shader_types.cpp
@@ -173,6 +173,8 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_SPATIAL].modes.insert("skip_vertex_transform");
shader_modes[VS::SHADER_SPATIAL].modes.insert("world_vertex_coords");
+ shader_modes[VS::SHADER_SPATIAL].modes.insert("shadows_disabled");
+
shader_modes[VS::SHADER_SPATIAL].modes.insert("vertex_lighting");
/************ CANVAS ITEM **************************/
@@ -231,6 +233,7 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_sub");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_mul");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_premul_alpha");
+ shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_disabled");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("unshaded");
shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("light_only");
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index dd8d07f00d..6439ba8509 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -694,7 +694,7 @@ void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2
canvas_item->commands.push_back(polygon);
}
-void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, int p_count, RID p_normal_map) {
+void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, const Vector<int> &p_bones, const Vector<float> &p_weights, RID p_texture, int p_count, RID p_normal_map) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
@@ -702,6 +702,8 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
int ps = p_points.size();
ERR_FAIL_COND(!p_colors.empty() && p_colors.size() != ps && p_colors.size() != 1);
ERR_FAIL_COND(!p_uvs.empty() && p_uvs.size() != ps);
+ ERR_FAIL_COND(!p_bones.empty() && p_bones.size() != ps * 4);
+ ERR_FAIL_COND(!p_weights.empty() && p_weights.size() != ps * 4);
Vector<int> indices = p_indices;
@@ -726,6 +728,8 @@ void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector
polygon->points = p_points;
polygon->uvs = p_uvs;
polygon->colors = p_colors;
+ polygon->bones = p_bones;
+ polygon->weights = p_weights;
polygon->indices = indices;
polygon->count = count;
polygon->antialiased = false;
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index 6a5a7623b6..4d9398a17e 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -51,8 +51,6 @@ public:
Vector<Item *> child_items;
- RID skeleton;
-
Item() {
children_order_dirty = true;
E = NULL;
@@ -183,7 +181,7 @@ public:
void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, VS::NinePatchAxisMode p_x_axis_mode = VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode = VS::NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID());
void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID());
void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false);
- void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID());
+ void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID());
void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID());
void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID());
void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames);
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index a94e110b5d..8f19de9f8b 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -148,6 +148,7 @@ public:
BIND0R(RID, texture_create)
BIND5(texture_allocate, RID, int, int, Image::Format, uint32_t)
BIND3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
+ BIND10(texture_set_data_partial, RID, const Ref<Image> &, int, int, int, int, int, int, int, CubeMapSide)
BIND2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
BIND2(texture_set_flags, RID, uint32_t)
BIND1RC(uint32_t, texture_get_flags, RID)
@@ -285,6 +286,7 @@ public:
BIND2RC(Transform, skeleton_bone_get_transform, RID, int)
BIND3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)
BIND2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)
+ BIND2(skeleton_set_base_transform_2d, RID, const Transform2D &)
/* Light API */
@@ -450,6 +452,7 @@ public:
BIND2(viewport_set_hide_canvas, RID, bool)
BIND2(viewport_set_disable_environment, RID, bool)
BIND2(viewport_set_disable_3d, RID, bool)
+ BIND2(viewport_set_keep_3d_linear, RID, bool)
BIND2(viewport_attach_camera, RID, RID)
BIND2(viewport_set_scenario, RID, RID)
@@ -580,7 +583,7 @@ public:
BIND11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
BIND7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
BIND7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
- BIND8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
+ BIND10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID)
BIND4(canvas_item_add_mesh, RID, const RID &, RID, RID)
BIND4(canvas_item_add_multimesh, RID, RID, RID, RID)
BIND6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp
index 83e05f6f25..dcc270ca5e 100644
--- a/servers/visual/visual_server_viewport.cpp
+++ b/servers/visual/visual_server_viewport.cpp
@@ -178,11 +178,14 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
VSG::rasterizer->restore_render_target();
if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().layer > scenario_canvas_max_layer) {
+ Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface();
- if (can_draw_3d) {
- VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
- } else {
+ if (!can_draw_3d) {
VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ } else if (p_viewport->use_arvr && arvr_interface.is_valid()) {
+ VSG::scene->render_camera(arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
}
scenario_draw_canvas_bg = false;
}
@@ -210,11 +213,14 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
i++;
if (scenario_draw_canvas_bg && E->key().layer >= scenario_canvas_max_layer) {
+ Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface();
- if (can_draw_3d) {
- VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
- } else {
+ if (!can_draw_3d) {
VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ } else if (p_viewport->use_arvr && arvr_interface.is_valid()) {
+ VSG::scene->render_camera(arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
}
scenario_draw_canvas_bg = false;
@@ -222,11 +228,14 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
}
if (scenario_draw_canvas_bg) {
+ Ref<ARVRInterface> arvr_interface = ARVRServer::get_singleton()->get_primary_interface();
- if (can_draw_3d) {
- VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
- } else {
+ if (!can_draw_3d) {
VSG::scene->render_empty_scene(p_viewport->scenario, p_viewport->shadow_atlas);
+ } else if (p_viewport->use_arvr && arvr_interface.is_valid()) {
+ VSG::scene->render_camera(arvr_interface, p_eye, p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
+ } else {
+ VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
}
scenario_draw_canvas_bg = false;
@@ -453,6 +462,15 @@ void VisualServerViewport::viewport_set_disable_3d(RID p_viewport, bool p_disabl
//this should be just for disabling rendering of 3D, to actually disable it, set usage
}
+void VisualServerViewport::viewport_set_keep_3d_linear(RID p_viewport, bool p_keep_3d_linear) {
+
+ Viewport *viewport = viewport_owner.getornull(p_viewport);
+ ERR_FAIL_COND(!viewport);
+
+ viewport->keep_3d_linear = p_keep_3d_linear;
+ VSG::storage->render_target_set_flag(viewport->render_target, RasterizerStorage::RENDER_TARGET_KEEP_3D_LINEAR, p_keep_3d_linear);
+}
+
void VisualServerViewport::viewport_attach_camera(RID p_viewport, RID p_camera) {
Viewport *viewport = viewport_owner.getornull(p_viewport);
diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h
index 1d28cf22a3..c0c83c0450 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/visual/visual_server_viewport.h
@@ -64,6 +64,7 @@ public:
bool disable_environment;
bool disable_3d;
bool disable_3d_by_usage;
+ bool keep_3d_linear;
RID shadow_atlas;
int shadow_atlas_size;
@@ -110,6 +111,7 @@ public:
shadow_atlas_size = 0;
disable_3d = false;
disable_3d_by_usage = false;
+ keep_3d_linear = false;
debug_draw = VS::VIEWPORT_DEBUG_DRAW_DISABLED;
for (int i = 0; i < VS::VIEWPORT_RENDER_INFO_MAX; i++) {
render_info[i] = 0;
@@ -164,6 +166,7 @@ public:
void viewport_set_hide_canvas(RID p_viewport, bool p_hide);
void viewport_set_disable_environment(RID p_viewport, bool p_disable);
void viewport_set_disable_3d(RID p_viewport, bool p_disable);
+ void viewport_set_keep_3d_linear(RID p_viewport, bool p_keep_3d_linear);
void viewport_attach_camera(RID p_viewport, RID p_camera);
void viewport_set_scenario(RID p_viewport, RID p_scenario);
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index b91f80d137..19bb58f3ad 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -84,6 +84,7 @@ public:
FUNCRID(texture)
FUNC5(texture_allocate, RID, int, int, Image::Format, uint32_t)
FUNC3(texture_set_data, RID, const Ref<Image> &, CubeMapSide)
+ FUNC10(texture_set_data_partial, RID, const Ref<Image> &, int, int, int, int, int, int, int, CubeMapSide)
FUNC2RC(Ref<Image>, texture_get_data, RID, CubeMapSide)
FUNC2(texture_set_flags, RID, uint32_t)
FUNC1RC(uint32_t, texture_get_flags, RID)
@@ -221,6 +222,7 @@ public:
FUNC2RC(Transform, skeleton_bone_get_transform, RID, int)
FUNC3(skeleton_bone_set_transform_2d, RID, int, const Transform2D &)
FUNC2RC(Transform2D, skeleton_bone_get_transform_2d, RID, int)
+ FUNC2(skeleton_set_base_transform_2d, RID, const Transform2D &)
/* Light API */
@@ -377,6 +379,7 @@ public:
FUNC2(viewport_set_hide_canvas, RID, bool)
FUNC2(viewport_set_disable_environment, RID, bool)
FUNC2(viewport_set_disable_3d, RID, bool)
+ FUNC2(viewport_set_keep_3d_linear, RID, bool)
FUNC2(viewport_attach_camera, RID, RID)
FUNC2(viewport_set_scenario, RID, RID)
@@ -498,7 +501,7 @@ public:
FUNC11(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &, RID)
FUNC7(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, float, RID)
FUNC7(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, RID, bool)
- FUNC8(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID, int, RID)
+ FUNC10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID)
FUNC4(canvas_item_add_mesh, RID, const RID &, RID, RID)
FUNC4(canvas_item_add_multimesh, RID, RID, RID, RID)
FUNC6(canvas_item_add_particles, RID, RID, RID, RID, int, int)
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index 59dd1ab495..21745e87a8 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1528,6 +1528,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("texture_create_from_image", "image", "flags"), &VisualServer::texture_create_from_image, DEFVAL(TEXTURE_FLAGS_DEFAULT));
ClassDB::bind_method(D_METHOD("texture_allocate", "texture", "width", "height", "format", "flags"), &VisualServer::texture_allocate, DEFVAL(TEXTURE_FLAGS_DEFAULT));
ClassDB::bind_method(D_METHOD("texture_set_data", "texture", "image", "cube_side"), &VisualServer::texture_set_data, DEFVAL(CUBEMAP_LEFT));
+ ClassDB::bind_method(D_METHOD("texture_set_data_partial", "texture", "image", "src_x", "src_y", "src_w", "src_h", "dst_x", "dst_y", "dst_mip", "cube_side"), &VisualServer::texture_set_data_partial, DEFVAL(CUBEMAP_LEFT));
ClassDB::bind_method(D_METHOD("texture_get_data", "texture", "cube_side"), &VisualServer::texture_get_data, DEFVAL(CUBEMAP_LEFT));
ClassDB::bind_method(D_METHOD("texture_set_flags", "texture", "flags"), &VisualServer::texture_set_flags);
ClassDB::bind_method(D_METHOD("texture_get_flags", "texture"), &VisualServer::texture_get_flags);
@@ -1827,7 +1828,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("canvas_item_add_nine_patch", "item", "rect", "source", "texture", "topleft", "bottomright", "x_axis_mode", "y_axis_mode", "draw_center", "modulate", "normal_map"), &VisualServer::canvas_item_add_nine_patch, DEFVAL(NINE_PATCH_STRETCH), DEFVAL(NINE_PATCH_STRETCH), DEFVAL(true), DEFVAL(Color(1, 1, 1)), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_primitive", "item", "points", "colors", "uvs", "texture", "width", "normal_map"), &VisualServer::canvas_item_add_primitive, DEFVAL(1.0), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_polygon", "item", "points", "colors", "uvs", "texture", "normal_map", "antialiased"), &VisualServer::canvas_item_add_polygon, DEFVAL(Vector<Point2>()), DEFVAL(RID()), DEFVAL(RID()), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "texture", "count", "normal_map"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()));
+ ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_mesh, DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_multimesh, DEFVAL(RID()));
ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map", "h_frames", "v_frames"), &VisualServer::canvas_item_add_particles);
diff --git a/servers/visual_server.h b/servers/visual_server.h
index 537588fd6f..65d0f07a43 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -109,6 +109,7 @@ public:
RID texture_create_from_image(const Ref<Image> &p_image, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT); // helper
virtual void texture_allocate(RID p_texture, int p_width, int p_height, Image::Format p_format, uint32_t p_flags = TEXTURE_FLAGS_DEFAULT) = 0;
virtual void texture_set_data(RID p_texture, const Ref<Image> &p_image, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
+ virtual void texture_set_data_partial(RID p_texture, const Ref<Image> &p_image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int p_dst_mip, CubeMapSide p_cube_side = CUBEMAP_LEFT) = 0;
virtual Ref<Image> texture_get_data(RID p_texture, CubeMapSide p_cube_side = CUBEMAP_LEFT) const = 0;
virtual void texture_set_flags(RID p_texture, uint32_t p_flags) = 0;
virtual uint32_t texture_get_flags(RID p_texture) const = 0;
@@ -351,6 +352,7 @@ public:
virtual Transform skeleton_bone_get_transform(RID p_skeleton, int p_bone) const = 0;
virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) = 0;
virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const = 0;
+ virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) = 0;
/* Light API */
@@ -591,6 +593,7 @@ public:
virtual void viewport_set_hide_canvas(RID p_viewport, bool p_hide) = 0;
virtual void viewport_set_disable_environment(RID p_viewport, bool p_disable) = 0;
virtual void viewport_set_disable_3d(RID p_viewport, bool p_disable) = 0;
+ virtual void viewport_set_keep_3d_linear(RID p_viewport, bool p_disable) = 0;
virtual void viewport_attach_camera(RID p_viewport, RID p_camera) = 0;
virtual void viewport_set_scenario(RID p_viewport, RID p_scenario) = 0;
@@ -845,7 +848,7 @@ public:
virtual void canvas_item_add_nine_patch(RID p_item, const Rect2 &p_rect, const Rect2 &p_source, RID p_texture, const Vector2 &p_topleft, const Vector2 &p_bottomright, NinePatchAxisMode p_x_axis_mode = NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode = NINE_PATCH_STRETCH, bool p_draw_center = true, const Color &p_modulate = Color(1, 1, 1), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, RID p_texture, float p_width = 1.0, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), RID p_normal_map = RID(), bool p_antialiased = false) = 0;
- virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0;
+ virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID()) = 0;
virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, int p_h_frames, int p_v_frames) = 0;
diff --git a/thirdparty/README.md b/thirdparty/README.md
index 2f765a4000..1d4e56d42e 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -102,7 +102,7 @@ Use UI font variant if available, because it has tight vertical metrics and good
## freetype
- Upstream: https://www.freetype.org
-- Version: 2.8.1
+- Version: 2.9.1
- License: FreeType License (BSD-like)
Files extracted from upstream source:
@@ -115,7 +115,7 @@ Files extracted from upstream source:
## glad
- Upstream: https://github.com/Dav1dde/glad
-- Version: 0.1.16a0
+- Version: 0.1.20a0
- License: MIT
The files we package are automatically generated.
diff --git a/thirdparty/fonts/NotoSansUI_Bold.ttf b/thirdparty/fonts/NotoSansUI_Bold.ttf
new file mode 100644
index 0000000000..810450aa81
--- /dev/null
+++ b/thirdparty/fonts/NotoSansUI_Bold.ttf
Binary files differ
diff --git a/thirdparty/freetype/FTL.TXT b/thirdparty/freetype/FTL.TXT
index 433ab060e3..c406d150fa 100644
--- a/thirdparty/freetype/FTL.TXT
+++ b/thirdparty/freetype/FTL.TXT
@@ -163,7 +163,7 @@ Legal Terms
Our home page can be found at
- http://www.freetype.org
+ https://www.freetype.org
--- end of FTL.TXT ---
diff --git a/thirdparty/freetype/include/freetype/config/ftconfig.h b/thirdparty/freetype/include/freetype/config/ftconfig.h
index 889aebf5ab..eedebf4082 100644
--- a/thirdparty/freetype/include/freetype/config/ftconfig.h
+++ b/thirdparty/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -73,11 +73,11 @@ FT_BEGIN_HEADER
/* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFUL
-#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
+#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
+#define FT_SIZEOF_INT ( 32 / FT_CHAR_BIT )
#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
+#define FT_SIZEOF_INT ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `int' type!"
#endif
@@ -85,11 +85,11 @@ FT_BEGIN_HEADER
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
+#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL
-#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
+#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL
-#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
+#define FT_SIZEOF_LONG ( 64 / FT_CHAR_BIT )
#else
#error "Unsupported size of `long' type!"
#endif
@@ -236,12 +236,12 @@ FT_BEGIN_HEADER
#endif
-#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
+#if FT_SIZEOF_INT == ( 32 / FT_CHAR_BIT )
typedef signed int FT_Int32;
typedef unsigned int FT_UInt32;
-#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
+#elif FT_SIZEOF_LONG == ( 32 / FT_CHAR_BIT )
typedef signed long FT_Int32;
typedef unsigned long FT_UInt32;
@@ -252,12 +252,12 @@ FT_BEGIN_HEADER
/* look up an integer type that is at least 32 bits */
-#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
+#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast;
typedef unsigned int FT_UFast;
-#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
+#elif FT_SIZEOF_LONG >= ( 32 / FT_CHAR_BIT )
typedef long FT_Fast;
typedef unsigned long FT_UFast;
@@ -267,7 +267,7 @@ FT_BEGIN_HEADER
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
-#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
+#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* FT_LONG64 must be defined if a 64-bit type is available */
#define FT_LONG64
@@ -365,6 +365,14 @@ FT_BEGIN_HEADER
#endif
+ /* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
+ /* a function that gets used only within the scope of a module. */
+ /* Normally, both the header and source code files for such a */
+ /* function are within a single module directory. */
+ /* */
+ /* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
+ /* FT_LOCAL_ARRAY_DEF. */
+ /* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@@ -386,6 +394,12 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x
+ /* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
+ /* functions that are used in more than a single module. In the */
+ /* current setup this implies that the declaration is in a header */
+ /* file in the `include/freetype/internal' directory, and the */
+ /* function body is in a file in `src/base'. */
+ /* */
#ifndef FT_BASE
#ifdef __cplusplus
@@ -408,14 +422,63 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
+ /* When compiling FreeType as a DLL or DSO with hidden visibility */
+ /* some systems/compilers need a special attribute in front OR after */
+ /* the return type of function declarations. */
+ /* */
+ /* Two macros are used within the FreeType source code to define */
+ /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
+ /* */
+ /* FT_EXPORT( return_type ) */
+ /* */
+ /* is used in a function declaration, as in */
+ /* */
+ /* FT_EXPORT( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ); */
+ /* */
+ /* */
+ /* FT_EXPORT_DEF( return_type ) */
+ /* */
+ /* is used in a function definition, as in */
+ /* */
+ /* FT_EXPORT_DEF( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ) */
+ /* { */
+ /* ... some code ... */
+ /* return FT_Err_Ok; */
+ /* } */
+ /* */
+ /* You can provide your own implementation of FT_EXPORT and */
+ /* FT_EXPORT_DEF here if you want. */
+ /* */
+ /* To export a variable, use FT_EXPORT_VAR. */
+ /* */
#ifndef FT_EXPORT
-#ifdef __cplusplus
+#ifdef FT2_BUILD_LIBRARY
+
+#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
+#define FT_EXPORT( x ) __declspec( dllexport ) x
+#elif defined( __GNUC__ ) && __GNUC__ >= 4
+#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
+#elif defined( __cplusplus )
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#else
+
+#if defined( FT2_DLLIMPORT )
+#define FT_EXPORT( x ) __declspec( dllimport ) x
+#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
#define FT_EXPORT( x ) extern x
#endif
+#endif
+
#endif /* !FT_EXPORT */
@@ -440,6 +503,7 @@ FT_BEGIN_HEADER
#endif /* !FT_EXPORT_VAR */
+
/* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */
/* */
@@ -451,7 +515,13 @@ FT_BEGIN_HEADER
/* functions which are accessed by (global) function pointers. */
/* */
/* */
- /* FT_CALLBACK_DEF is used to _define_ a callback function. */
+ /* FT_CALLBACK_DEF is used to _define_ a callback function, */
+ /* located in the same source code file as the structure that uses */
+ /* it. */
+ /* */
+ /* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
+ /* and define a callback function, respectively, in a similar way */
+ /* as FT_BASE and FT_BASE_DEF work. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
@@ -471,6 +541,16 @@ FT_BEGIN_HEADER
#endif
#endif /* FT_CALLBACK_DEF */
+#ifndef FT_BASE_CALLBACK
+#ifdef __cplusplus
+#define FT_BASE_CALLBACK( x ) extern "C" x
+#define FT_BASE_CALLBACK_DEF( x ) extern "C" x
+#else
+#define FT_BASE_CALLBACK( x ) extern x
+#define FT_BASE_CALLBACK_DEF( x ) x
+#endif
+#endif /* FT_BASE_CALLBACK */
+
#ifndef FT_CALLBACK_TABLE
#ifdef __cplusplus
#define FT_CALLBACK_TABLE extern "C"
diff --git a/thirdparty/freetype/include/freetype/config/ftheader.h b/thirdparty/freetype/include/freetype/config/ftheader.h
index d491af57c3..702f77cc42 100644
--- a/thirdparty/freetype/include/freetype/config/ftheader.h
+++ b/thirdparty/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
/* */
/* Build macros of the FreeType 2 library. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -318,14 +318,29 @@
/*************************************************************************
*
* @macro:
+ * FT_DRIVER_H
+ *
+ * @description:
+ * A macro used in #include statements to name the file containing
+ * structures and macros related to the driver modules.
+ *
+ */
+#define FT_DRIVER_H <freetype/ftdriver.h>
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_AUTOHINTER_H
*
* @description:
* A macro used in #include statements to name the file containing
* structures and macros related to the auto-hinting module.
*
+ * Deprecated since version 2.9; use @FT_DRIVER_H instead.
+ *
*/
-#define FT_AUTOHINTER_H <freetype/ftautoh.h>
+#define FT_AUTOHINTER_H FT_DRIVER_H
/*************************************************************************
@@ -337,8 +352,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the CFF driver module.
*
+ * Deprecated since version 2.9; use @FT_DRIVER_H instead.
+ *
*/
-#define FT_CFF_DRIVER_H <freetype/ftcffdrv.h>
+#define FT_CFF_DRIVER_H FT_DRIVER_H
/*************************************************************************
@@ -350,8 +367,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the TrueType driver module.
*
+ * Deprecated since version 2.9; use @FT_DRIVER_H instead.
+ *
*/
-#define FT_TRUETYPE_DRIVER_H <freetype/ftttdrv.h>
+#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/*************************************************************************
@@ -363,8 +382,10 @@
* A macro used in #include statements to name the file containing
* structures and macros related to the PCF driver module.
*
+ * Deprecated since version 2.9; use @FT_DRIVER_H instead.
+ *
*/
-#define FT_PCF_DRIVER_H <freetype/ftpcfdrv.h>
+#define FT_PCF_DRIVER_H FT_DRIVER_H
/*************************************************************************
@@ -557,63 +578,6 @@
/*************************************************************************
*
* @macro:
- * FT_CACHE_IMAGE_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `glyph image' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for @FT_Glyph elements. You can also
- * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to
- * store small glyph bitmaps, as it will use less memory.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * glyph image-related cache declarations.
- *
- */
-#define FT_CACHE_IMAGE_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_SMALL_BITMAPS_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `small bitmaps' API of the FreeType~2 cache sub-system.
- *
- * It is used to define a cache for small glyph bitmaps in a relatively
- * memory-efficient way. You can also use the API defined in
- * @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,
- * including scalable outlines.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * small bitmaps-related cache declarations.
- *
- */
-#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
- * FT_CACHE_CHARMAP_H
- *
- * @description:
- * A macro used in #include statements to name the file containing the
- * `charmap' API of the FreeType~2 cache sub-system.
- *
- * This macro is deprecated. Simply include @FT_CACHE_H to have all
- * charmap-based cache declarations.
- *
- */
-#define FT_CACHE_CHARMAP_H FT_CACHE_H
-
-
- /*************************************************************************
- *
- * @macro:
* FT_MAC_H
*
* @description:
@@ -763,17 +727,6 @@
/*************************************************************************
*
* @macro:
- * FT_UNPATENTED_HINTING_H
- *
- * @description:
- * Deprecated.
- */
-#define FT_UNPATENTED_HINTING_H <freetype/ttunpat.h>
-
-
- /*************************************************************************
- *
- * @macro:
* FT_INCREMENTAL_H
*
* @description:
@@ -809,25 +762,30 @@
/* */
+ /* These header files don't need to be included by the user. */
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
+#define FT_PARAMETER_TAGS_H <freetype/ftparams.h>
+ /* Deprecated macros. */
+#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
+#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
+
+ /* FT_CACHE_H is the only header file needed for the cache subsystem. */
+#define FT_CACHE_IMAGE_H FT_CACHE_H
+#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
+#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* */
-#define FT_CACHE_MANAGER_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_MRU_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_MANAGER_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_CACHE_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_GLYPH_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_IMAGE_H <freetype/ftcache.h>
-#define FT_CACHE_INTERNAL_SBITS_H <freetype/ftcache.h>
-
-
-#define FT_INCREMENTAL_H <freetype/ftincrem.h>
-
-#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
+#define FT_CACHE_MANAGER_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_MANAGER_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_CACHE_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_GLYPH_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_IMAGE_H FT_CACHE_H
+#define FT_CACHE_INTERNAL_SBITS_H FT_CACHE_H
/*
diff --git a/thirdparty/freetype/include/freetype/config/ftoption.h b/thirdparty/freetype/include/freetype/config/ftoption.h
index 2fbe80b9b4..4bcab2af5c 100644
--- a/thirdparty/freetype/include/freetype/config/ftoption.h
+++ b/thirdparty/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
/* */
/* User-selectable configuration macros (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -75,19 +75,21 @@ FT_BEGIN_HEADER
/*************************************************************************/
- /*************************************************************************/
+ /*#***********************************************************************/
/* */
/* If you enable this configuration option, FreeType recognizes an */
/* environment variable called `FREETYPE_PROPERTIES', which can be used */
/* to control the various font drivers and modules. The controllable */
- /* properties are listed in the section `Controlling FreeType Modules' */
- /* in the reference's table of contents; currently there are properties */
- /* for the auto-hinter (file `ftautoh.h'), CFF (file `ftcffdrv.h'), */
- /* TrueType (file `ftttdrv.h'), and PCF (file `ftpcfdrv.h'). */
+ /* properties are listed in the section @properties. */
+ /* */
+ /* You have to undefine this configuration option on platforms that lack */
+ /* the concept of environment variables (and thus don't have the */
+ /* `getenv' function), for example Windows CE. */
/* */
/* `FREETYPE_PROPERTIES' has the following syntax form (broken here into */
/* multiple lines for better readability). */
/* */
+ /* { */
/* <optional whitespace> */
/* <module-name1> ':' */
/* <property-name1> '=' <property-value1> */
@@ -95,6 +97,7 @@ FT_BEGIN_HEADER
/* <module-name2> ':' */
/* <property-name2> '=' <property-value2> */
/* ... */
+ /* } */
/* */
/* Example: */
/* */
@@ -211,6 +214,10 @@ FT_BEGIN_HEADER
/* Do not #undef this macro here since the build system might define */
/* it for certain configurations only. */
/* */
+ /* If you use a build system like cmake or the `configure' script, */
+ /* options set by those programs have precendence, overwriting the */
+ /* value here with the configured one. */
+ /* */
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@@ -227,6 +234,10 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
+ /* If you use a build system like cmake or the `configure' script, */
+ /* options set by those programs have precendence, overwriting the */
+ /* value here with the configured one. */
+ /* */
/* #define FT_CONFIG_OPTION_USE_BZIP2 */
@@ -252,6 +263,10 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
+ /* If you use a build system like cmake or the `configure' script, */
+ /* options set by those programs have precendence, overwriting the */
+ /* value here with the configured one. */
+ /* */
/* #define FT_CONFIG_OPTION_USE_PNG */
@@ -265,49 +280,11 @@ FT_BEGIN_HEADER
/* */
/* Define this macro if you want to enable this `feature'. */
/* */
-/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
-
-
- /*************************************************************************/
- /* */
- /* DLL export compilation */
- /* */
- /* When compiling FreeType as a DLL, some systems/compilers need a */
- /* special keyword in front OR after the return type of function */
- /* declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
- /* */
- /* FT_EXPORT( return_type ) */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* */
+ /* If you use a build system like cmake or the `configure' script, */
+ /* options set by those programs have precendence, overwriting the */
+ /* value here with the configured one. */
/* */
- /* FT_EXPORT_DEF( return_type ) */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* */
- /* You can provide your own implementation of FT_EXPORT and */
- /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
- /* will be later automatically defined as `extern return_type' to */
- /* allow normal compilation. */
- /* */
- /* Do not #undef these macros here since the build system might define */
- /* them for certain configurations only. */
- /* */
-/* #define FT_EXPORT(x) extern x */
-/* #define FT_EXPORT_DEF(x) x */
+/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
/*************************************************************************/
@@ -678,7 +655,7 @@ FT_BEGIN_HEADER
/* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
/* defined. */
/* */
- /* [1] http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
+ /* [1] https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
/* */
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
@@ -698,7 +675,7 @@ FT_BEGIN_HEADER
/* composite flags array which can be used to disambiguate, but old */
/* fonts will not have them. */
/* */
- /* http://www.microsoft.com/typography/otspec/glyf.htm */
+ /* https://www.microsoft.com/typography/otspec/glyf.htm */
/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html */
/* */
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@@ -796,6 +773,16 @@ FT_BEGIN_HEADER
/*************************************************************************/
+ /* */
+ /* T1_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe Type 1 */
+ /* engine gets compiled into FreeType. If defined, it is possible to */
+ /* switch between the two engines using the `hinting-engine' property of */
+ /* the type1 driver module. */
+ /* */
+/* #define T1_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /*************************************************************************/
/*************************************************************************/
/**** ****/
/**** C F F D R I V E R C O N F I G U R A T I O N ****/
@@ -810,8 +797,8 @@ FT_BEGIN_HEADER
/* possible to set up the default values of the four control points that */
/* define the stem darkening behaviour of the (new) CFF engine. For */
/* more details please read the documentation of the */
- /* `darkening-parameters' property of the cff driver module (file */
- /* `ftcffdrv.h'), which allows the control at run-time. */
+ /* `darkening-parameters' property (file `ftdriver.h'), which allows the */
+ /* control at run-time. */
/* */
/* Do *not* undefine these macros! */
/* */
@@ -899,7 +886,7 @@ FT_BEGIN_HEADER
/* */
/* This experimental option is active only if the rendering mode is */
/* FT_RENDER_MODE_LIGHT; you can switch warping on and off with the */
- /* `warping' property of the auto-hinter (see file `ftautoh.h' for more */
+ /* `warping' property of the auto-hinter (see file `ftdriver.h' for more */
/* information; by default it is switched off). */
/* */
#define AF_CONFIG_OPTION_USE_WARPER
diff --git a/thirdparty/freetype/include/freetype/config/ftstdlib.h b/thirdparty/freetype/include/freetype/config/ftstdlib.h
index 05a4845fd5..42f9a06e43 100644
--- a/thirdparty/freetype/include/freetype/config/ftstdlib.h
+++ b/thirdparty/freetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/freetype.h b/thirdparty/freetype/include/freetype/freetype.h
index b0c261799a..96644046e4 100644
--- a/thirdparty/freetype/include/freetype/freetype.h
+++ b/thirdparty/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -138,6 +138,7 @@ FT_BEGIN_HEADER
/* FT_FACE_FLAG_TRICKY */
/* FT_FACE_FLAG_KERNING */
/* FT_FACE_FLAG_MULTIPLE_MASTERS */
+ /* FT_FACE_FLAG_VARIATION */
/* FT_FACE_FLAG_GLYPH_NAMES */
/* FT_FACE_FLAG_EXTERNAL_STREAM */
/* FT_FACE_FLAG_HINTER */
@@ -147,14 +148,16 @@ FT_BEGIN_HEADER
/* FT_HAS_KERNING */
/* FT_HAS_FIXED_SIZES */
/* FT_HAS_GLYPH_NAMES */
- /* FT_HAS_MULTIPLE_MASTERS */
/* FT_HAS_COLOR */
+ /* FT_HAS_MULTIPLE_MASTERS */
/* */
/* FT_IS_SFNT */
/* FT_IS_SCALABLE */
/* FT_IS_FIXED_WIDTH */
/* FT_IS_CID_KEYED */
/* FT_IS_TRICKY */
+ /* FT_IS_NAMED_INSTANCE */
+ /* FT_IS_VARIATION */
/* */
/* FT_STYLE_FLAG_BOLD */
/* FT_STYLE_FLAG_ITALIC */
@@ -648,7 +651,7 @@ FT_BEGIN_HEADER
/* FT_ENCODING_MS_SYMBOL :: */
/* Microsoft Symbol encoding, used to encode mathematical symbols */
/* and wingdings. For more information, see */
- /* `http://www.microsoft.com/typography/otspec/recom.htm', */
+ /* `https://www.microsoft.com/typography/otspec/recom.htm', */
/* `http://www.kostis.net/charsets/symbol.htm', and */
/* `http://www.kostis.net/charsets/wingding.htm'. */
/* */
@@ -657,7 +660,7 @@ FT_BEGIN_HEADER
/* */
/* FT_ENCODING_SJIS :: */
/* Shift JIS encoding for Japanese. More info at */
- /* `http://en.wikipedia.org/wiki/Shift_JIS'. See note on */
+ /* `https://en.wikipedia.org/wiki/Shift_JIS'. See note on */
/* multi-byte encodings below. */
/* */
/* FT_ENCODING_PRC :: */
@@ -673,7 +676,7 @@ FT_BEGIN_HEADER
/* Corresponds to the Korean encoding system known as Extended */
/* Wansung (MS Windows code page 949). */
/* For more information see */
- /* `http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt'. */
+ /* `https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt'. */
/* */
/* FT_ENCODING_JOHAB :: */
/* The Korean standard character set (KS~C 5601-1992), which */
@@ -721,11 +724,12 @@ FT_BEGIN_HEADER
/* Same as FT_ENCODING_JOHAB. Deprecated. */
/* */
/* <Note> */
- /* By default, FreeType automatically synthesizes a Unicode charmap */
- /* for PostScript fonts, using their glyph name dictionaries. */
- /* However, it also reports the encodings defined explicitly in the */
- /* font file, for the cases when they are needed, with the Adobe */
- /* values as well. */
+ /* By default, FreeType enables a Unicode charmap and tags it with */
+ /* FT_ENCODING_UNICODE when it is either provided or can be generated */
+ /* from PostScript glyph name dictionaries in the font file. */
+ /* All other encodings are considered legacy and tagged only if */
+ /* explicitly defined in the font file. Otherwise, FT_ENCODING_NONE */
+ /* is used. */
/* */
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
@@ -749,7 +753,7 @@ FT_BEGIN_HEADER
/* @FT_Get_CMap_Language_ID to query the Mac language ID that may */
/* be needed to be able to distinguish Apple encoding variants. See */
/* */
- /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */
+ /* https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */
/* */
/* to get an idea how to do that. Basically, if the language ID */
/* is~0, don't use it, otherwise subtract 1 from the language ID. */
@@ -888,34 +892,41 @@ FT_BEGIN_HEADER
/* are set to~0 if there is only one face in */
/* the font file. */
/* */
- /* Bits 16-30 are relevant to GX and OpenType */
- /* variation fonts only, holding the named */
- /* instance index for the current face index */
- /* (starting with value~1; value~0 indicates */
- /* font access without a named instance). For */
- /* non-variation fonts, bits 16-30 are */
- /* ignored. If we have the third named */
- /* instance of face~4, say, `face_index' is */
- /* set to 0x00030004. */
+ /* [Since 2.6.1] Bits 16-30 are relevant to GX */
+ /* and OpenType variation fonts only, holding */
+ /* the named instance index for the current */
+ /* face index (starting with value~1; value~0 */
+ /* indicates font access without a named */
+ /* instance). For non-variation fonts, bits */
+ /* 16-30 are ignored. If we have the third */
+ /* named instance of face~4, say, `face_index' */
+ /* is set to 0x00030004. */
/* */
/* Bit 31 is always zero (this is, */
/* `face_index' is always a positive value). */
/* */
+ /* [Since 2.9] Changing the design coordinates */
+ /* with @FT_Set_Var_Design_Coordinates or */
+ /* @FT_Set_Var_Blend_Coordinates does not */
+ /* influence the named instance index value */
+ /* (only @FT_Set_Named_Instance does that). */
+ /* */
/* face_flags :: A set of bit flags that give important */
/* information about the face; see */
/* @FT_FACE_FLAG_XXX for the details. */
/* */
/* style_flags :: The lower 16~bits contain a set of bit */
/* flags indicating the style of the face; see */
- /* @FT_STYLE_FLAG_XXX for the details. Bits */
- /* 16-30 hold the number of named instances */
- /* available for the current face if we have a */
- /* GX or OpenType variation (sub)font. Bit 31 */
- /* is always zero (this is, `style_flags' is */
- /* always a positive value). Note that a */
- /* variation font has always at least one */
- /* named instance, namely the default */
- /* instance. */
+ /* @FT_STYLE_FLAG_XXX for the details. */
+ /* */
+ /* [Since 2.6.1] Bits 16-30 hold the number */
+ /* of named instances available for the */
+ /* current face if we have a GX or OpenType */
+ /* variation (sub)font. Bit 31 is always zero */
+ /* (this is, `style_flags' is always a */
+ /* positive value). Note that a variation */
+ /* font has always at least one named */
+ /* instance, namely the default instance. */
/* */
/* num_glyphs :: The number of glyphs in the face. If the */
/* face is scalable and has sbits (see */
@@ -1052,6 +1063,9 @@ FT_BEGIN_HEADER
/* `descender', `height', `underline_position', and */
/* `underline_thickness'. */
/* */
+ /* Especially for TrueType fonts see also the documentation for */
+ /* @FT_Size_Metrics. */
+ /* */
typedef struct FT_FaceRec_
{
FT_Long num_faces;
@@ -1162,7 +1176,7 @@ FT_BEGIN_HEADER
/* interpolating between them. Supported formats are Adobe MM, */
/* TrueType GX, and OpenType variation fonts. */
/* */
- /* See the multiple-masters specific API for details. */
+ /* See section @multiple_masters for API details. */
/* */
/* FT_FACE_FLAG_GLYPH_NAMES :: */
/* The face contains glyph names, which can be retrieved using */
@@ -1212,8 +1226,15 @@ FT_BEGIN_HEADER
/* tricky fonts; they are hard-coded in file `ttobjs.c'. */
/* */
/* FT_FACE_FLAG_COLOR :: */
- /* The face has color glyph tables. To access color glyphs use */
- /* @FT_LOAD_COLOR. */
+ /* [Since 2.5.1] The face has color glyph tables. To access color */
+ /* glyphs use @FT_LOAD_COLOR. */
+ /* */
+ /* FT_FACE_FLAG_VARIATION :: */
+ /* [Since 2.9] Set if the current face (or named instance) has been */
+ /* altered with @FT_Set_MM_Design_Coordinates, */
+ /* @FT_Set_Var_Design_Coordinates, or */
+ /* @FT_Set_Var_Blend_Coordinates. This flag is unset by a call to */
+ /* @FT_Set_Named_Instance. */
/* */
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1230,6 +1251,7 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_CID_KEYED ( 1L << 12 )
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
+#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
/*************************************************************************
@@ -1391,6 +1413,14 @@ FT_BEGIN_HEADER
* A macro that returns true whenever a face object is a named instance
* of a GX or OpenType variation font.
*
+ * [Since 2.9] Changing the design coordinates with
+ * @FT_Set_Var_Design_Coordinates or @FT_Set_Var_Blend_Coordinates does
+ * not influence the return value of this macro (only
+ * @FT_Set_Named_Instance does that).
+ *
+ * @since:
+ * 2.7
+ *
*/
#define FT_IS_NAMED_INSTANCE( face ) \
( (face)->face_index & 0x7FFF0000L )
@@ -1399,6 +1429,24 @@ FT_BEGIN_HEADER
/*************************************************************************
*
* @macro:
+ * FT_IS_VARIATION( face )
+ *
+ * @description:
+ * A macro that returns true whenever a face object has been altered
+ * by @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or
+ * @FT_Set_Var_Blend_Coordinates.
+ *
+ * @since:
+ * 2.9
+ *
+ */
+#define FT_IS_VARIATION( face ) \
+ ( (face)->face_flags & FT_FACE_FLAG_VARIATION )
+
+
+ /*************************************************************************
+ *
+ * @macro:
* FT_IS_CID_KEYED( face )
*
* @description:
@@ -1437,6 +1485,9 @@ FT_BEGIN_HEADER
* A macro that returns true whenever a face object contains
* tables for color glyphs.
*
+ * @since:
+ * 2.5.1
+ *
*/
#define FT_HAS_COLOR( face ) \
( (face)->face_flags & FT_FACE_FLAG_COLOR )
@@ -1534,7 +1585,7 @@ FT_BEGIN_HEADER
/* to the following. */
/* */
/* { */
- /* scaled_ascender = FT_MulFix( face->root.ascender, */
+ /* scaled_ascender = FT_MulFix( face->ascender, */
/* size_metrics->y_scale ); */
/* } */
/* */
@@ -1548,6 +1599,43 @@ FT_BEGIN_HEADER
/* */
/* The `FT_Size_Metrics' structure is valid for bitmap fonts also. */
/* */
+ /* */
+ /* *TrueType* *fonts* *with* *native* *bytecode* *hinting* */
+ /* */
+ /* All applications that handle TrueType fonts with native hinting */
+ /* must be aware that TTFs expect different rounding of vertical font */
+ /* dimensions. The application has to cater for this, especially if */
+ /* it wants to rely on a TTF's vertical data (for example, to */
+ /* properly align box characters vertically). */
+ /* */
+ /* Only the application knows _in_ _advance_ that it is going to use */
+ /* native hinting for TTFs! FreeType, on the other hand, selects the */
+ /* hinting mode not at the time of creating an @FT_Size object but */
+ /* much later, namely while calling @FT_Load_Glyph. */
+ /* */
+ /* Here is some pseudo code that illustrates a possible solution. */
+ /* */
+ /* { */
+ /* font_format = FT_Get_Font_Format( face ); */
+ /* */
+ /* if ( !strcmp( font_format, "TrueType" ) && */
+ /* do_native_bytecode_hinting ) */
+ /* { */
+ /* ascender = ROUND( FT_MulFix( face->ascender, */
+ /* size_metrics->y_scale ) ); */
+ /* descender = ROUND( FT_MulFix( face->descender, */
+ /* size_metrics->y_scale ) ); */
+ /* } */
+ /* else */
+ /* { */
+ /* ascender = size_metrics->ascender; */
+ /* descender = size_metrics->descender; */
+ /* } */
+ /* */
+ /* height = size_metrics->height; */
+ /* max_advance = size_metrics->max_advance; */
+ /* } */
+ /* */
typedef struct FT_Size_Metrics_
{
FT_UShort x_ppem; /* horizontal pixels per EM */
@@ -1689,17 +1777,13 @@ FT_BEGIN_HEADER
/* @FT_GLYPH_FORMAT_COMPOSITE, but other values */
/* are possible. */
/* */
- /* bitmap :: This field is used as a bitmap descriptor */
- /* when the slot format is */
- /* @FT_GLYPH_FORMAT_BITMAP. Note that the */
- /* address and content of the bitmap buffer can */
- /* change between calls of @FT_Load_Glyph and a */
- /* few other functions. */
+ /* bitmap :: This field is used as a bitmap descriptor. */
+ /* Note that the address and content of the */
+ /* bitmap buffer can change between calls of */
+ /* @FT_Load_Glyph and a few other functions. */
/* */
/* bitmap_left :: The bitmap's left bearing expressed in */
- /* integer pixels. Only valid if the format is */
- /* @FT_GLYPH_FORMAT_BITMAP, this is, if the */
- /* glyph slot contains a bitmap. */
+ /* integer pixels. */
/* */
/* bitmap_top :: The bitmap's top bearing expressed in integer */
/* pixels. This is the distance from the */
@@ -1746,7 +1830,9 @@ FT_BEGIN_HEADER
/* If @FT_Load_Glyph is called with default flags (see */
/* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
/* its native format (e.g., an outline glyph for TrueType and Type~1 */
- /* formats). */
+ /* formats). [Since 2.9] The prospective bitmap metrics are */
+ /* calculated according to @FT_LOAD_TARGET_XXX and other flags even */
+ /* for the outline glyph, even if @FT_LOAD_RENDER is not set. */
/* */
/* This image can later be converted into a bitmap by calling */
/* @FT_Render_Glyph. This function searches the current renderer for */
@@ -1895,8 +1981,8 @@ FT_BEGIN_HEADER
/* */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
- /* variable to control driver properties. See sections @auto_hinter, */
- /* @cff_driver, @pcf_driver, and @tt_driver for more. */
+ /* variable to control driver properties. See section @properties */
+ /* for more. */
/* */
FT_EXPORT( FT_Error )
FT_Init_FreeType( FT_Library *alibrary );
@@ -1977,8 +2063,8 @@ FT_BEGIN_HEADER
/* data :: A pointer to the parameter data. */
/* */
/* <Note> */
- /* The ID and function of parameters are driver-specific. See the */
- /* various FT_PARAM_TAG_XXX flags for more information. */
+ /* The ID and function of parameters are driver-specific. See */
+ /* section @parameter_tags for more information. */
/* */
typedef struct FT_Parameter_
{
@@ -2155,14 +2241,14 @@ FT_BEGIN_HEADER
/* with value~0). Set it to~0 if there is only one */
/* face in the font file. */
/* */
- /* Bits 16-30 are relevant to GX and OpenType variation */
- /* fonts only, specifying the named instance index for */
- /* the current face index (starting with value~1; */
- /* value~0 makes FreeType ignore named instances). For */
- /* non-variation fonts, bits 16-30 are ignored. */
- /* Assuming that you want to access the third named */
- /* instance in face~4, `face_index' should be set to */
- /* 0x00030004. If you want to access face~4 without */
+ /* [Since 2.6.1] Bits 16-30 are relevant to GX and */
+ /* OpenType variation fonts only, specifying the named */
+ /* instance index for the current face index (starting */
+ /* with value~1; value~0 makes FreeType ignore named */
+ /* instances). For non-variation fonts, bits 16-30 are */
+ /* ignored. Assuming that you want to access the third */
+ /* named instance in face~4, `face_index' should be set */
+ /* to 0x00030004. If you want to access face~4 without */
/* variation handling, simply set `face_index' to */
/* value~4. */
/* */
@@ -2748,6 +2834,10 @@ FT_BEGIN_HEADER
/* since its glyph indices are not listed in any of the font's */
/* charmaps. */
/* */
+ /* If no active cmap is set up (i.e., `face->charmap' is zero), the */
+ /* call to @FT_Get_Char_Index is omitted, and the function behaves */
+ /* identically to @FT_Load_Glyph. */
+ /* */
FT_EXPORT( FT_Error )
FT_Load_Char( FT_Face face,
FT_ULong char_code,
@@ -2869,26 +2959,26 @@ FT_BEGIN_HEADER
* Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
- * Load embedded color bitmap images. The resulting color bitmaps,
- * if available, will have the @FT_PIXEL_MODE_BGRA format. If the
- * flag is not set and color bitmaps are found, they are converted
- * to 256-level gray bitmaps transparently, using the
+ * [Since 2.5] Load embedded color bitmap images. The resulting color
+ * bitmaps, if available, will have the @FT_PIXEL_MODE_BGRA format.
+ * If the flag is not set and color bitmaps are found, they are
+ * converted to 256-level gray bitmaps transparently, using the
* @FT_PIXEL_MODE_GRAY format.
*
* FT_LOAD_COMPUTE_METRICS ::
- * Compute glyph metrics from the glyph data, without the use of
- * bundled metrics tables (for example, the `hdmx' table in TrueType
- * fonts). This flag is mainly used by font validating or font
- * editing applications, which need to ignore, verify, or edit those
- * tables.
+ * [Since 2.6.1] Compute glyph metrics from the glyph data, without
+ * the use of bundled metrics tables (for example, the `hdmx' table in
+ * TrueType fonts). This flag is mainly used by font validating or
+ * font editing applications, which need to ignore, verify, or edit
+ * those tables.
*
* Currently, this flag is only implemented for TrueType fonts.
*
* FT_LOAD_BITMAP_METRICS_ONLY ::
- * Request loading of the metrics and bitmap image information of a
- * (possibly embedded) bitmap glyph without allocating or copying
- * the bitmap image data itself. No effect if the target glyph is
- * not a bitmap image.
+ * [Since 2.7.1] Request loading of the metrics and bitmap image
+ * information of a (possibly embedded) bitmap glyph without
+ * allocating or copying the bitmap image data itself. No effect if
+ * the target glyph is not a bitmap image.
*
* This flag unsets @FT_LOAD_RENDER.
*
@@ -2980,7 +3070,7 @@ FT_BEGIN_HEADER
*
* Advance widths are rounded to integer values; however, using the
* `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is
- * possible to get fractional advance widths for sub-pixel positioning
+ * possible to get fractional advance widths for subpixel positioning
* (which is recommended to use).
*
* If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active,
@@ -3119,13 +3209,13 @@ FT_BEGIN_HEADER
/* opacity). */
/* */
/* FT_RENDER_MODE_LCD :: */
- /* This mode corresponds to horizontal RGB and BGR sub-pixel */
+ /* This mode corresponds to horizontal RGB and BGR subpixel */
/* displays like LCD screens. It produces 8-bit bitmaps that are */
/* 3~times the width of the original glyph outline in pixels, and */
/* which use the @FT_PIXEL_MODE_LCD mode. */
/* */
/* FT_RENDER_MODE_LCD_V :: */
- /* This mode corresponds to vertical RGB and BGR sub-pixel displays */
+ /* This mode corresponds to vertical RGB and BGR subpixel displays */
/* (like PDA screens, rotated LCD displays, etc.). It produces */
/* 8-bit bitmaps that are 3~times the height of the original */
/* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
@@ -3471,7 +3561,14 @@ FT_BEGIN_HEADER
/* retrieve it. FreeType follows Adobe TechNote #5902, `Generating */
/* PostScript Names for Fonts Using OpenType Font Variations'. */
/* */
- /* http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5902.AdobePSNameGeneration.html */
+ /* https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html */
+ /* */
+ /* [Since 2.9] Special PostScript names for named instances are only */
+ /* returned if the named instance is set with @FT_Set_Named_Instance */
+ /* (and the font has corresponding entries in its `fvar' table). If */
+ /* @FT_IS_VARIATION returns true, the algorithmically derived */
+ /* PostScript name is provided, not looking up special entries for */
+ /* named instances. */
/* */
FT_EXPORT( const char* )
FT_Get_Postscript_Name( FT_Face face );
@@ -3702,17 +3799,17 @@ FT_BEGIN_HEADER
* Note that only a subset of the available properties can be
* controlled.
*
- * * Stem darkening (@FT_PARAM_TAG_STEM_DARKENING, corresponding to the
- * property `no-stem-darkening' provided by the `autofit' and `cff'
- * modules; see @no-stem-darkening[autofit] and
- * @no-stem-darkening[cff]).
+ * * @FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the
+ * property `no-stem-darkening' provided by the `autofit', `cff',
+ * `type1', and `t1cid' modules; see @no-stem-darkening).
*
- * * LCD filter weights (@FT_PARAM_TAG_LCD_FILTER_WEIGHTS, corresponding
+ * * @FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding
* to function @FT_Library_SetLcdFilterWeights).
*
- * * Seed value for the CFF `random' operator
- * (@FT_PARAM_TAG_RANDOM_SEED, corresponding to the `random-seed'
- * property provided by the `cff' module; see @random-seed).
+ * * @FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type~1, and CID
+ * `random' operator, corresponding to the `random-seed' property
+ * provided by the `cff', `type1', and `t1cid' modules; see
+ * @random-seed).
*
* Pass NULL as `data' in @FT_Parameter for a given tag to reset the
* option and use the library or module default again.
@@ -3775,6 +3872,9 @@ FT_BEGIN_HEADER
* FT_Face_Properties( face, 1, &property );
* }
*
+ * @since:
+ * 2.8
+ *
*/
FT_EXPORT( FT_Error )
FT_Face_Properties( FT_Face face,
@@ -3899,7 +3999,7 @@ FT_BEGIN_HEADER
/* and subsetting restrictions associated with a font. */
/* */
/* See */
- /* http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf */
+ /* https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf */
/* for more details. */
/* */
/* <Values> */
@@ -3999,9 +4099,9 @@ FT_BEGIN_HEADER
/* Sequences' (IVS), collected in the `Ideographic Variation */
/* Database' (IVD). */
/* */
- /* http://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt */
- /* http://unicode.org/reports/tr37/ */
- /* http://unicode.org/ivd/ */
+ /* https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt */
+ /* https://unicode.org/reports/tr37/ */
+ /* https://unicode.org/ivd/ */
/* */
/* To date (January 2017), the character with the most ideographic */
/* variations is U+9089, having 32 such IVS. */
@@ -4456,7 +4556,7 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 8
+#define FREETYPE_MINOR 9
#define FREETYPE_PATCH 1
diff --git a/thirdparty/freetype/include/freetype/ftadvanc.h b/thirdparty/freetype/include/freetype/ftadvanc.h
index dea96e0db4..f78e8b1a9d 100644
--- a/thirdparty/freetype/include/freetype/ftadvanc.h
+++ b/thirdparty/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (specification only). */
/* */
-/* Copyright 2008-2017 by */
+/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftbbox.h b/thirdparty/freetype/include/freetype/ftbbox.h
index f03bdc1e1e..f9eb70b137 100644
--- a/thirdparty/freetype/include/freetype/ftbbox.h
+++ b/thirdparty/freetype/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
/* */
/* FreeType exact bbox computation (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -61,7 +61,7 @@ FT_BEGIN_HEADER
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm that returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bézier arcs are traversed to */
+ /* coincide. Otherwise, the outline Bezier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
diff --git a/thirdparty/freetype/include/freetype/ftbdf.h b/thirdparty/freetype/include/freetype/ftbdf.h
index 3d3106bad0..1b6dea6586 100644
--- a/thirdparty/freetype/include/freetype/ftbdf.h
+++ b/thirdparty/freetype/include/freetype/ftbdf.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftbitmap.h b/thirdparty/freetype/include/freetype/ftbitmap.h
index 04b2402ad0..a43187cad4 100644
--- a/thirdparty/freetype/include/freetype/ftbitmap.h
+++ b/thirdparty/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -97,7 +97,7 @@ FT_BEGIN_HEADER
FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source,
- FT_Bitmap *target);
+ FT_Bitmap *target );
/*************************************************************************/
diff --git a/thirdparty/freetype/include/freetype/ftbzip2.h b/thirdparty/freetype/include/freetype/ftbzip2.h
index 9147a790a4..6edfa031b5 100644
--- a/thirdparty/freetype/include/freetype/ftbzip2.h
+++ b/thirdparty/freetype/include/freetype/ftbzip2.h
@@ -4,7 +4,7 @@
/* */
/* Bzip2-compressed stream support. */
/* */
-/* Copyright 2010-2017 by */
+/* Copyright 2010-2018 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftcache.h b/thirdparty/freetype/include/freetype/ftcache.h
index 5ff3ccf404..52d5f00e06 100644
--- a/thirdparty/freetype/include/freetype/ftcache.h
+++ b/thirdparty/freetype/include/freetype/ftcache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache subsystem (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -540,13 +540,6 @@ FT_BEGIN_HEADER
FTC_FaceID face_id );
- /*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
/*************************************************************************
*
* @type:
@@ -624,14 +617,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
- /* */
- /* <Section> */
- /* cache_subsystem */
- /* */
- /*************************************************************************/
-
-
- /*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/***** *****/
diff --git a/thirdparty/freetype/include/freetype/ftchapters.h b/thirdparty/freetype/include/freetype/ftchapters.h
index a0a121b0a1..51257bb7ca 100644
--- a/thirdparty/freetype/include/freetype/ftchapters.h
+++ b/thirdparty/freetype/include/freetype/ftchapters.h
@@ -76,8 +76,11 @@
/* <Sections> */
/* auto_hinter */
/* cff_driver */
+/* t1_cid_driver */
/* tt_driver */
/* pcf_driver */
+/* properties */
+/* parameter_tags */
/* */
/***************************************************************************/
diff --git a/thirdparty/freetype/include/freetype/ftcid.h b/thirdparty/freetype/include/freetype/ftcid.h
index 4adcbeeda9..5e9100a67c 100644
--- a/thirdparty/freetype/include/freetype/ftcid.h
+++ b/thirdparty/freetype/include/freetype/ftcid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing CID font information (specification). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* Dereg Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -87,7 +87,7 @@ FT_BEGIN_HEADER
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry,
const char* *ordering,
- FT_Int *supplement);
+ FT_Int *supplement );
/**********************************************************************
diff --git a/thirdparty/freetype/include/freetype/ftdriver.h b/thirdparty/freetype/include/freetype/ftdriver.h
new file mode 100644
index 0000000000..e90475b2af
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/ftdriver.h
@@ -0,0 +1,1225 @@
+/***************************************************************************/
+/* */
+/* ftdriver.h */
+/* */
+/* FreeType API for controlling driver modules (specification only). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTDRIVER_H_
+#define FTDRIVER_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_PARAMETER_TAGS_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * auto_hinter
+ *
+ * @title:
+ * The auto-hinter
+ *
+ * @abstract:
+ * Controlling the auto-hinting module.
+ *
+ * @description:
+ * While FreeType's auto-hinter doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * Note that the auto-hinter's module name is `autofitter' for
+ * historical reasons.
+ *
+ * Available properties are @increase-x-height, @no-stem-darkening
+ * (experimental), @darkening-parameters (experimental), @warping
+ * (experimental), @glyph-to-script-map (experimental), @fallback-script
+ * (experimental), and @default-script (experimental), as documented in
+ * the @properties section.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * cff_driver
+ *
+ * @title:
+ * The CFF driver
+ *
+ * @abstract:
+ * Controlling the CFF driver module.
+ *
+ * @description:
+ * While FreeType's CFF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get.
+ *
+ * The CFF driver's module name is `cff'.
+ *
+ * Available properties are @hinting-engine, @no-stem-darkening,
+ * @darkening-parameters, and @random-seed, as documented in the
+ * @properties section.
+ *
+ *
+ * *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine*
+ *
+ * The rasterizer is positioning horizontal features (e.g., ascender
+ * height & x-height, or crossbars) on the pixel grid and minimizing the
+ * amount of antialiasing applied to them, while placing vertical
+ * features (vertical stems) on the pixel grid without hinting, thus
+ * representing the stem position and weight accurately. Sometimes the
+ * vertical stems may be only partially black. In this context,
+ * `antialiasing' means that stems are not positioned exactly on pixel
+ * borders, causing a fuzzy appearance.
+ *
+ * There are two principles behind this approach.
+ *
+ * 1) No hinting in the horizontal direction: Unlike `superhinted'
+ * TrueType, which changes glyph widths to accommodate regular
+ * inter-glyph spacing, Adobe's approach is `faithful to the design' in
+ * representing both the glyph width and the inter-glyph spacing
+ * designed for the font. This makes the screen display as close as it
+ * can be to the result one would get with infinite resolution, while
+ * preserving what is considered the key characteristics of each glyph.
+ * Note that the distances between unhinted and grid-fitted positions at
+ * small sizes are comparable to kerning values and thus would be
+ * noticeable (and distracting) while reading if hinting were applied.
+ *
+ * One of the reasons to not hint horizontally is antialiasing for LCD
+ * screens: The pixel geometry of modern displays supplies three
+ * vertical subpixels as the eye moves horizontally across each visible
+ * pixel. On devices where we can be certain this characteristic is
+ * present a rasterizer can take advantage of the subpixels to add
+ * increments of weight. In Western writing systems this turns out to
+ * be the more critical direction anyway; the weights and spacing of
+ * vertical stems (see above) are central to Armenian, Cyrillic, Greek,
+ * and Latin type designs. Even when the rasterizer uses greyscale
+ * antialiasing instead of color (a necessary compromise when one
+ * doesn't know the screen characteristics), the unhinted vertical
+ * features preserve the design's weight and spacing much better than
+ * aliased type would.
+ *
+ * 2) Alignment in the vertical direction: Weights and spacing along the
+ * y~axis are less critical; what is much more important is the visual
+ * alignment of related features (like cap-height and x-height). The
+ * sense of alignment for these is enhanced by the sharpness of grid-fit
+ * edges, while the cruder vertical resolution (full pixels instead of
+ * 1/3 pixels) is less of a problem.
+ *
+ * On the technical side, horizontal alignment zones for ascender,
+ * x-height, and other important height values (traditionally called
+ * `blue zones') as defined in the font are positioned independently,
+ * each being rounded to the nearest pixel edge, taking care of
+ * overshoot suppression at small sizes, stem darkening, and scaling.
+ *
+ * Hstems (this is, hint values defined in the font to help align
+ * horizontal features) that fall within a blue zone are said to be
+ * `captured' and are aligned to that zone. Uncaptured stems are moved
+ * in one of four ways, top edge up or down, bottom edge up or down.
+ * Unless there are conflicting hstems, the smallest movement is taken
+ * to minimize distortion.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * pcf_driver
+ *
+ * @title:
+ * The PCF driver
+ *
+ * @abstract:
+ * Controlling the PCF driver module.
+ *
+ * @description:
+ * While FreeType's PCF driver doesn't expose API functions by itself,
+ * it is possible to control its behaviour with @FT_Property_Set and
+ * @FT_Property_Get. Right now, there is a single property
+ * @no-long-family-names available if FreeType is compiled with
+ * PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
+ *
+ * The PCF driver's module name is `pcf'.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * t1_cid_driver
+ *
+ * @title:
+ * The Type 1 and CID drivers
+ *
+ * @abstract:
+ * Controlling the Type~1 and CID driver modules.
+ *
+ * @description:
+ * It is possible to control the behaviour of FreeType's Type~1 and
+ * Type~1 CID drivers with @FT_Property_Set and @FT_Property_Get.
+ *
+ * Behind the scenes, both drivers use the Adobe CFF engine for hinting;
+ * however, the used properties must be specified separately.
+ *
+ * The Type~1 driver's module name is `type1'; the CID driver's module
+ * name is `t1cid'.
+ *
+ * Available properties are @hinting-engine, @no-stem-darkening,
+ * @darkening-parameters, and @random-seed, as documented in the
+ * @properties section.
+ *
+ * Please see the @cff_driver section for more details on the new
+ * hinting engine.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * tt_driver
+ *
+ * @title:
+ * The TrueType driver
+ *
+ * @abstract:
+ * Controlling the TrueType driver module.
+ *
+ * @description:
+ * While FreeType's TrueType driver doesn't expose API functions by
+ * itself, it is possible to control its behaviour with @FT_Property_Set
+ * and @FT_Property_Get. The following lists the available properties
+ * together with the necessary macros and structures.
+ *
+ * The TrueType driver's module name is `truetype'.
+ *
+ * A single property @interpreter-version is available, as documented in
+ * the @properties section.
+ *
+ * We start with a list of definitions, kindly provided by Greg
+ * Hitchcock.
+ *
+ * _Bi-Level_ _Rendering_
+ *
+ * Monochromatic rendering, exclusively used in the early days of
+ * TrueType by both Apple and Microsoft. Microsoft's GDI interface
+ * supported hinting of the right-side bearing point, such that the
+ * advance width could be non-linear. Most often this was done to
+ * achieve some level of glyph symmetry. To enable reasonable
+ * performance (e.g., not having to run hinting on all glyphs just to
+ * get the widths) there was a bit in the head table indicating if the
+ * side bearing was hinted, and additional tables, `hdmx' and `LTSH', to
+ * cache hinting widths across multiple sizes and device aspect ratios.
+ *
+ * _Font_ _Smoothing_
+ *
+ * Microsoft's GDI implementation of anti-aliasing. Not traditional
+ * anti-aliasing as the outlines were hinted before the sampling. The
+ * widths matched the bi-level rendering.
+ *
+ * _ClearType_ _Rendering_
+ *
+ * Technique that uses physical subpixels to improve rendering on LCD
+ * (and other) displays. Because of the higher resolution, many methods
+ * of improving symmetry in glyphs through hinting the right-side
+ * bearing were no longer necessary. This lead to what GDI calls
+ * `natural widths' ClearType, see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec21. Since hinting
+ * has extra resolution, most non-linearity went away, but it is still
+ * possible for hints to change the advance widths in this mode.
+ *
+ * _ClearType_ _Compatible_ _Widths_
+ *
+ * One of the earliest challenges with ClearType was allowing the
+ * implementation in GDI to be selected without requiring all UI and
+ * documents to reflow. To address this, a compatible method of
+ * rendering ClearType was added where the font hints are executed once
+ * to determine the width in bi-level rendering, and then re-run in
+ * ClearType, with the difference in widths being absorbed in the font
+ * hints for ClearType (mostly in the white space of hints); see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec20. Somewhat by
+ * definition, compatible width ClearType allows for non-linear widths,
+ * but only when the bi-level version has non-linear widths.
+ *
+ * _ClearType_ _Subpixel_ _Positioning_
+ *
+ * One of the nice benefits of ClearType is the ability to more crisply
+ * display fractional widths; unfortunately, the GDI model of integer
+ * bitmaps did not support this. However, the WPF and Direct Write
+ * frameworks do support fractional widths. DWrite calls this `natural
+ * mode', not to be confused with GDI's `natural widths'. Subpixel
+ * positioning, in the current implementation of Direct Write,
+ * unfortunately does not support hinted advance widths, see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec22. Note that the
+ * TrueType interpreter fully allows the advance width to be adjusted in
+ * this mode, just the DWrite client will ignore those changes.
+ *
+ * _ClearType_ _Backward_ _Compatibility_
+ *
+ * This is a set of exceptions made in the TrueType interpreter to
+ * minimize hinting techniques that were problematic with the extra
+ * resolution of ClearType; see
+ * http://www.beatstamm.com/typography/RTRCh4.htm#Sec1 and
+ * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
+ * This technique is not to be confused with ClearType compatible
+ * widths. ClearType backward compatibility has no direct impact on
+ * changing advance widths, but there might be an indirect impact on
+ * disabling some deltas. This could be worked around in backward
+ * compatibility mode.
+ *
+ * _Native_ _ClearType_ _Mode_
+ *
+ * (Not to be confused with `natural widths'.) This mode removes all
+ * the exceptions in the TrueType interpreter when running with
+ * ClearType. Any issues on widths would still apply, though.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * properties
+ *
+ * @title:
+ * Driver properties
+ *
+ * @abstract:
+ * Controlling driver modules.
+ *
+ * @description:
+ * Driver modules can be controlled by setting and unsetting properties,
+ * using the functions @FT_Property_Set and @FT_Property_Get. This
+ * section documents the available properties, together with auxiliary
+ * macros and structures.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_HINTING_XXX
+ *
+ * @description:
+ * A list of constants used for the @hinting-engine property to
+ * select the hinting engine for CFF, Type~1, and CID fonts.
+ *
+ * @values:
+ * FT_HINTING_FREETYPE ::
+ * Use the old FreeType hinting engine.
+ *
+ * FT_HINTING_ADOBE ::
+ * Use the hinting engine contributed by Adobe.
+ *
+ * @since:
+ * 2.9
+ *
+ */
+#define FT_HINTING_FREETYPE 0
+#define FT_HINTING_ADOBE 1
+
+ /* these constants (introduced in 2.4.12) are deprecated */
+#define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE
+#define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * hinting-engine
+ *
+ * @description:
+ * Thanks to Adobe, which contributed a new hinting (and parsing)
+ * engine, an application can select between `freetype' and `adobe' if
+ * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration
+ * macro isn't defined, `hinting-engine' does nothing.
+ *
+ * The same holds for the Type~1 and CID modules if compiled with
+ * T1_CONFIG_OPTION_OLD_ENGINE.
+ *
+ * For the `cff' module, the default engine is `freetype' if
+ * CFF_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe' otherwise.
+ *
+ * For both the `type1' and `t1cid' modules, the default engine is
+ * `freetype' if T1_CONFIG_OPTION_OLD_ENGINE is defined, and `adobe'
+ * otherwise.
+ *
+ * The following example code demonstrates how to select Adobe's hinting
+ * engine for the `cff' module (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "hinting-engine", &hinting_engine );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `adobe' or `freetype').
+ *
+ * @since:
+ * 2.4.12 (for `cff' module)
+ *
+ * 2.9 (for `type1' and `t1cid' modules)
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * no-stem-darkening
+ *
+ * @description:
+ * All glyphs that pass through the auto-hinter will be emboldened
+ * unless this property is set to TRUE. The same is true for the CFF,
+ * Type~1, and CID font modules if the `Adobe' engine is selected (which
+ * is the default).
+ *
+ * Stem darkening emboldens glyphs at smaller sizes to make them more
+ * readable on common low-DPI screens when using linear alpha blending
+ * and gamma correction, see @FT_Render_Glyph. When not using linear
+ * alpha blending and gamma correction, glyphs will appear heavy and
+ * fuzzy!
+ *
+ * Gamma correction essentially lightens fonts since shades of grey are
+ * shifted to higher pixel values (=~higher brightness) to match the
+ * original intention to the reality of our screens. The side-effect is
+ * that glyphs `thin out'. Mac OS~X and Adobe's proprietary font
+ * rendering library implement a counter-measure: stem darkening at
+ * smaller sizes where shades of gray dominate. By emboldening a glyph
+ * slightly in relation to its pixel size, individual pixels get higher
+ * coverage of filled-in outlines and are therefore `blacker'. This
+ * counteracts the `thinning out' of glyphs, making text remain readable
+ * at smaller sizes.
+ *
+ * By default, the Adobe engines for CFF, Type~1, and CID fonts darken
+ * stems at smaller sizes, regardless of hinting, to enhance contrast.
+ * Setting this property, stem darkening gets switched off.
+ *
+ * For the auto-hinter, stem-darkening is experimental currently and
+ * thus switched off by default (this is, `no-stem-darkening' is set to
+ * TRUE by default). Total consistency with the CFF driver is not
+ * achieved right now because the emboldening method differs and glyphs
+ * must be scaled down on the Y-axis to keep outline points inside their
+ * precomputed blue zones. The smaller the size (especially 9ppem and
+ * down), the higher the loss of emboldening versus the CFF driver.
+ *
+ * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is
+ * set.
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool no_stem_darkening = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "cff",
+ * "no-stem-darkening", &no_stem_darkening );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ * It can also be set per face using @FT_Face_Properties with
+ * @FT_PARAM_TAG_STEM_DARKENING.
+ *
+ * @since:
+ * 2.4.12 (for `cff' module)
+ *
+ * 2.6.2 (for `autofitter' module)
+ *
+ * 2.9 (for `type1' and `t1cid' modules)
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * darkening-parameters
+ *
+ * @description:
+ * By default, the Adobe hinting engine, as used by the CFF, Type~1, and
+ * CID font drivers, darkens stems as follows (if the
+ * `no-stem-darkening' property isn't set):
+ *
+ * {
+ * stem width <= 0.5px: darkening amount = 0.4px
+ * stem width = 1px: darkening amount = 0.275px
+ * stem width = 1.667px: darkening amount = 0.275px
+ * stem width >= 2.333px: darkening amount = 0px
+ * }
+ *
+ * and piecewise linear in-between. At configuration time, these four
+ * control points can be set with the macro
+ * `CFF_CONFIG_OPTION_DARKENING_PARAMETERS'; the CFF, Type~1, and CID
+ * drivers share these values. At runtime, the control points can be
+ * changed using the `darkening-parameters' property, as the following
+ * example demonstrates for the Type~1 driver.
+ *
+ * {
+ * FT_Library library;
+ * FT_Int darken_params[8] = { 500, 300, // x1, y1
+ * 1000, 200, // x2, y2
+ * 1500, 100, // x3, y3
+ * 2000, 0 }; // x4, y4
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "type1",
+ * "darkening-parameters", darken_params );
+ * }
+ *
+ * The x~values give the stem width, and the y~values the darkening
+ * amount. The unit is 1000th of pixels. All coordinate values must be
+ * positive; the x~values must be monotonically increasing; the
+ * y~values must be monotonically decreasing and smaller than or
+ * equal to 500 (corresponding to half a pixel); the slope of each
+ * linear piece must be shallower than -1 (e.g., -.4).
+ *
+ * The auto-hinter provides this property, too, as an experimental
+ * feature. See @no-stem-darkening for more.
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable, using eight comma-separated integers without spaces. Here
+ * the above example, using `\' to break the line for readability.
+ *
+ * {
+ * FREETYPE_PROPERTIES=\
+ * type1:darkening-parameters=500,300,1000,200,1500,100,2000,0
+ * }
+ *
+ * @since:
+ * 2.5.1 (for `cff' module)
+ *
+ * 2.6.2 (for `autofitter' module)
+ *
+ * 2.9 (for `type1' and `t1cid' modules)
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * random-seed
+ *
+ * @description:
+ * By default, the seed value for the CFF `random' operator and the
+ * similar `0 28 callothersubr pop' command for the Type~1 and CID
+ * drivers is set to a random value. However, mainly for debugging
+ * purposes, it is often necessary to use a known value as a seed so
+ * that the pseudo-random number sequences generated by `random' are
+ * repeatable.
+ *
+ * The `random-seed' property does that. Its argument is a signed 32bit
+ * integer; if the value is zero or negative, the seed given by the
+ * `intitialRandomSeed' private DICT operator in a CFF file gets used
+ * (or a default value if there is no such operator). If the value is
+ * positive, use it instead of `initialRandomSeed', which is
+ * consequently ignored.
+ *
+ * @note:
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable. It can also be set per face using @FT_Face_Properties with
+ * @FT_PARAM_TAG_RANDOM_SEED.
+ *
+ * @since:
+ * 2.8 (for `cff' module)
+ *
+ * 2.9 (for `type1' and `t1cid' modules)
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * no-long-family-names
+ *
+ * @description:
+ * If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling
+ * FreeType, the PCF driver constructs long family names.
+ *
+ * There are many PCF fonts just called `Fixed' which look completely
+ * different, and which have nothing to do with each other. When
+ * selecting `Fixed' in KDE or Gnome one gets results that appear rather
+ * random, the style changes often if one changes the size and one
+ * cannot select some fonts at all. The improve this situation, the PCF
+ * module prepends the foundry name (plus a space) to the family name.
+ * It also checks whether there are `wide' characters; all put together,
+ * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed.
+ *
+ * If `no-long-family-names' is set, this feature gets switched off.
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool no_long_family_names = TRUE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "pcf",
+ * "no-long-family-names",
+ * &no_long_family_names );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ *
+ * @since:
+ * 2.8
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * TT_INTERPRETER_VERSION_XXX
+ *
+ * @description:
+ * A list of constants used for the @interpreter-version property to
+ * select the hinting engine for Truetype fonts.
+ *
+ * The numeric value in the constant names represents the version
+ * number as returned by the `GETINFO' bytecode instruction.
+ *
+ * @values:
+ * TT_INTERPRETER_VERSION_35 ::
+ * Version~35 corresponds to MS rasterizer v.1.7 as used e.g. in
+ * Windows~98; only grayscale and B/W rasterizing is supported.
+ *
+ * TT_INTERPRETER_VERSION_38 ::
+ * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
+ * equivalent to the hinting provided by DirectWrite ClearType (as can
+ * be found, for example, in the Internet Explorer~9 running on
+ * Windows~7). It is used in FreeType to select the `Infinality'
+ * subpixel hinting code. The code may be removed in a future
+ * version.
+ *
+ * TT_INTERPRETER_VERSION_40 ::
+ * Version~40 corresponds to MS rasterizer v.2.1; it is roughly
+ * equivalent to the hinting provided by DirectWrite ClearType (as can
+ * be found, for example, in Microsoft's Edge Browser on Windows~10).
+ * It is used in FreeType to select the `minimal' subpixel hinting
+ * code, a stripped-down and higher performance version of the
+ * `Infinality' code.
+ *
+ * @note:
+ * This property controls the behaviour of the bytecode interpreter
+ * and thus how outlines get hinted. It does *not* control how glyph
+ * get rasterized! In particular, it does not control subpixel color
+ * filtering.
+ *
+ * If FreeType has not been compiled with the configuration option
+ * TT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 or~40 causes
+ * an `FT_Err_Unimplemented_Feature' error.
+ *
+ * Depending on the graphics framework, Microsoft uses different
+ * bytecode and rendering engines. As a consequence, the version
+ * numbers returned by a call to the `GETINFO' bytecode instruction are
+ * more convoluted than desired.
+ *
+ * Here are two tables that try to shed some light on the possible
+ * values for the MS rasterizer engine, together with the additional
+ * features introduced by it.
+ *
+ * {
+ * GETINFO framework version feature
+ * -------------------------------------------------------------------
+ * 3 GDI (Win 3.1), v1.0 16-bit, first version
+ * TrueImage
+ * 33 GDI (Win NT 3.1), v1.5 32-bit
+ * HP Laserjet
+ * 34 GDI (Win 95) v1.6 font smoothing,
+ * new SCANTYPE opcode
+ * 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET
+ * bits in composite glyphs
+ * 36 MGDI (Win CE 2) v1.6+ classic ClearType
+ * 37 GDI (XP and later), v1.8 ClearType
+ * GDI+ old (before Vista)
+ * 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType,
+ * WPF Y-direction ClearType,
+ * additional error checking
+ * 39 DWrite (before Win 8) v2.0 subpixel ClearType flags
+ * in GETINFO opcode,
+ * bug fixes
+ * 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag
+ * DWrite (Win 8) in GETINFO opcode,
+ * Gray ClearType
+ * }
+ *
+ * The `version' field gives a rough orientation only, since some
+ * applications provided certain features much earlier (as an example,
+ * Microsoft Reader used subpixel and Y-direction ClearType already in
+ * Windows 2000). Similarly, updates to a given framework might include
+ * improved hinting support.
+ *
+ * {
+ * version sampling rendering comment
+ * x y x y
+ * --------------------------------------------------------------
+ * v1.0 normal normal B/W B/W bi-level
+ * v1.6 high high gray gray grayscale
+ * v1.8 high normal color-filter B/W (GDI) ClearType
+ * v1.9 high high color-filter gray Color ClearType
+ * v2.1 high normal gray B/W Gray ClearType
+ * v2.1 high high gray gray Gray ClearType
+ * }
+ *
+ * Color and Gray ClearType are the two available variants of
+ * `Y-direction ClearType', meaning grayscale rasterization along the
+ * Y-direction; the name used in the TrueType specification for this
+ * feature is `symmetric smoothing'. `Classic ClearType' is the
+ * original algorithm used before introducing a modified version in
+ * Win~XP. Another name for v1.6's grayscale rendering is `font
+ * smoothing', and `Color ClearType' is sometimes also called `DWrite
+ * ClearType'. To differentiate between today's Color ClearType and the
+ * earlier ClearType variant with B/W rendering along the vertical axis,
+ * the latter is sometimes called `GDI ClearType'.
+ *
+ * `Normal' and `high' sampling describe the (virtual) resolution to
+ * access the rasterized outline after the hinting process. `Normal'
+ * means 1 sample per grid line (i.e., B/W). In the current Microsoft
+ * implementation, `high' means an extra virtual resolution of 16x16 (or
+ * 16x1) grid lines per pixel for bytecode instructions like `MIRP'.
+ * After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid
+ * lines for color filtering if Color ClearType is activated.
+ *
+ * Note that `Gray ClearType' is essentially the same as v1.6's
+ * grayscale rendering. However, the GETINFO instruction handles it
+ * differently: v1.6 returns bit~12 (hinting for grayscale), while v2.1
+ * returns bits~13 (hinting for ClearType), 18 (symmetrical smoothing),
+ * and~19 (Gray ClearType). Also, this mode respects bits 2 and~3 for
+ * the version~1 gasp table exclusively (like Color ClearType), while
+ * v1.6 only respects the values of version~0 (bits 0 and~1).
+ *
+ * Keep in mind that the features of the above interpreter versions
+ * might not map exactly to FreeType features or behavior because it is
+ * a fundamentally different library with different internals.
+ *
+ */
+#define TT_INTERPRETER_VERSION_35 35
+#define TT_INTERPRETER_VERSION_38 38
+#define TT_INTERPRETER_VERSION_40 40
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * interpreter-version
+ *
+ * @description:
+ * Currently, three versions are available, two representing the
+ * bytecode interpreter with subpixel hinting support (old `Infinality'
+ * code and new stripped-down and higher performance `minimal' code) and
+ * one without, respectively. The default is subpixel support if
+ * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support
+ * otherwise (since it isn't available then).
+ *
+ * If subpixel hinting is on, many TrueType bytecode instructions behave
+ * differently compared to B/W or grayscale rendering (except if `native
+ * ClearType' is selected by the font). Microsoft's main idea is to
+ * render at a much increased horizontal resolution, then sampling down
+ * the created output to subpixel precision. However, many older fonts
+ * are not suited to this and must be specially taken care of by
+ * applying (hardcoded) tweaks in Microsoft's interpreter.
+ *
+ * Details on subpixel hinting and some of the necessary tweaks can be
+ * found in Greg Hitchcock's whitepaper at
+ * `https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
+ * Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2,
+ * or 6x5 supersampling) like discussed in the paper. Depending on the
+ * chosen interpreter, it simply ignores instructions on vertical stems
+ * to arrive at very similar results.
+ *
+ * The following example code demonstrates how to deactivate subpixel
+ * hinting (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "truetype",
+ * "interpreter-version",
+ * &interpreter_version );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values `35', `38', or `40').
+ *
+ * @since:
+ * 2.5
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * glyph-to-script-map
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * The auto-hinter provides various script modules to hint glyphs.
+ * Examples of supported scripts are Latin or CJK. Before a glyph is
+ * auto-hinted, the Unicode character map of the font gets examined, and
+ * the script is then determined based on Unicode character ranges, see
+ * below.
+ *
+ * OpenType fonts, however, often provide much more glyphs than
+ * character codes (small caps, superscripts, ligatures, swashes, etc.),
+ * to be controlled by so-called `features'. Handling OpenType features
+ * can be quite complicated and thus needs a separate library on top of
+ * FreeType.
+ *
+ * The mapping between glyph indices and scripts (in the auto-hinter
+ * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an
+ * array with `num_glyphs' elements, as found in the font's @FT_Face
+ * structure. The `glyph-to-script-map' property returns a pointer to
+ * this array, which can be modified as needed. Note that the
+ * modification should happen before the first glyph gets processed by
+ * the auto-hinter so that the global analysis of the font shapes
+ * actually uses the modified mapping.
+ *
+ * The following example code demonstrates how to access it (omitting
+ * the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_GlyphToScriptMap prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ *
+ * prop.face = face;
+ *
+ * FT_Property_Get( library, "autofitter",
+ * "glyph-to-script-map", &prop );
+ *
+ * // adjust `prop.map' as needed right here
+ *
+ * FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
+ * }
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_AUTOHINTER_SCRIPT_XXX
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * A list of constants used for the @glyph-to-script-map property to
+ * specify the script submodule the auto-hinter should use for hinting a
+ * particular glyph.
+ *
+ * @values:
+ * FT_AUTOHINTER_SCRIPT_NONE ::
+ * Don't auto-hint this glyph.
+ *
+ * FT_AUTOHINTER_SCRIPT_LATIN ::
+ * Apply the latin auto-hinter. For the auto-hinter, `latin' is a
+ * very broad term, including Cyrillic and Greek also since characters
+ * from those scripts share the same design constraints.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0020 - U+007F // Basic Latin (no control characters)
+ * U+00A0 - U+00FF // Latin-1 Supplement (no control characters)
+ * U+0100 - U+017F // Latin Extended-A
+ * U+0180 - U+024F // Latin Extended-B
+ * U+0250 - U+02AF // IPA Extensions
+ * U+02B0 - U+02FF // Spacing Modifier Letters
+ * U+0300 - U+036F // Combining Diacritical Marks
+ * U+0370 - U+03FF // Greek and Coptic
+ * U+0400 - U+04FF // Cyrillic
+ * U+0500 - U+052F // Cyrillic Supplement
+ * U+1D00 - U+1D7F // Phonetic Extensions
+ * U+1D80 - U+1DBF // Phonetic Extensions Supplement
+ * U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement
+ * U+1E00 - U+1EFF // Latin Extended Additional
+ * U+1F00 - U+1FFF // Greek Extended
+ * U+2000 - U+206F // General Punctuation
+ * U+2070 - U+209F // Superscripts and Subscripts
+ * U+20A0 - U+20CF // Currency Symbols
+ * U+2150 - U+218F // Number Forms
+ * U+2460 - U+24FF // Enclosed Alphanumerics
+ * U+2C60 - U+2C7F // Latin Extended-C
+ * U+2DE0 - U+2DFF // Cyrillic Extended-A
+ * U+2E00 - U+2E7F // Supplemental Punctuation
+ * U+A640 - U+A69F // Cyrillic Extended-B
+ * U+A720 - U+A7FF // Latin Extended-D
+ * U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures)
+ * U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
+ * U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_CJK ::
+ * Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old
+ * Vietnamese, and some other scripts.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+1100 - U+11FF // Hangul Jamo
+ * U+2E80 - U+2EFF // CJK Radicals Supplement
+ * U+2F00 - U+2FDF // Kangxi Radicals
+ * U+2FF0 - U+2FFF // Ideographic Description Characters
+ * U+3000 - U+303F // CJK Symbols and Punctuation
+ * U+3040 - U+309F // Hiragana
+ * U+30A0 - U+30FF // Katakana
+ * U+3100 - U+312F // Bopomofo
+ * U+3130 - U+318F // Hangul Compatibility Jamo
+ * U+3190 - U+319F // Kanbun
+ * U+31A0 - U+31BF // Bopomofo Extended
+ * U+31C0 - U+31EF // CJK Strokes
+ * U+31F0 - U+31FF // Katakana Phonetic Extensions
+ * U+3200 - U+32FF // Enclosed CJK Letters and Months
+ * U+3300 - U+33FF // CJK Compatibility
+ * U+3400 - U+4DBF // CJK Unified Ideographs Extension A
+ * U+4DC0 - U+4DFF // Yijing Hexagram Symbols
+ * U+4E00 - U+9FFF // CJK Unified Ideographs
+ * U+A960 - U+A97F // Hangul Jamo Extended-A
+ * U+AC00 - U+D7AF // Hangul Syllables
+ * U+D7B0 - U+D7FF // Hangul Jamo Extended-B
+ * U+F900 - U+FAFF // CJK Compatibility Ideographs
+ * U+FE10 - U+FE1F // Vertical forms
+ * U+FE30 - U+FE4F // CJK Compatibility Forms
+ * U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms
+ * U+1B000 - U+1B0FF // Kana Supplement
+ * U+1D300 - U+1D35F // Tai Xuan Hing Symbols
+ * U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
+ * U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
+ * U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
+ * U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
+ * U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
+ * }
+ *
+ * FT_AUTOHINTER_SCRIPT_INDIC ::
+ * Apply the indic auto-hinter, covering all major scripts from the
+ * Indian sub-continent and some other related scripts like Thai, Lao,
+ * or Tibetan.
+ *
+ * By default, characters from the following Unicode ranges are
+ * assigned to this submodule.
+ *
+ * {
+ * U+0900 - U+0DFF // Indic Range
+ * U+0F00 - U+0FFF // Tibetan
+ * U+1900 - U+194F // Limbu
+ * U+1B80 - U+1BBF // Sundanese
+ * U+A800 - U+A82F // Syloti Nagri
+ * U+ABC0 - U+ABFF // Meetei Mayek
+ * U+11800 - U+118DF // Sharada
+ * }
+ *
+ * Note that currently Indic support is rudimentary only, missing blue
+ * zone support.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+#define FT_AUTOHINTER_SCRIPT_NONE 0
+#define FT_AUTOHINTER_SCRIPT_LATIN 1
+#define FT_AUTOHINTER_SCRIPT_CJK 2
+#define FT_AUTOHINTER_SCRIPT_INDIC 3
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_GlyphToScriptMap
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * The data exchange structure for the @glyph-to-script-map property.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+ typedef struct FT_Prop_GlyphToScriptMap_
+ {
+ FT_Face face;
+ FT_UShort* map;
+
+ } FT_Prop_GlyphToScriptMap;
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * fallback-script
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If no auto-hinter script module can be assigned to a glyph, a
+ * fallback script gets assigned to it (see also the
+ * @glyph-to-script-map property). By default, this is
+ * @FT_AUTOHINTER_SCRIPT_CJK. Using the `fallback-script' property,
+ * this fallback value can be changed.
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "fallback-script", &fallback_script );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * It's important to use the right timing for changing this value: The
+ * creation of the glyph-to-script map that eventually uses the
+ * fallback script value gets triggered either by setting or reading a
+ * face-specific property like @glyph-to-script-map, or by auto-hinting
+ * any glyph from that face. In particular, if you have already created
+ * an @FT_Face structure but not loaded any glyph (using the
+ * auto-hinter), a change of the fallback script will affect this face.
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * default-script
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make
+ * the HarfBuzz library access OpenType features for getting better
+ * glyph coverages, this property sets the (auto-fitter) script to be
+ * used for the default (OpenType) script data of a font's GSUB table.
+ * Features for the default script are intended for all scripts not
+ * explicitly handled in GSUB; an example is a `dlig' feature,
+ * containing the combination of the characters `T', `E', and `L' to
+ * form a `TEL' ligature.
+ *
+ * By default, this is @FT_AUTOHINTER_SCRIPT_LATIN. Using the
+ * `default-script' property, this default value can be changed.
+ *
+ * {
+ * FT_Library library;
+ * FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "default-script", &default_script );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * It's important to use the right timing for changing this value: The
+ * creation of the glyph-to-script map that eventually uses the
+ * default script value gets triggered either by setting or reading a
+ * face-specific property like @glyph-to-script-map, or by auto-hinting
+ * any glyph from that face. In particular, if you have already created
+ * an @FT_Face structure but not loaded any glyph (using the
+ * auto-hinter), a change of the default script will affect this face.
+ *
+ * @since:
+ * 2.5.3
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * increase-x-height
+ *
+ * @description:
+ * For ppem values in the range 6~<= ppem <= `increase-x-height', round
+ * up the font's x~height much more often than normally. If the value
+ * is set to~0, which is the default, this feature is switched off. Use
+ * this property to improve the legibility of small font sizes if
+ * necessary.
+ *
+ * {
+ * FT_Library library;
+ * FT_Face face;
+ * FT_Prop_IncreaseXHeight prop;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ * FT_New_Face( library, "foo.ttf", 0, &face );
+ * FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
+ *
+ * prop.face = face;
+ * prop.limit = 14;
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "increase-x-height", &prop );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * Set this value right after calling @FT_Set_Char_Size, but before
+ * loading any glyph (using the auto-hinter).
+ *
+ * @since:
+ * 2.4.11
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Prop_IncreaseXHeight
+ *
+ * @description:
+ * The data exchange structure for the @increase-x-height property.
+ *
+ */
+ typedef struct FT_Prop_IncreaseXHeight_
+ {
+ FT_Face face;
+ FT_UInt limit;
+
+ } FT_Prop_IncreaseXHeight;
+
+
+ /**************************************************************************
+ *
+ * @property:
+ * warping
+ *
+ * @description:
+ * *Experimental* *only*
+ *
+ * If FreeType gets compiled with option AF_CONFIG_OPTION_USE_WARPER to
+ * activate the warp hinting code in the auto-hinter, this property
+ * switches warping on and off.
+ *
+ * Warping only works in `normal' auto-hinting mode replacing it.
+ * The idea of the code is to slightly scale and shift a glyph along
+ * the non-hinted dimension (which is usually the horizontal axis) so
+ * that as much of its segments are aligned (more or less) to the grid.
+ * To find out a glyph's optimal scaling and shifting value, various
+ * parameter combinations are tried and scored.
+ *
+ * By default, warping is off. The example below shows how to switch on
+ * warping (omitting the error handling).
+ *
+ * {
+ * FT_Library library;
+ * FT_Bool warping = 1;
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "autofitter",
+ * "warping", &warping );
+ * }
+ *
+ * @note:
+ * This property can be used with @FT_Property_Get also.
+ *
+ * This property can be set via the `FREETYPE_PROPERTIES' environment
+ * variable (using values 1 and 0 for `on' and `off', respectively).
+ *
+ * The warping code can also change advance widths. Have a look at the
+ * `lsb_delta' and `rsb_delta' fields in the @FT_GlyphSlotRec structure
+ * for details on improving inter-glyph distances while rendering.
+ *
+ * Since warping is a global property of the auto-hinter it is best to
+ * change its value before rendering any face. Otherwise, you should
+ * reload all faces that get auto-hinted in `normal' hinting mode.
+ *
+ * @since:
+ * 2.6
+ *
+ */
+
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* FTDRIVER_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/fterrdef.h b/thirdparty/freetype/include/freetype/fterrdef.h
index 6a6dc85b87..8ffd346ca8 100644
--- a/thirdparty/freetype/include/freetype/fterrdef.h
+++ b/thirdparty/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error codes (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/fterrors.h b/thirdparty/freetype/include/freetype/fterrors.h
index ae382c419f..f6ee5c24e2 100644
--- a/thirdparty/freetype/include/freetype/fterrors.h
+++ b/thirdparty/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
/* */
/* FreeType error code handling (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftfntfmt.h b/thirdparty/freetype/include/freetype/ftfntfmt.h
index 337758328a..cc86efac23 100644
--- a/thirdparty/freetype/include/freetype/ftfntfmt.h
+++ b/thirdparty/freetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* Support functions for font formats. */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftgasp.h b/thirdparty/freetype/include/freetype/ftgasp.h
index ce18d64784..fc1248ff48 100644
--- a/thirdparty/freetype/include/freetype/ftgasp.h
+++ b/thirdparty/freetype/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (specification). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -29,6 +29,9 @@
#endif
+FT_BEGIN_HEADER
+
+
/***************************************************************************
*
* @section:
@@ -131,6 +134,8 @@
/* */
+FT_END_HEADER
+
#endif /* FTGASP_H_ */
diff --git a/thirdparty/freetype/include/freetype/ftglyph.h b/thirdparty/freetype/include/freetype/ftglyph.h
index db1a2c8ba5..5f3fc009cd 100644
--- a/thirdparty/freetype/include/freetype/ftglyph.h
+++ b/thirdparty/freetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -347,10 +347,10 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return a glyph's `control box'. The control box encloses all the */
- /* outline's points, including Bézier control points. Though it */
+ /* outline's points, including Bezier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
- /* that contains Bézier outside arcs). */
+ /* that contains Bezier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
diff --git a/thirdparty/freetype/include/freetype/ftgxval.h b/thirdparty/freetype/include/freetype/ftgxval.h
index f239c71eb1..8382d59954 100644
--- a/thirdparty/freetype/include/freetype/ftgxval.h
+++ b/thirdparty/freetype/include/freetype/ftgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
@@ -101,15 +101,15 @@ FT_BEGIN_HEADER
* The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/
-#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
+#define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 )
/* */
/* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */
-#define FT_VALIDATE_GX_START 0x4000
-#define FT_VALIDATE_GX_BITFIELD( tag ) \
- ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
+#define FT_VALIDATE_GX_START 0x4000
+#define FT_VALIDATE_GX_BITFIELD( tag ) \
+ ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/**********************************************************************
diff --git a/thirdparty/freetype/include/freetype/ftgzip.h b/thirdparty/freetype/include/freetype/ftgzip.h
index bd5ceaab9f..db033da0ed 100644
--- a/thirdparty/freetype/include/freetype/ftgzip.h
+++ b/thirdparty/freetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
/* */
/* Gzip-compressed stream support. */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -129,6 +129,9 @@ FT_BEGIN_HEADER
* @note:
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support.
+ *
+ * @since:
+ * 2.5.1
*/
FT_EXPORT( FT_Error )
FT_Gzip_Uncompress( FT_Memory memory,
diff --git a/thirdparty/freetype/include/freetype/ftimage.h b/thirdparty/freetype/include/freetype/ftimage.h
index 1c789e5a44..79ede1959d 100644
--- a/thirdparty/freetype/include/freetype/ftimage.h
+++ b/thirdparty/freetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -169,13 +169,13 @@ FT_BEGIN_HEADER
/* @FT_RENDER_MODE_LCD_V. */
/* */
/* FT_PIXEL_MODE_BGRA :: */
- /* An image with four 8-bit channels per pixel, representing a */
- /* color image (such as emoticons) with alpha channel. For each */
- /* pixel, the format is BGRA, which means, the blue channel comes */
- /* first in memory. The color channels are pre-multiplied and in */
- /* the sRGB colorspace. For example, full red at half-translucent */
- /* opacity will be represented as `00,00,80,80', not `00,00,FF,80'. */
- /* See also @FT_LOAD_COLOR. */
+ /* [Since 2.5] An image with four 8-bit channels per pixel, */
+ /* representing a color image (such as emoticons) with alpha */
+ /* channel. For each pixel, the format is BGRA, which means, the */
+ /* blue channel comes first in memory. The color channels are */
+ /* pre-multiplied and in the sRGB colorspace. For example, full */
+ /* red at half-translucent opacity will be represented as */
+ /* `00,00,80,80', not `00,00,FF,80'. See also @FT_LOAD_COLOR. */
/* */
typedef enum FT_Pixel_Mode_
{
@@ -301,11 +301,11 @@ FT_BEGIN_HEADER
/* each outline point's type. */
/* */
/* If bit~0 is unset, the point is `off' the curve, */
- /* i.e., a Bézier control point, while it is `on' if */
+ /* i.e., a Bezier control point, while it is `on' if */
/* set. */
/* */
/* Bit~1 is meaningful for `off' points only. If set, */
- /* it indicates a third-order Bézier arc control point; */
+ /* it indicates a third-order Bezier arc control point; */
/* and a second-order control point if unset. */
/* */
/* If bit~2 is set, bits 5-7 contain the drop-out mode */
@@ -532,7 +532,7 @@ FT_BEGIN_HEADER
/* A function pointer type used to describe the signature of a `conic */
/* to' function during outline walking or decomposition. */
/* */
- /* A `conic to' is emitted to indicate a second-order Bézier arc in */
+ /* A `conic to' is emitted to indicate a second-order Bezier arc in */
/* the outline. */
/* */
/* <Input> */
@@ -564,12 +564,12 @@ FT_BEGIN_HEADER
/* A function pointer type used to describe the signature of a `cubic */
/* to' function during outline walking or decomposition. */
/* */
- /* A `cubic to' is emitted to indicate a third-order Bézier arc. */
+ /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
/* */
/* <Input> */
- /* control1 :: A pointer to the first Bézier control point. */
+ /* control1 :: A pointer to the first Bezier control point. */
/* */
- /* control2 :: A pointer to the second Bézier control point. */
+ /* control2 :: A pointer to the second Bezier control point. */
/* */
/* to :: A pointer to the target end point. */
/* */
@@ -595,16 +595,16 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* A structure to hold various function pointers used during outline */
- /* decomposition in order to emit segments, conic, and cubic Béziers. */
+ /* decomposition in order to emit segments, conic, and cubic Beziers. */
/* */
/* <Fields> */
/* move_to :: The `move to' emitter. */
/* */
/* line_to :: The segment emitter. */
/* */
- /* conic_to :: The second-order Bézier arc emitter. */
+ /* conic_to :: The second-order Bezier arc emitter. */
/* */
- /* cubic_to :: The third-order Bézier arc emitter. */
+ /* cubic_to :: The third-order Bezier arc emitter. */
/* */
/* shift :: The shift that is applied to coordinates before they */
/* are sent to the emitter. */
@@ -701,7 +701,7 @@ FT_BEGIN_HEADER
/* */
/* FT_GLYPH_FORMAT_OUTLINE :: */
/* The glyph image is a vectorial outline made of line segments */
- /* and Bézier arcs; it can be described as an @FT_Outline; you */
+ /* and Bezier arcs; it can be described as an @FT_Outline; you */
/* generally want to access the `outline' field of the */
/* @FT_GlyphSlotRec structure to read it. */
/* */
diff --git a/thirdparty/freetype/include/freetype/ftincrem.h b/thirdparty/freetype/include/freetype/ftincrem.h
index f6ae2baed6..44619f941e 100644
--- a/thirdparty/freetype/include/freetype/ftincrem.h
+++ b/thirdparty/freetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType incremental loading (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,6 +21,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@@ -331,18 +332,6 @@ FT_BEGIN_HEADER
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_INCREMENTAL
- *
- * @description:
- * A constant used as the tag of @FT_Parameter structures to indicate
- * an incremental loading object to be used by FreeType.
- *
- */
-#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
-
/* */
diff --git a/thirdparty/freetype/include/freetype/ftlcdfil.h b/thirdparty/freetype/include/freetype/ftlcdfil.h
index bdaf9af906..2a27196cbb 100644
--- a/thirdparty/freetype/include/freetype/ftlcdfil.h
+++ b/thirdparty/freetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
/* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@@ -280,23 +281,6 @@ FT_BEGIN_HEADER
unsigned char *weights );
- /**************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_LCD_FILTER_WEIGHTS
- *
- * @description:
- * An @FT_Parameter tag to be used with @FT_Face_Properties. The
- * corresponding argument specifies the five LCD filter weights for a
- * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
- * the global default values or the values set up with
- * @FT_Library_SetLcdFilterWeights.
- *
- */
-#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
- FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
-
-
/*
* @type:
* FT_LcdFiveTapFilter
@@ -305,6 +289,9 @@ FT_BEGIN_HEADER
* A typedef for passing the five LCD filter weights to
* @FT_Face_Properties within an @FT_Parameter structure.
*
+ * @since:
+ * 2.8
+ *
*/
#define FT_LCD_FILTER_FIVE_TAPS 5
diff --git a/thirdparty/freetype/include/freetype/ftlist.h b/thirdparty/freetype/include/freetype/ftlist.h
index 5309cb18ba..117473b96a 100644
--- a/thirdparty/freetype/include/freetype/ftlist.h
+++ b/thirdparty/freetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftlzw.h b/thirdparty/freetype/include/freetype/ftlzw.h
index a82c95e7c9..1615912d62 100644
--- a/thirdparty/freetype/include/freetype/ftlzw.h
+++ b/thirdparty/freetype/include/freetype/ftlzw.h
@@ -4,7 +4,7 @@
/* */
/* LZW-compressed stream support. */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftmac.h b/thirdparty/freetype/include/freetype/ftmac.h
index a1656eec0e..c1e497ca2d 100644
--- a/thirdparty/freetype/include/freetype/ftmac.h
+++ b/thirdparty/freetype/include/freetype/ftmac.h
@@ -4,7 +4,7 @@
/* */
/* Additional Mac-specific API. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftmm.h b/thirdparty/freetype/include/freetype/ftmm.h
index 80ac98d612..9948102c14 100644
--- a/thirdparty/freetype/include/freetype/ftmm.h
+++ b/thirdparty/freetype/include/freetype/ftmm.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Multiple Master font interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -286,7 +286,7 @@ FT_BEGIN_HEADER
/* <Output> */
/* amaster :: The variation descriptor. */
/* Allocates a data structure, which the user must */
- /* deallocate with `free' after use. */
+ /* deallocate with a call to @FT_Done_MM_Var after use. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
@@ -299,6 +299,26 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
+ /* FT_Done_MM_Var */
+ /* */
+ /* <Description> */
+ /* Free the memory allocated by @FT_Get_MM_Var. */
+ /* */
+ /* <Input> */
+ /* library :: A handle of the face's parent library object that was */
+ /* used in the call to @FT_Get_MM_Var to create `amaster'. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_MM_Var( FT_Library library,
+ FT_MM_Var *amaster );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
@@ -323,9 +343,13 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
- /* To reset all axes to the default values, call the function with */
- /* `num_coords' set to zero and `coords' set to NULL (new feature in */
- /* FreeType version 2.8.1). */
+ /* [Since 2.8.1] To reset all axes to the default values, call the */
+ /* function with `num_coords' set to zero and `coords' set to NULL. */
+ /* */
+ /* [Since 2.9] If `num_coords' is larger than zero, this function */
+ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
+ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
+ /* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
@@ -358,9 +382,15 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
- /* To reset all axes to the default values, call the function with */
- /* `num_coords' set to zero and `coords' set to NULL (new feature in */
- /* FreeType version 2.8.1). */
+ /* [Since 2.8.1] To reset all axes to the default values, call the */
+ /* function with `num_coords' set to zero and `coords' set to NULL. */
+ /* [Since 2.9] `Default values' means the currently selected named */
+ /* instance (or the base font if no named instance is selected). */
+ /* */
+ /* [Since 2.9] If `num_coords' is larger than zero, this function */
+ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
+ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
+ /* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
@@ -392,6 +422,9 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Since> */
+ /* 2.7.1 */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
@@ -427,9 +460,15 @@ FT_BEGIN_HEADER
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
- /* To reset all axes to the default values, call the function with */
- /* `num_coords' set to zero and `coords' set to NULL (new feature in */
- /* FreeType version 2.8.1). */
+ /* [Since 2.8.1] To reset all axes to the default values, call the */
+ /* function with `num_coords' set to zero and `coords' set to NULL. */
+ /* [Since 2.9] `Default values' means the currently selected named */
+ /* instance (or the base font if no named instance is selected). */
+ /* */
+ /* [Since 2.9] If `num_coords' is larger than zero, this function */
+ /* sets the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags' */
+ /* field (i.e., @FT_IS_VARIATION will return true). If `num_coords' */
+ /* is zero, this bit flag gets unset. */
/* */
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
@@ -462,6 +501,9 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Since> */
+ /* 2.7.1 */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
@@ -490,6 +532,9 @@ FT_BEGIN_HEADER
/* <Description> */
/* This is another name of @FT_Get_MM_Blend_Coordinates. */
/* */
+ /* <Since> */
+ /* 2.7.1 */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
@@ -509,6 +554,9 @@ FT_BEGIN_HEADER
/* FT_VAR_AXIS_FLAG_HIDDEN :: */
/* The variation axis should not be exposed to user interfaces. */
/* */
+ /* <Since> */
+ /* 2.8.1 */
+ /* */
#define FT_VAR_AXIS_FLAG_HIDDEN 1
@@ -534,11 +582,51 @@ FT_BEGIN_HEADER
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
+ /* <Since> */
+ /* 2.8.1 */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Var_Axis_Flags( FT_MM_Var* master,
FT_UInt axis_index,
FT_UInt* flags );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Named_Instance */
+ /* */
+ /* <Description> */
+ /* Set or change the current named instance. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* instance_index :: The index of the requested instance, starting */
+ /* with value 1. If set to value 0, FreeType */
+ /* switches to font access without a named */
+ /* instance. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ /* <Note> */
+ /* The function uses the value of `instance_index' to set bits 16-30 */
+ /* of the face's `face_index' field. It also resets any variation */
+ /* applied to the font, and the @FT_FACE_FLAG_VARIATION bit of the */
+ /* face's `face_flags' field gets reset to zero (i.e., */
+ /* @FT_IS_VARIATION will return false). */
+ /* */
+ /* For Adobe MM fonts (which don't have named instances) this */
+ /* function simply resets the current face to the default instance. */
+ /* */
+ /* <Since> */
+ /* 2.9 */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Named_Instance( FT_Face face,
+ FT_UInt instance_index );
+
/* */
diff --git a/thirdparty/freetype/include/freetype/ftmodapi.h b/thirdparty/freetype/include/freetype/ftmodapi.h
index 4147aadf8b..a6eb876ebe 100644
--- a/thirdparty/freetype/include/freetype/ftmodapi.h
+++ b/thirdparty/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
/* */
/* FreeType modules public interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -323,16 +323,15 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
+ * The property name. Properties are described in section
+ * @properties.
*
* Note that only a few modules have properties.
*
* value ::
* A generic pointer to a variable or structure that gives the new
* value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
+ * dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@@ -390,15 +389,14 @@ FT_BEGIN_HEADER
* The module name.
*
* property_name ::
- * The property name. Properties are described in the `Synopsis'
- * subsection of the module's documentation.
+ * The property name. Properties are described in section
+ * @properties.
*
* @inout:
* value ::
* A generic pointer to a variable or structure that gives the
* value of the property. The exact definition of `value' is
- * dependent on the property; see the `Synopsis' subsection of the
- * module's documentation.
+ * dependent on the property; see section @properties.
*
* @return:
* FreeType error code. 0~means success.
@@ -446,8 +444,8 @@ FT_BEGIN_HEADER
/* <Description> */
/* If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is */
/* set, this function reads the `FREETYPE_PROPERTIES' environment */
- /* variable to control driver properties. See sections @auto_hinter, */
- /* @cff_driver, @pcf_driver, and @tt_driver for more. */
+ /* variable to control driver properties. See section @properties */
+ /* for more. */
/* */
/* If the compilation option is not set, this function does nothing. */
/* */
@@ -475,6 +473,9 @@ FT_BEGIN_HEADER
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
+ /* <Since> */
+ /* 2.8 */
+ /* */
FT_EXPORT( void )
FT_Set_Default_Properties( FT_Library library );
diff --git a/thirdparty/freetype/include/freetype/ftmoderr.h b/thirdparty/freetype/include/freetype/ftmoderr.h
index 7f608375e8..e0fc1312bd 100644
--- a/thirdparty/freetype/include/freetype/ftmoderr.h
+++ b/thirdparty/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType module error offsets (specification). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftotval.h b/thirdparty/freetype/include/freetype/ftotval.h
index b5d27cfe74..26731c2b9f 100644
--- a/thirdparty/freetype/include/freetype/ftotval.h
+++ b/thirdparty/freetype/include/freetype/ftotval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftoutln.h b/thirdparty/freetype/include/freetype/ftoutln.h
index 56f56a9603..89389a49b7 100644
--- a/thirdparty/freetype/include/freetype/ftoutln.h
+++ b/thirdparty/freetype/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
/* Support for the FT_Outline type used to store glyph shapes of */
/* most scalable font formats (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Walk over an outline's structure to decompose it into individual */
- /* segments and Bézier arcs. This function also emits `move to' */
+ /* segments and Bezier arcs. This function also emits `move to' */
/* operations to indicate the start of new contours in the outline. */
/* */
/* <Input> */
@@ -190,9 +190,6 @@ FT_BEGIN_HEADER
/* If the outline's `owner' field is not set, only the outline */
/* descriptor will be released. */
/* */
- /* The reason why this function takes an `library' parameter is */
- /* simply to use ft_mem_free(). */
- /* */
FT_EXPORT( FT_Error )
FT_Outline_Done( FT_Library library,
FT_Outline* outline );
@@ -232,10 +229,10 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Return an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bézier control points. Though it */
+ /* the outline's points, including Bezier control points. Though it */
/* coincides with the exact bounding box for most glyphs, it can be */
/* slightly larger in some situations (like when rotating an outline */
- /* that contains Bézier outside arcs). */
+ /* that contains Bezier outside arcs). */
/* */
/* Computing the control box is very fast, while getting the bounding */
/* box can take much more time as it needs to walk over all segments */
diff --git a/thirdparty/freetype/include/freetype/ftparams.h b/thirdparty/freetype/include/freetype/ftparams.h
new file mode 100644
index 0000000000..5a9006c505
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/ftparams.h
@@ -0,0 +1,205 @@
+/***************************************************************************/
+/* */
+/* ftparams.h */
+/* */
+/* FreeType API for possible FT_Parameter tags (specification only). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTPARAMS_H_
+#define FTPARAMS_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * parameter_tags
+ *
+ * @title:
+ * Parameter Tags
+ *
+ * @abstract:
+ * Macros for driver property and font loading parameter tags.
+ *
+ * @description:
+ * This section contains macros for the @FT_Parameter structure that are
+ * used with various functions to activate some special functionality or
+ * different behaviour of various components of FreeType.
+ *
+ */
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
+ *
+ * @description:
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
+ * family names in the `name' table (introduced in OpenType version
+ * 1.4). Use this for backward compatibility with legacy systems that
+ * have a four-faces-per-family restriction.
+ *
+ * @since:
+ * 2.8
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
+ FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
+
+
+ /* this constant is deprecated */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
+ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
+ *
+ * @description:
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
+ * subfamily names in the `name' table (introduced in OpenType version
+ * 1.4). Use this for backward compatibility with legacy systems that
+ * have a four-faces-per-family restriction.
+ *
+ * @since:
+ * 2.8
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
+ FT_MAKE_TAG( 'i', 'g', 'p', 's' )
+
+
+ /* this constant is deprecated */
+#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
+ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_INCREMENTAL
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Open_Face to indicate
+ * incremental glyph loading.
+ *
+ */
+#define FT_PARAM_TAG_INCREMENTAL \
+ FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
+
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_LCD_FILTER_WEIGHTS
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding argument specifies the five LCD filter weights for a
+ * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding
+ * the global default values or the values set up with
+ * @FT_Library_SetLcdFilterWeights.
+ *
+ * @since:
+ * 2.8
+ *
+ */
+#define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \
+ FT_MAKE_TAG( 'l', 'c', 'd', 'f' )
+
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_RANDOM_SEED
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding 32bit signed integer argument overrides the font
+ * driver's random seed value with a face-specific one; see
+ * @random-seed.
+ *
+ * @since:
+ * 2.8
+ *
+ */
+#define FT_PARAM_TAG_RANDOM_SEED \
+ FT_MAKE_TAG( 's', 'e', 'e', 'd' )
+
+
+ /**************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_STEM_DARKENING
+ *
+ * @description:
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding Boolean argument specifies whether to apply stem
+ * darkening, overriding the global default values or the values set up
+ * with @FT_Property_Set (see @no-stem-darkening).
+ *
+ * This is a passive setting that only takes effect if the font driver
+ * or autohinter honors it, which the CFF, Type~1, and CID drivers
+ * always do, but the autohinter only in `light' hinting mode (as of
+ * version 2.9).
+ *
+ * @since:
+ * 2.8
+ *
+ */
+#define FT_PARAM_TAG_STEM_DARKENING \
+ FT_MAKE_TAG( 'd', 'a', 'r', 'k' )
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_UNPATENTED_HINTING
+ *
+ * @description:
+ * Deprecated, no effect.
+ *
+ * Previously: A constant used as the tag of an @FT_Parameter structure to
+ * indicate that unpatented methods only should be used by the TrueType
+ * bytecode interpreter for a typeface opened by @FT_Open_Face.
+ *
+ */
+#define FT_PARAM_TAG_UNPATENTED_HINTING \
+ FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
+
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* FTPARAMS_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/ftpfr.h b/thirdparty/freetype/include/freetype/ftpfr.h
index f2a6ae9349..a69cc482dc 100644
--- a/thirdparty/freetype/include/freetype/ftpfr.h
+++ b/thirdparty/freetype/include/freetype/ftpfr.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -71,7 +71,7 @@ FT_BEGIN_HEADER
*
* ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed
- * in metrics units to device sub-pixels. This is equivalent to
+ * in metrics units to device subpixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL).
*
@@ -123,7 +123,7 @@ FT_BEGIN_HEADER
* mode, which always returns distances converted to outline units.
*
* You can use the value of the `x_scale' and `y_scale' parameters
- * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
+ * returned by @FT_Get_PFR_Metrics to scale these to device subpixels.
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face,
@@ -154,7 +154,7 @@ FT_BEGIN_HEADER
*
* @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
- * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
+ * to convert the advance to device subpixels (i.e., 1/64th of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
diff --git a/thirdparty/freetype/include/freetype/ftrender.h b/thirdparty/freetype/include/freetype/ftrender.h
index 960837580a..fa8ad22b98 100644
--- a/thirdparty/freetype/include/freetype/ftrender.h
+++ b/thirdparty/freetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
/* */
/* FreeType renderer modules public interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -88,7 +88,7 @@ FT_BEGIN_HEADER
typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot,
- FT_UInt mode,
+ FT_Render_Mode mode,
const FT_Vector* origin );
typedef FT_Error
diff --git a/thirdparty/freetype/include/freetype/ftsizes.h b/thirdparty/freetype/include/freetype/ftsizes.h
index 2f3958a857..72cb08bf2a 100644
--- a/thirdparty/freetype/include/freetype/ftsizes.h
+++ b/thirdparty/freetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType size objects management (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftsnames.h b/thirdparty/freetype/include/freetype/ftsnames.h
index a316540576..8eb8d70ff7 100644
--- a/thirdparty/freetype/include/freetype/ftsnames.h
+++ b/thirdparty/freetype/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,6 +25,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_PARAMETER_TAGS_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
@@ -189,6 +190,9 @@ FT_BEGIN_HEADER
/* Please refer to the TrueType or OpenType specification for more */
/* details. */
/* */
+ /* <Since> */
+ /* 2.8 */
+ /* */
typedef struct FT_SfntLangTag_
{
FT_Byte* string; /* this string is *not* null-terminated! */
@@ -229,53 +233,15 @@ FT_BEGIN_HEADER
/* invalid format~1 language ID values, FT_Err_Invalid_Argument is */
/* returned. */
/* */
+ /* <Since> */
+ /* 2.8 */
+ /* */
FT_EXPORT( FT_Error )
FT_Get_Sfnt_LangTag( FT_Face face,
FT_UInt langID,
FT_SfntLangTag *alangTag );
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
- *
- * @description:
- * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
- * family names in the `name' table (introduced in OpenType version
- * 1.4). Use this for backward compatibility with legacy systems that
- * have a four-faces-per-family restriction.
- *
- */
-#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \
- FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
-
-
- /* this constant is deprecated */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \
- FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY
-
-
- /***************************************************************************
- *
- * @constant:
- * FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
- *
- * @description:
- * A tag for @FT_Parameter to make @FT_Open_Face ignore typographic
- * subfamily names in the `name' table (introduced in OpenType version
- * 1.4). Use this for backward compatibility with legacy systems that
- * have a four-faces-per-family restriction.
- *
- */
-#define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \
- FT_MAKE_TAG( 'i', 'g', 'p', 's' )
-
-
- /* this constant is deprecated */
-#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \
- FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY
-
/* */
diff --git a/thirdparty/freetype/include/freetype/ftstroke.h b/thirdparty/freetype/include/freetype/ftstroke.h
index 4a20667c5e..44b6fbe19f 100644
--- a/thirdparty/freetype/include/freetype/ftstroke.h
+++ b/thirdparty/freetype/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -466,7 +466,7 @@ FT_BEGIN_HEADER
* FT_Stroker_ConicTo
*
* @description:
- * `Draw' a single quadratic Bézier in the stroker's current sub-path,
+ * `Draw' a single quadratic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@@ -474,7 +474,7 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control ::
- * A pointer to a Bézier control point.
+ * A pointer to a Bezier control point.
*
* to ::
* A pointer to the destination point.
@@ -498,7 +498,7 @@ FT_BEGIN_HEADER
* FT_Stroker_CubicTo
*
* @description:
- * `Draw' a single cubic Bézier in the stroker's current sub-path,
+ * `Draw' a single cubic Bezier in the stroker's current sub-path,
* from the last position.
*
* @input:
@@ -506,10 +506,10 @@ FT_BEGIN_HEADER
* The target stroker handle.
*
* control1 ::
- * A pointer to the first Bézier control point.
+ * A pointer to the first Bezier control point.
*
* control2 ::
- * A pointer to second Bézier control point.
+ * A pointer to second Bezier control point.
*
* to ::
* A pointer to the destination point.
diff --git a/thirdparty/freetype/include/freetype/ftsynth.h b/thirdparty/freetype/include/freetype/ftsynth.h
index 1863fa2383..ff9fb43d96 100644
--- a/thirdparty/freetype/include/freetype/ftsynth.h
+++ b/thirdparty/freetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
/* FreeType synthesizing code for emboldening and slanting */
/* (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/ftsystem.h b/thirdparty/freetype/include/freetype/ftsystem.h
index 1aa4762ad6..f6b1629ef2 100644
--- a/thirdparty/freetype/include/freetype/ftsystem.h
+++ b/thirdparty/freetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
/* */
/* FreeType low-level system interface definition (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/fttrigon.h b/thirdparty/freetype/include/freetype/fttrigon.h
index 89f0350675..2e3f3f1f73 100644
--- a/thirdparty/freetype/include/freetype/fttrigon.h
+++ b/thirdparty/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (specification). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/fttypes.h b/thirdparty/freetype/include/freetype/fttypes.h
index eab8adaad4..f638c2e54f 100644
--- a/thirdparty/freetype/include/freetype/fttypes.h
+++ b/thirdparty/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType simple types definitions (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -425,7 +425,7 @@ FT_BEGIN_HEADER
/* The address of the FreeType object that is under finalization. */
/* Its client data is accessed through its `generic' field. */
/* */
- typedef void (*FT_Generic_Finalizer)(void* object);
+ typedef void (*FT_Generic_Finalizer)( void* object );
/*************************************************************************/
diff --git a/thirdparty/freetype/include/freetype/ftwinfnt.h b/thirdparty/freetype/include/freetype/ftwinfnt.h
index 1eeef6c8ba..461c65b779 100644
--- a/thirdparty/freetype/include/freetype/ftwinfnt.h
+++ b/thirdparty/freetype/include/freetype/ftwinfnt.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows fnt-specific data. */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -78,7 +78,7 @@ FT_BEGIN_HEADER
* Mac Roman encoding.
*
* FT_WinFNT_ID_OEM ::
- * From Michael Pöttgen <michael@poettgen.de>:
+ * From Michael Poettgen <michael@poettgen.de>:
*
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon',
diff --git a/thirdparty/freetype/include/freetype/internal/autohint.h b/thirdparty/freetype/include/freetype/internal/autohint.h
index bae83e7384..f4d308f68c 100644
--- a/thirdparty/freetype/include/freetype/internal/autohint.h
+++ b/thirdparty/freetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
/* */
/* High-level `autohint' module-specific interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/cffotypes.h b/thirdparty/freetype/include/freetype/internal/cffotypes.h
new file mode 100644
index 0000000000..57e7591d41
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/cffotypes.h
@@ -0,0 +1,108 @@
+/***************************************************************************/
+/* */
+/* cffotypes.h */
+/* */
+/* Basic OpenType/CFF object type definitions (specification). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef CFFOTYPES_H_
+#define CFFOTYPES_H_
+
+#include <ft2build.h>
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_CFF_TYPES_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+
+
+FT_BEGIN_HEADER
+
+
+ typedef TT_Face CFF_Face;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* CFF_Size */
+ /* */
+ /* <Description> */
+ /* A handle to an OpenType size object. */
+ /* */
+ typedef struct CFF_SizeRec_
+ {
+ FT_SizeRec root;
+ FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
+
+ } CFF_SizeRec, *CFF_Size;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* CFF_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* A handle to an OpenType glyph slot object. */
+ /* */
+ typedef struct CFF_GlyphSlotRec_
+ {
+ FT_GlyphSlotRec root;
+
+ FT_Bool hint;
+ FT_Bool scaled;
+
+ FT_Fixed x_scale;
+ FT_Fixed y_scale;
+
+ } CFF_GlyphSlotRec, *CFF_GlyphSlot;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* CFF_Internal */
+ /* */
+ /* <Description> */
+ /* The interface to the `internal' field of `FT_Size'. */
+ /* */
+ typedef struct CFF_InternalRec_
+ {
+ PSH_Globals topfont;
+ PSH_Globals subfonts[CFF_MAX_CID_FONTS];
+
+ } CFF_InternalRec, *CFF_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* Subglyph transformation record. */
+ /* */
+ typedef struct CFF_Transform_
+ {
+ FT_Fixed xx, xy; /* transformation matrix coefficients */
+ FT_Fixed yx, yy;
+ FT_F26Dot6 ox, oy; /* offsets */
+
+ } CFF_Transform;
+
+
+FT_END_HEADER
+
+
+#endif /* CFFOTYPES_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/cfftypes.h b/thirdparty/freetype/include/freetype/internal/cfftypes.h
new file mode 100644
index 0000000000..7c07e1a376
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/cfftypes.h
@@ -0,0 +1,412 @@
+/***************************************************************************/
+/* */
+/* cfftypes.h */
+/* */
+/* Basic OpenType/CFF type definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef CFFTYPES_H_
+#define CFFTYPES_H_
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_TYPE1_TABLES_H
+#include FT_INTERNAL_SERVICE_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CFF_IndexRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a CFF Index table. */
+ /* */
+ /* <Fields> */
+ /* stream :: The source input stream. */
+ /* */
+ /* start :: The position of the first index byte in the */
+ /* input stream. */
+ /* */
+ /* count :: The number of elements in the index. */
+ /* */
+ /* off_size :: The size in bytes of object offsets in index. */
+ /* */
+ /* data_offset :: The position of first data byte in the index's */
+ /* bytes. */
+ /* */
+ /* data_size :: The size of the data table in this index. */
+ /* */
+ /* offsets :: A table of element offsets in the index. Must be */
+ /* loaded explicitly. */
+ /* */
+ /* bytes :: If the index is loaded in memory, its bytes. */
+ /* */
+ typedef struct CFF_IndexRec_
+ {
+ FT_Stream stream;
+ FT_ULong start;
+ FT_UInt hdr_size;
+ FT_UInt count;
+ FT_Byte off_size;
+ FT_ULong data_offset;
+ FT_ULong data_size;
+
+ FT_ULong* offsets;
+ FT_Byte* bytes;
+
+ } CFF_IndexRec, *CFF_Index;
+
+
+ typedef struct CFF_EncodingRec_
+ {
+ FT_UInt format;
+ FT_ULong offset;
+
+ FT_UInt count;
+ FT_UShort sids [256]; /* avoid dynamic allocations */
+ FT_UShort codes[256];
+
+ } CFF_EncodingRec, *CFF_Encoding;
+
+
+ typedef struct CFF_CharsetRec_
+ {
+
+ FT_UInt format;
+ FT_ULong offset;
+
+ FT_UShort* sids;
+ FT_UShort* cids; /* the inverse mapping of `sids'; only needed */
+ /* for CID-keyed fonts */
+ FT_UInt max_cid;
+ FT_UInt num_glyphs;
+
+ } CFF_CharsetRec, *CFF_Charset;
+
+
+ /* cf. similar fields in file `ttgxvar.h' from the `truetype' module */
+
+ typedef struct CFF_VarData_
+ {
+#if 0
+ FT_UInt itemCount; /* not used; always zero */
+ FT_UInt shortDeltaCount; /* not used; always zero */
+#endif
+
+ FT_UInt regionIdxCount; /* number of region indexes */
+ FT_UInt* regionIndices; /* array of `regionIdxCount' indices; */
+ /* these index `varRegionList' */
+ } CFF_VarData;
+
+
+ /* contribution of one axis to a region */
+ typedef struct CFF_AxisCoords_
+ {
+ FT_Fixed startCoord;
+ FT_Fixed peakCoord; /* zero peak means no effect (factor = 1) */
+ FT_Fixed endCoord;
+
+ } CFF_AxisCoords;
+
+
+ typedef struct CFF_VarRegion_
+ {
+ CFF_AxisCoords* axisList; /* array of axisCount records */
+
+ } CFF_VarRegion;
+
+
+ typedef struct CFF_VStoreRec_
+ {
+ FT_UInt dataCount;
+ CFF_VarData* varData; /* array of dataCount records */
+ /* vsindex indexes this array */
+ FT_UShort axisCount;
+ FT_UInt regionCount; /* total number of regions defined */
+ CFF_VarRegion* varRegionList;
+
+ } CFF_VStoreRec, *CFF_VStore;
+
+
+ /* forward reference */
+ typedef struct CFF_FontRec_* CFF_Font;
+
+
+ /* This object manages one cached blend vector. */
+ /* */
+ /* There is a BlendRec for Private DICT parsing in each subfont */
+ /* and a BlendRec for charstrings in CF2_Font instance data. */
+ /* A cached BV may be used across DICTs or Charstrings if inputs */
+ /* have not changed. */
+ /* */
+ /* `usedBV' is reset at the start of each parse or charstring. */
+ /* vsindex cannot be changed after a BV is used. */
+ /* */
+ /* Note: NDV is long (32/64 bit), while BV is 16.16 (FT_Int32). */
+ typedef struct CFF_BlendRec_
+ {
+ FT_Bool builtBV; /* blendV has been built */
+ FT_Bool usedBV; /* blendV has been used */
+ CFF_Font font; /* top level font struct */
+ FT_UInt lastVsindex; /* last vsindex used */
+ FT_UInt lenNDV; /* normDV length (aka numAxes) */
+ FT_Fixed* lastNDV; /* last NDV used */
+ FT_UInt lenBV; /* BlendV length (aka numMasters) */
+ FT_Int32* BV; /* current blendV (per DICT/glyph) */
+
+ } CFF_BlendRec, *CFF_Blend;
+
+
+ typedef struct CFF_FontRecDictRec_
+ {
+ FT_UInt version;
+ FT_UInt notice;
+ FT_UInt copyright;
+ FT_UInt full_name;
+ FT_UInt family_name;
+ FT_UInt weight;
+ FT_Bool is_fixed_pitch;
+ FT_Fixed italic_angle;
+ FT_Fixed underline_position;
+ FT_Fixed underline_thickness;
+ FT_Int paint_type;
+ FT_Int charstring_type;
+ FT_Matrix font_matrix;
+ FT_Bool has_font_matrix;
+ FT_ULong units_per_em; /* temporarily used as scaling value also */
+ FT_Vector font_offset;
+ FT_ULong unique_id;
+ FT_BBox font_bbox;
+ FT_Pos stroke_width;
+ FT_ULong charset_offset;
+ FT_ULong encoding_offset;
+ FT_ULong charstrings_offset;
+ FT_ULong private_offset;
+ FT_ULong private_size;
+ FT_Long synthetic_base;
+ FT_UInt embedded_postscript;
+
+ /* these should only be used for the top-level font dictionary */
+ FT_UInt cid_registry;
+ FT_UInt cid_ordering;
+ FT_Long cid_supplement;
+
+ FT_Long cid_font_version;
+ FT_Long cid_font_revision;
+ FT_Long cid_font_type;
+ FT_ULong cid_count;
+ FT_ULong cid_uid_base;
+ FT_ULong cid_fd_array_offset;
+ FT_ULong cid_fd_select_offset;
+ FT_UInt cid_font_name;
+
+ /* the next fields come from the data of the deprecated */
+ /* `MultipleMaster' operator; they are needed to parse the (also */
+ /* deprecated) `blend' operator in Type 2 charstrings */
+ FT_UShort num_designs;
+ FT_UShort num_axes;
+
+ /* fields for CFF2 */
+ FT_ULong vstore_offset;
+ FT_UInt maxstack;
+
+ } CFF_FontRecDictRec, *CFF_FontRecDict;
+
+
+ /* forward reference */
+ typedef struct CFF_SubFontRec_* CFF_SubFont;
+
+
+ typedef struct CFF_PrivateRec_
+ {
+ FT_Byte num_blue_values;
+ FT_Byte num_other_blues;
+ FT_Byte num_family_blues;
+ FT_Byte num_family_other_blues;
+
+ FT_Pos blue_values[14];
+ FT_Pos other_blues[10];
+ FT_Pos family_blues[14];
+ FT_Pos family_other_blues[10];
+
+ FT_Fixed blue_scale;
+ FT_Pos blue_shift;
+ FT_Pos blue_fuzz;
+ FT_Pos standard_width;
+ FT_Pos standard_height;
+
+ FT_Byte num_snap_widths;
+ FT_Byte num_snap_heights;
+ FT_Pos snap_widths[13];
+ FT_Pos snap_heights[13];
+ FT_Bool force_bold;
+ FT_Fixed force_bold_threshold;
+ FT_Int lenIV;
+ FT_Int language_group;
+ FT_Fixed expansion_factor;
+ FT_Long initial_random_seed;
+ FT_ULong local_subrs_offset;
+ FT_Pos default_width;
+ FT_Pos nominal_width;
+
+ /* fields for CFF2 */
+ FT_UInt vsindex;
+ CFF_SubFont subfont;
+
+ } CFF_PrivateRec, *CFF_Private;
+
+
+ typedef struct CFF_FDSelectRec_
+ {
+ FT_Byte format;
+ FT_UInt range_count;
+
+ /* that's the table, taken from the file `as is' */
+ FT_Byte* data;
+ FT_UInt data_size;
+
+ /* small cache for format 3 only */
+ FT_UInt cache_first;
+ FT_UInt cache_count;
+ FT_Byte cache_fd;
+
+ } CFF_FDSelectRec, *CFF_FDSelect;
+
+
+ /* A SubFont packs a font dict and a private dict together. They are */
+ /* needed to support CID-keyed CFF fonts. */
+ typedef struct CFF_SubFontRec_
+ {
+ CFF_FontRecDictRec font_dict;
+ CFF_PrivateRec private_dict;
+
+ /* fields for CFF2 */
+ CFF_BlendRec blend; /* current blend vector */
+ FT_UInt lenNDV; /* current length NDV or zero */
+ FT_Fixed* NDV; /* ptr to current NDV or NULL */
+
+ /* `blend_stack' is a writable buffer to hold blend results. */
+ /* This buffer is to the side of the normal cff parser stack; */
+ /* `cff_parse_blend' and `cff_blend_doBlend' push blend results here. */
+ /* The normal stack then points to these values instead of the DICT */
+ /* because all other operators in Private DICT clear the stack. */
+ /* `blend_stack' could be cleared at each operator other than blend. */
+ /* Blended values are stored as 5-byte fixed point values. */
+
+ FT_Byte* blend_stack; /* base of stack allocation */
+ FT_Byte* blend_top; /* first empty slot */
+ FT_UInt blend_used; /* number of bytes in use */
+ FT_UInt blend_alloc; /* number of bytes allocated */
+
+ CFF_IndexRec local_subrs_index;
+ FT_Byte** local_subrs; /* array of pointers */
+ /* into Local Subrs INDEX data */
+
+ FT_UInt32 random;
+
+ } CFF_SubFontRec;
+
+
+#define CFF_MAX_CID_FONTS 256
+
+
+ typedef struct CFF_FontRec_
+ {
+ FT_Library library;
+ FT_Stream stream;
+ FT_Memory memory; /* TODO: take this from stream->memory? */
+ FT_ULong base_offset; /* offset to start of CFF */
+ FT_UInt num_faces;
+ FT_UInt num_glyphs;
+
+ FT_Byte version_major;
+ FT_Byte version_minor;
+ FT_Byte header_size;
+
+ FT_UInt top_dict_length; /* cff2 only */
+
+ FT_Bool cff2;
+
+ CFF_IndexRec name_index;
+ CFF_IndexRec top_dict_index;
+ CFF_IndexRec global_subrs_index;
+
+ CFF_EncodingRec encoding;
+ CFF_CharsetRec charset;
+
+ CFF_IndexRec charstrings_index;
+ CFF_IndexRec font_dict_index;
+ CFF_IndexRec private_index;
+ CFF_IndexRec local_subrs_index;
+
+ FT_String* font_name;
+
+ /* array of pointers into Global Subrs INDEX data */
+ FT_Byte** global_subrs;
+
+ /* array of pointers into String INDEX data stored at string_pool */
+ FT_UInt num_strings;
+ FT_Byte** strings;
+ FT_Byte* string_pool;
+ FT_ULong string_pool_size;
+
+ CFF_SubFontRec top_font;
+ FT_UInt num_subfonts;
+ CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
+
+ CFF_FDSelectRec fd_select;
+
+ /* interface to PostScript hinter */
+ PSHinter_Service pshinter;
+
+ /* interface to Postscript Names service */
+ FT_Service_PsCMaps psnames;
+
+ /* interface to CFFLoad service */
+ const void* cffload;
+
+ /* since version 2.3.0 */
+ PS_FontInfoRec* font_info; /* font info dictionary */
+
+ /* since version 2.3.6 */
+ FT_String* registry;
+ FT_String* ordering;
+
+ /* since version 2.4.12 */
+ FT_Generic cf2_instance;
+
+ /* since version 2.7.1 */
+ CFF_VStoreRec vstore; /* parsed vstore structure */
+
+ /* since version 2.9 */
+ PS_FontExtraRec* font_extra;
+
+ } CFF_FontRec;
+
+
+FT_END_HEADER
+
+#endif /* CFFTYPES_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/ftcalc.h b/thirdparty/freetype/include/freetype/internal/ftcalc.h
index 8b35f03d88..818a812359 100644
--- a/thirdparty/freetype/include/freetype/internal/ftcalc.h
+++ b/thirdparty/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftdebug.h b/thirdparty/freetype/include/freetype/internal/ftdebug.h
index 5dcd2b1740..292a4eedb8 100644
--- a/thirdparty/freetype/include/freetype/internal/ftdebug.h
+++ b/thirdparty/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftdrv.h b/thirdparty/freetype/include/freetype/internal/ftdrv.h
new file mode 100644
index 0000000000..58dd35a933
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/ftdrv.h
@@ -0,0 +1,400 @@
+/***************************************************************************/
+/* */
+/* ftdrv.h */
+/* */
+/* FreeType internal font driver interface (specification). */
+/* */
+/* Copyright 1996-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTDRV_H_
+#define FTDRV_H_
+
+
+#include <ft2build.h>
+#include FT_MODULE_H
+
+
+FT_BEGIN_HEADER
+
+
+ typedef FT_Error
+ (*FT_Face_InitFunc)( FT_Stream stream,
+ FT_Face face,
+ FT_Int typeface_index,
+ FT_Int num_params,
+ FT_Parameter* parameters );
+
+ typedef void
+ (*FT_Face_DoneFunc)( FT_Face face );
+
+
+ typedef FT_Error
+ (*FT_Size_InitFunc)( FT_Size size );
+
+ typedef void
+ (*FT_Size_DoneFunc)( FT_Size size );
+
+
+ typedef FT_Error
+ (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
+
+ typedef void
+ (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
+
+
+ typedef FT_Error
+ (*FT_Size_RequestFunc)( FT_Size size,
+ FT_Size_Request req );
+
+ typedef FT_Error
+ (*FT_Size_SelectFunc)( FT_Size size,
+ FT_ULong size_index );
+
+ typedef FT_Error
+ (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
+ FT_Size size,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ typedef FT_Error
+ (*FT_Face_GetKerningFunc)( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_Vector* kerning );
+
+
+ typedef FT_Error
+ (*FT_Face_AttachFunc)( FT_Face face,
+ FT_Stream stream );
+
+
+ typedef FT_Error
+ (*FT_Face_GetAdvancesFunc)( FT_Face face,
+ FT_UInt first,
+ FT_UInt count,
+ FT_Int32 flags,
+ FT_Fixed* advances );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Driver_ClassRec */
+ /* */
+ /* <Description> */
+ /* The font driver class. This structure mostly contains pointers to */
+ /* driver methods. */
+ /* */
+ /* <Fields> */
+ /* root :: The parent module. */
+ /* */
+ /* face_object_size :: The size of a face object in bytes. */
+ /* */
+ /* size_object_size :: The size of a size object in bytes. */
+ /* */
+ /* slot_object_size :: The size of a glyph object in bytes. */
+ /* */
+ /* init_face :: The format-specific face constructor. */
+ /* */
+ /* done_face :: The format-specific face destructor. */
+ /* */
+ /* init_size :: The format-specific size constructor. */
+ /* */
+ /* done_size :: The format-specific size destructor. */
+ /* */
+ /* init_slot :: The format-specific slot constructor. */
+ /* */
+ /* done_slot :: The format-specific slot destructor. */
+ /* */
+ /* */
+ /* load_glyph :: A function handle to load a glyph to a slot. */
+ /* This field is mandatory! */
+ /* */
+ /* get_kerning :: A function handle to return the unscaled */
+ /* kerning for a given pair of glyphs. Can be */
+ /* set to 0 if the format doesn't support */
+ /* kerning. */
+ /* */
+ /* attach_file :: This function handle is used to read */
+ /* additional data for a face from another */
+ /* file/stream. For example, this can be used to */
+ /* add data from AFM or PFM files on a Type 1 */
+ /* face, or a CIDMap on a CID-keyed face. */
+ /* */
+ /* get_advances :: A function handle used to return advance */
+ /* widths of `count' glyphs (in font units), */
+ /* starting at `first'. The `vertical' flag must */
+ /* be set to get vertical advance heights. The */
+ /* `advances' buffer is caller-allocated. */
+ /* The idea of this function is to be able to */
+ /* perform device-independent text layout without */
+ /* loading a single glyph image. */
+ /* */
+ /* request_size :: A handle to a function used to request the new */
+ /* character size. Can be set to 0 if the */
+ /* scaling done in the base layer suffices. */
+ /* */
+ /* select_size :: A handle to a function used to select a new */
+ /* fixed size. It is used only if */
+ /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
+ /* to 0 if the scaling done in the base layer */
+ /* suffices. */
+ /* <Note> */
+ /* Most function pointers, with the exception of `load_glyph', can be */
+ /* set to 0 to indicate a default behaviour. */
+ /* */
+ typedef struct FT_Driver_ClassRec_
+ {
+ FT_Module_Class root;
+
+ FT_Long face_object_size;
+ FT_Long size_object_size;
+ FT_Long slot_object_size;
+
+ FT_Face_InitFunc init_face;
+ FT_Face_DoneFunc done_face;
+
+ FT_Size_InitFunc init_size;
+ FT_Size_DoneFunc done_size;
+
+ FT_Slot_InitFunc init_slot;
+ FT_Slot_DoneFunc done_slot;
+
+ FT_Slot_LoadFunc load_glyph;
+
+ FT_Face_GetKerningFunc get_kerning;
+ FT_Face_AttachFunc attach_file;
+ FT_Face_GetAdvancesFunc get_advances;
+
+ /* since version 2.2 */
+ FT_Size_RequestFunc request_size;
+ FT_Size_SelectFunc select_size;
+
+ } FT_Driver_ClassRec, *FT_Driver_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_DECLARE_DRIVER */
+ /* */
+ /* <Description> */
+ /* Used to create a forward declaration of an FT_Driver_ClassRec */
+ /* struct instance. */
+ /* */
+ /* <Macro> */
+ /* FT_DEFINE_DRIVER */
+ /* */
+ /* <Description> */
+ /* Used to initialize an instance of FT_Driver_ClassRec struct. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is defined a `create' function has to be */
+ /* called with a pointer where the allocated structure is returned. */
+ /* And when it is no longer needed a `destroy' function needs to be */
+ /* called to release that allocation. */
+ /* */
+ /* `ftinit.c' (ft_create_default_module_classes) already contains a */
+ /* mechanism to call these functions for the default modules */
+ /* described in `ftmodule.h'. */
+ /* */
+ /* Notice that the created `create' and `destroy' functions call */
+ /* `pic_init' and `pic_free' to allow you to manually allocate and */
+ /* initialize any additional global data, like a module specific */
+ /* interface, and put them in the global pic container defined in */
+ /* `ftpic.h'. If you don't need them just implement the functions as */
+ /* empty to resolve the link error. Also the `pic_init' and */
+ /* `pic_free' functions should be declared in `pic.h', to be referred */
+ /* by driver definition calling `FT_DEFINE_DRIVER' in following. */
+ /* */
+ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
+ /* allocated in the global scope (or the scope where the macro is */
+ /* used). */
+ /* */
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DECLARE_DRIVER( class_ ) \
+ FT_CALLBACK_TABLE \
+ const FT_Driver_ClassRec class_;
+
+#define FT_DEFINE_DRIVER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ init_face_, \
+ done_face_, \
+ init_size_, \
+ done_size_, \
+ init_slot_, \
+ done_slot_, \
+ load_glyph_, \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ request_size_, \
+ select_size_ ) \
+ FT_CALLBACK_TABLE_DEF \
+ const FT_Driver_ClassRec class_ = \
+ { \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ \
+ init_face_, \
+ done_face_, \
+ \
+ init_size_, \
+ done_size_, \
+ \
+ init_slot_, \
+ done_slot_, \
+ \
+ load_glyph_, \
+ \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ \
+ request_size_, \
+ select_size_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DECLARE_DRIVER( class_ ) FT_DECLARE_MODULE( class_ )
+
+#define FT_DEFINE_DRIVER( \
+ class_, \
+ flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_, \
+ face_object_size_, \
+ size_object_size_, \
+ slot_object_size_, \
+ init_face_, \
+ done_face_, \
+ init_size_, \
+ done_size_, \
+ init_slot_, \
+ done_slot_, \
+ load_glyph_, \
+ get_kerning_, \
+ attach_file_, \
+ get_advances_, \
+ request_size_, \
+ select_size_ ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_Module_Class* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
+ \
+ \
+ class_ ## _pic_free( library ); \
+ if ( dclazz ) \
+ FT_FREE( dclazz ); \
+ } \
+ \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_Module_Class** output_class ) \
+ { \
+ FT_Driver_Class clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
+ return error; \
+ \
+ error = class_ ## _pic_init( library ); \
+ if ( error ) \
+ { \
+ FT_FREE( clazz ); \
+ return error; \
+ } \
+ \
+ FT_DEFINE_ROOT_MODULE( flags_, \
+ size_, \
+ name_, \
+ version_, \
+ requires_, \
+ interface_, \
+ init_, \
+ done_, \
+ get_interface_ ) \
+ \
+ clazz->face_object_size = face_object_size_; \
+ clazz->size_object_size = size_object_size_; \
+ clazz->slot_object_size = slot_object_size_; \
+ \
+ clazz->init_face = init_face_; \
+ clazz->done_face = done_face_; \
+ \
+ clazz->init_size = init_size_; \
+ clazz->done_size = done_size_; \
+ \
+ clazz->init_slot = init_slot_; \
+ clazz->done_slot = done_slot_; \
+ \
+ clazz->load_glyph = load_glyph_; \
+ \
+ clazz->get_kerning = get_kerning_; \
+ clazz->attach_file = attach_file_; \
+ clazz->get_advances = get_advances_; \
+ \
+ clazz->request_size = request_size_; \
+ clazz->select_size = select_size_; \
+ \
+ *output_class = (FT_Module_Class*)clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+FT_END_HEADER
+
+#endif /* FTDRV_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/ftgloadr.h b/thirdparty/freetype/include/freetype/internal/ftgloadr.h
index f41c3df554..a002fdbfca 100644
--- a/thirdparty/freetype/include/freetype/internal/ftgloadr.h
+++ b/thirdparty/freetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftmemory.h b/thirdparty/freetype/include/freetype/internal/ftmemory.h
index 59e5b58a57..054eaec31f 100644
--- a/thirdparty/freetype/include/freetype/internal/ftmemory.h
+++ b/thirdparty/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType memory management macros (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -210,7 +210,7 @@ extern "C++"
NULL, \
&error ) )
-#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
+#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
diff --git a/thirdparty/freetype/include/freetype/internal/ftobjs.h b/thirdparty/freetype/include/freetype/internal/ftobjs.h
index 4231be238a..1c3c6ad456 100644
--- a/thirdparty/freetype/include/freetype/internal/ftobjs.h
+++ b/thirdparty/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -85,9 +85,9 @@ FT_BEGIN_HEADER
: y + ( 3 * x >> 3 ) )
/* we use FT_TYPEOF to suppress signedness compilation warnings */
-#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n)-1 ) )
-#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + (n)/2, n )
-#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + (n)-1, n )
+#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
+#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + (n) / 2, n )
+#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + (n) - 1, n )
#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
@@ -155,8 +155,8 @@ FT_BEGIN_HEADER
} FT_CMapRec;
- /* typecase any pointer to a charmap handle */
-#define FT_CMAP( x ) ((FT_CMap)( x ))
+ /* typecast any pointer to a charmap handle */
+#define FT_CMAP( x ) ( (FT_CMap)( x ) )
/* obvious macros */
#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
@@ -312,6 +312,27 @@ FT_BEGIN_HEADER
FT_CMap_Done( FT_CMap cmap );
+ /* adds LCD padding to Min and Max boundaries */
+ FT_BASE( void )
+ ft_lcd_padding( FT_Pos* Min,
+ FT_Pos* Max,
+ FT_GlyphSlot slot );
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
+ FT_Render_Mode render_mode,
+ FT_Byte* weights );
+
+
+ /* This is the default LCD filter, an in-place, 5-tap FIR filter. */
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights );
+
+#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -369,9 +390,10 @@ FT_BEGIN_HEADER
/* operator. Value~0 means to use the font's value. Value~-1 */
/* means to use the CFF driver's default. */
/* */
- /* lcd_weights :: */
- /* Overrides the library default with custom weights for the 5-tap */
- /* FIR filter. `{0, 0, 0, 0, 0}' means to use the library default. */
+ /* lcd_weights :: */
+ /* lcd_filter_func :: */
+ /* If subpixel rendering is activated, the LCD filtering weights */
+ /* and callback function. */
/* */
/* refcount :: */
/* A counter initialized to~1 at the time an @FT_Face structure is */
@@ -393,8 +415,10 @@ FT_BEGIN_HEADER
FT_Char no_stem_darkening;
FT_Int32 random_seed;
+
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- FT_LcdFiveTapFilter lcd_weights; /* preset or custom filter weights */
+ FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
+ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
FT_Int refcount;
@@ -516,7 +540,8 @@ FT_BEGIN_HEADER
/* typecast an object to an FT_Module */
-#define FT_MODULE( x ) ((FT_Module)( x ))
+#define FT_MODULE( x ) ( (FT_Module)(x) )
+
#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
@@ -602,9 +627,9 @@ FT_BEGIN_HEADER
/* a few macros used to perform easy typecasts with minimal brain damage */
-#define FT_FACE( x ) ((FT_Face)(x))
-#define FT_SIZE( x ) ((FT_Size)(x))
-#define FT_SLOT( x ) ((FT_GlyphSlot)(x))
+#define FT_FACE( x ) ( (FT_Face)(x) )
+#define FT_SIZE( x ) ( (FT_Size)(x) )
+#define FT_SLOT( x ) ( (FT_GlyphSlot)(x) )
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
@@ -705,6 +730,12 @@ FT_BEGIN_HEADER
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
+ /* Preset bitmap metrics of an outline glyphslot prior to rendering. */
+ FT_BASE( void )
+ ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
+ FT_Render_Mode mode,
+ const FT_Vector* origin );
+
/* Allocate a new bitmap buffer in a glyph slot. */
FT_BASE( FT_Error )
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
@@ -731,10 +762,10 @@ FT_BEGIN_HEADER
/*************************************************************************/
-#define FT_RENDERER( x ) ((FT_Renderer)( x ))
-#define FT_GLYPH( x ) ((FT_Glyph)( x ))
-#define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
-#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
+#define FT_RENDERER( x ) ( (FT_Renderer)(x) )
+#define FT_GLYPH( x ) ( (FT_Glyph)(x) )
+#define FT_BITMAP_GLYPH( x ) ( (FT_BitmapGlyph)(x) )
+#define FT_OUTLINE_GLYPH( x ) ( (FT_OutlineGlyph)(x) )
typedef struct FT_RendererRec_
@@ -765,7 +796,7 @@ FT_BEGIN_HEADER
/* typecast a module into a driver easily */
-#define FT_DRIVER( x ) ((FT_Driver)(x))
+#define FT_DRIVER( x ) ( (FT_Driver)(x) )
/* typecast a module as a driver, and get its driver class */
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
@@ -821,18 +852,6 @@ FT_BEGIN_HEADER
#define FT_DEBUG_HOOK_TRUETYPE 0
- typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
- FT_Render_Mode render_mode,
- FT_Byte* weights );
-
-
- /* This is the default LCD filter, an in-place, 5-tap FIR filter. */
- FT_BASE( void )
- ft_lcd_filter_fir( FT_Bitmap* bitmap,
- FT_Render_Mode mode,
- FT_LcdFiveTapFilter weights );
-
-
/*************************************************************************/
/* */
/* <Struct> */
@@ -878,9 +897,6 @@ FT_BEGIN_HEADER
/* interpreter. Currently, only the TrueType */
/* bytecode debugger uses this. */
/* */
- /* lcd_filter :: If subpixel rendering is activated, the */
- /* selected LCD filter mode. */
- /* */
/* lcd_weights :: If subpixel rendering is activated, the LCD */
/* filter weights, if any. */
/* */
@@ -915,7 +931,6 @@ FT_BEGIN_HEADER
FT_DebugHook_Func debug_hooks[4];
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- FT_LcdFilter lcd_filter;
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#endif
diff --git a/thirdparty/freetype/include/freetype/internal/ftpic.h b/thirdparty/freetype/include/freetype/internal/ftpic.h
index 0d43ed20f7..5214f05989 100644
--- a/thirdparty/freetype/include/freetype/internal/ftpic.h
+++ b/thirdparty/freetype/include/freetype/internal/ftpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (declaration). */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftpsprop.h b/thirdparty/freetype/include/freetype/internal/ftpsprop.h
new file mode 100644
index 0000000000..abbb62862b
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/ftpsprop.h
@@ -0,0 +1,48 @@
+/***************************************************************************/
+/* */
+/* ftpsprop.h */
+/* */
+/* Get and set properties of PostScript drivers (specification). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef FTPSPROP_H_
+#define FTPSPROP_H_
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ FT_BASE_CALLBACK( FT_Error )
+ ps_property_set( FT_Module module, /* PS_Driver */
+ const char* property_name,
+ const void* value,
+ FT_Bool value_is_string );
+
+ FT_BASE_CALLBACK( FT_Error )
+ ps_property_get( FT_Module module, /* PS_Driver */
+ const char* property_name,
+ void* value );
+
+
+FT_END_HEADER
+
+
+#endif /* FTPSPROP_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/ftrfork.h b/thirdparty/freetype/include/freetype/internal/ftrfork.h
index 25a44a4487..1aca48a0e7 100644
--- a/thirdparty/freetype/include/freetype/internal/ftrfork.h
+++ b/thirdparty/freetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/ftserv.h b/thirdparty/freetype/include/freetype/internal/ftserv.h
index 71ef9cac3a..e01c1679b5 100644
--- a/thirdparty/freetype/include/freetype/internal/ftserv.h
+++ b/thirdparty/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType services (specification only). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -330,6 +330,32 @@ FT_BEGIN_HEADER
{ NULL, NULL } \
};
+#define FT_DEFINE_SERVICEDESCREC10( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8, \
+ serv_id_9, serv_data_9, \
+ serv_id_10, serv_data_10 ) \
+ static const FT_ServiceDescRec class_[] = \
+ { \
+ { serv_id_1, serv_data_1 }, \
+ { serv_id_2, serv_data_2 }, \
+ { serv_id_3, serv_data_3 }, \
+ { serv_id_4, serv_data_4 }, \
+ { serv_id_5, serv_data_5 }, \
+ { serv_id_6, serv_data_6 }, \
+ { serv_id_7, serv_data_7 }, \
+ { serv_id_8, serv_data_8 }, \
+ { serv_id_9, serv_data_9 }, \
+ { serv_id_10, serv_data_10 }, \
+ { NULL, NULL } \
+ };
+
#else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICEDESCREC1( class_, \
@@ -557,7 +583,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
+ FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@@ -608,7 +634,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
+ FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@@ -662,7 +688,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
+ FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@@ -719,7 +745,7 @@ FT_BEGIN_HEADER
\
FT_Error \
FT_Create_Class_ ## class_( FT_Library library, \
- FT_ServiceDescRec** output_class) \
+ FT_ServiceDescRec** output_class ) \
{ \
FT_ServiceDescRec* clazz = NULL; \
FT_Error error; \
@@ -755,6 +781,68 @@ FT_BEGIN_HEADER
return FT_Err_Ok; \
}
+#define FT_DEFINE_SERVICEDESCREC10( class_, \
+ serv_id_1, serv_data_1, \
+ serv_id_2, serv_data_2, \
+ serv_id_3, serv_data_3, \
+ serv_id_4, serv_data_4, \
+ serv_id_5, serv_data_5, \
+ serv_id_6, serv_data_6, \
+ serv_id_7, serv_data_7, \
+ serv_id_8, serv_data_8, \
+ serv_id_9, serv_data_9, \
+ serv_id_10, serv_data_10 ) \
+ void \
+ FT_Destroy_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec* clazz ) \
+ { \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( clazz ) \
+ FT_FREE( clazz ); \
+ } \
+ \
+ FT_Error \
+ FT_Create_Class_ ## class_( FT_Library library, \
+ FT_ServiceDescRec** output_class ) \
+ { \
+ FT_ServiceDescRec* clazz = NULL; \
+ FT_Error error; \
+ FT_Memory memory = library->memory; \
+ \
+ \
+ if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \
+ return error; \
+ \
+ clazz[ 0].serv_id = serv_id_1; \
+ clazz[ 0].serv_data = serv_data_1; \
+ clazz[ 1].serv_id = serv_id_2; \
+ clazz[ 1].serv_data = serv_data_2; \
+ clazz[ 2].serv_id = serv_id_3; \
+ clazz[ 2].serv_data = serv_data_3; \
+ clazz[ 3].serv_id = serv_id_4; \
+ clazz[ 3].serv_data = serv_data_4; \
+ clazz[ 4].serv_id = serv_id_5; \
+ clazz[ 4].serv_data = serv_data_5; \
+ clazz[ 5].serv_id = serv_id_6; \
+ clazz[ 5].serv_data = serv_data_6; \
+ clazz[ 6].serv_id = serv_id_7; \
+ clazz[ 6].serv_data = serv_data_7; \
+ clazz[ 7].serv_id = serv_id_8; \
+ clazz[ 7].serv_data = serv_data_8; \
+ clazz[ 8].serv_id = serv_id_9; \
+ clazz[ 8].serv_data = serv_data_9; \
+ clazz[ 9].serv_id = serv_id_10; \
+ clazz[ 9].serv_data = serv_data_10; \
+ clazz[10].serv_id = NULL; \
+ clazz[10].serv_data = NULL; \
+ \
+ *output_class = clazz; \
+ \
+ return FT_Err_Ok; \
+ }
+
#endif /* FT_CONFIG_OPTION_PIC */
@@ -898,7 +986,9 @@ FT_BEGIN_HEADER
*/
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
+#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h>
#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
+#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
@@ -912,10 +1002,9 @@ FT_BEGIN_HEADER
#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
+#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
-#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
-#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
/* */
diff --git a/thirdparty/freetype/include/freetype/internal/ftstream.h b/thirdparty/freetype/include/freetype/internal/ftstream.h
index 3e2c07b269..f90002fe77 100644
--- a/thirdparty/freetype/include/freetype/internal/ftstream.h
+++ b/thirdparty/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
/* */
/* Stream handling (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -165,8 +165,8 @@ FT_BEGIN_HEADER
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
-#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
- FT_BYTE_U16( p, 1, 0) )
+#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8 ) | \
+ FT_BYTE_U16( p, 1, 0 ) )
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
diff --git a/thirdparty/freetype/include/freetype/internal/fttrace.h b/thirdparty/freetype/include/freetype/internal/fttrace.h
index caf5fc9460..8092e41fd7 100644
--- a/thirdparty/freetype/include/freetype/internal/fttrace.h
+++ b/thirdparty/freetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
/* */
/* Tracing handling (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -39,6 +39,7 @@ FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
FT_TRACE_DEF( bitmap ) /* bitmap checksum (ftobjs.c) */
+FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@@ -66,20 +67,19 @@ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
FT_TRACE_DEF( t1afm )
FT_TRACE_DEF( t1driver )
FT_TRACE_DEF( t1gload )
-FT_TRACE_DEF( t1hint )
FT_TRACE_DEF( t1load )
FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode )
+FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psobjs )
FT_TRACE_DEF( psconv )
/* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec )
-FT_TRACE_DEF( pshalgo1 )
-FT_TRACE_DEF( pshalgo2 )
+FT_TRACE_DEF( pshalgo )
/* Type 2 driver components */
FT_TRACE_DEF( cffdriver )
@@ -96,7 +96,6 @@ FT_TRACE_DEF( cf2interp )
FT_TRACE_DEF( t42 )
/* CID driver components */
-FT_TRACE_DEF( cidafm )
FT_TRACE_DEF( ciddriver )
FT_TRACE_DEF( cidgload )
FT_TRACE_DEF( cidload )
diff --git a/thirdparty/freetype/include/freetype/internal/ftvalid.h b/thirdparty/freetype/include/freetype/internal/ftvalid.h
index df6f7c5778..cad47a556d 100644
--- a/thirdparty/freetype/include/freetype/internal/ftvalid.h
+++ b/thirdparty/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
/* */
/* FreeType validation support (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/internal.h b/thirdparty/freetype/include/freetype/internal/internal.h
index 02046813a3..8f546e443b 100644
--- a/thirdparty/freetype/include/freetype/internal/internal.h
+++ b/thirdparty/freetype/include/freetype/internal/internal.h
@@ -4,7 +4,7 @@
/* */
/* Internal header files (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,7 +31,7 @@
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_HASH_H <freetype/internal/fthash.h>
-#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
+#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdrv.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
@@ -44,9 +44,13 @@
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
+#define FT_INTERNAL_POSTSCRIPT_PROPS_H <freetype/internal/ftpsprop.h>
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
+#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h>
+#define FT_INTERNAL_CFF_OBJECTS_TYPES_H <freetype/internal/cffotypes.h>
+
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
diff --git a/thirdparty/freetype/include/freetype/internal/psaux.h b/thirdparty/freetype/include/freetype/internal/psaux.h
index 935eb1a9c7..f77380d25f 100644
--- a/thirdparty/freetype/include/freetype/internal/psaux.h
+++ b/thirdparty/freetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
/* Auxiliary functions and data structures related to PostScript fonts */
/* (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,12 +25,32 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
#include FT_INTERNAL_HASH_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_INTERNAL_CFF_TYPES_H
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
+
FT_BEGIN_HEADER
+ /***********************************************************************/
+ /* */
+ /* PostScript modules driver class. */
+ /* */
+ typedef struct PS_DriverRec_
+ {
+ FT_DriverRec root;
+
+ FT_UInt hinting_engine;
+ FT_Bool no_stem_darkening;
+ FT_Int darken_params[8];
+ FT_Int32 random_seed;
+
+ } PS_DriverRec, *PS_Driver;
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
@@ -442,6 +462,202 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/***** *****/
+ /***** PS BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ typedef struct PS_Builder_ PS_Builder;
+ typedef const struct PS_Builder_FuncsRec_* PS_Builder_Funcs;
+
+ typedef struct PS_Builder_FuncsRec_
+ {
+ void
+ (*init)( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 );
+
+ void
+ (*done)( PS_Builder* builder );
+
+ } PS_Builder_FuncsRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Structure> */
+ /* PS_Builder */
+ /* */
+ /* <Description> */
+ /* A structure used during glyph loading to store its outline. */
+ /* */
+ /* <Fields> */
+ /* memory :: The current memory object. */
+ /* */
+ /* face :: The current face object. */
+ /* */
+ /* glyph :: The current glyph slot. */
+ /* */
+ /* loader :: XXX */
+ /* */
+ /* base :: The base glyph outline. */
+ /* */
+ /* current :: The current glyph outline. */
+ /* */
+ /* pos_x :: The horizontal translation (if composite glyph). */
+ /* */
+ /* pos_y :: The vertical translation (if composite glyph). */
+ /* */
+ /* left_bearing :: The left side bearing point. */
+ /* */
+ /* advance :: The horizontal advance vector. */
+ /* */
+ /* bbox :: Unused. */
+ /* */
+ /* path_begun :: A flag which indicates that a new path has begun. */
+ /* */
+ /* load_points :: If this flag is not set, no points are loaded. */
+ /* */
+ /* no_recurse :: Set but not used. */
+ /* */
+ /* metrics_only :: A boolean indicating that we only want to compute */
+ /* the metrics of a given glyph, not load all of its */
+ /* points. */
+ /* */
+ /* is_t1 :: Set if current font type is Type 1. */
+ /* */
+ /* funcs :: An array of function pointers for the builder. */
+ /* */
+ struct PS_Builder_
+ {
+ FT_Memory memory;
+ FT_Face face;
+ CFF_GlyphSlot glyph;
+ FT_GlyphLoader loader;
+ FT_Outline* base;
+ FT_Outline* current;
+
+ FT_Pos* pos_x;
+ FT_Pos* pos_y;
+
+ FT_Vector* left_bearing;
+ FT_Vector* advance;
+
+ FT_BBox* bbox; /* bounding box */
+ FT_Bool path_begun;
+ FT_Bool load_points;
+ FT_Bool no_recurse;
+
+ FT_Bool metrics_only;
+ FT_Bool is_t1;
+
+ PS_Builder_FuncsRec funcs;
+
+ };
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PS DECODER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+#define PS_MAX_OPERANDS 48
+#define PS_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
+ /* only 10 are allowed but there exist */
+ /* fonts like `HiraKakuProN-W3.ttf' */
+ /* (Hiragino Kaku Gothic ProN W3; */
+ /* 8.2d6e1; 2014-12-19) that exceed */
+ /* this limit */
+
+ /* execution context charstring zone */
+
+ typedef struct PS_Decoder_Zone_
+ {
+ FT_Byte* base;
+ FT_Byte* limit;
+ FT_Byte* cursor;
+
+ } PS_Decoder_Zone;
+
+
+ typedef FT_Error
+ (*CFF_Decoder_Get_Glyph_Callback)( TT_Face face,
+ FT_UInt glyph_index,
+ FT_Byte** pointer,
+ FT_ULong* length );
+
+ typedef void
+ (*CFF_Decoder_Free_Glyph_Callback)( TT_Face face,
+ FT_Byte** pointer,
+ FT_ULong length );
+
+
+ typedef struct PS_Decoder_
+ {
+ PS_Builder builder;
+
+ FT_Fixed stack[PS_MAX_OPERANDS + 1];
+ FT_Fixed* top;
+
+ PS_Decoder_Zone zones[PS_MAX_SUBRS_CALLS + 1];
+ PS_Decoder_Zone* zone;
+
+ FT_Int flex_state;
+ FT_Int num_flex_vectors;
+ FT_Vector flex_vectors[7];
+
+ CFF_Font cff;
+ CFF_SubFont current_subfont; /* for current glyph_index */
+ FT_Generic* cf2_instance;
+
+ FT_Pos* glyph_width;
+ FT_Bool width_only;
+ FT_Int num_hints;
+
+ FT_UInt num_locals;
+ FT_UInt num_globals;
+
+ FT_Int locals_bias;
+ FT_Int globals_bias;
+
+ FT_Byte** locals;
+ FT_Byte** globals;
+
+ FT_Byte** glyph_names; /* for pure CFF fonts only */
+ FT_UInt num_glyphs; /* number of glyphs in font */
+
+ FT_Render_Mode hint_mode;
+
+ FT_Bool seac;
+
+ CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
+ CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
+
+ /* Type 1 stuff */
+ FT_Service_PsCMaps psnames; /* for seac */
+
+ FT_Int lenIV; /* internal for sub routine calls */
+ FT_UInt* locals_len; /* array of subrs length (optional) */
+ FT_Hash locals_hash; /* used if `num_subrs' was massaged */
+
+ FT_Matrix font_matrix;
+ FT_Vector font_offset;
+
+ PS_Blend blend; /* for multiple master support */
+
+ FT_Long* buildchar;
+ FT_UInt len_buildchar;
+
+ } PS_Decoder;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
/***** T1 BUILDER *****/
/***** *****/
/*************************************************************************/
@@ -653,10 +869,23 @@ FT_BEGIN_HEADER
void
(*done)( T1_Decoder decoder );
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ FT_Error
+ (*parse_charstrings_old)( T1_Decoder decoder,
+ FT_Byte* base,
+ FT_UInt len );
+#else
+ FT_Error
+ (*parse_metrics)( T1_Decoder decoder,
+ FT_Byte* base,
+ FT_UInt len );
+#endif
+
FT_Error
- (*parse_charstrings)( T1_Decoder decoder,
- FT_Byte* base,
- FT_UInt len );
+ (*parse_charstrings)( PS_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len );
+
} T1_Decoder_FuncsRec;
@@ -700,12 +929,261 @@ FT_BEGIN_HEADER
FT_Bool seac;
+ FT_Generic cf2_instance;
+
} T1_DecoderRec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
+ /***** CFF BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ typedef struct CFF_Builder_ CFF_Builder;
+
+
+ typedef FT_Error
+ (*CFF_Builder_Check_Points_Func)( CFF_Builder* builder,
+ FT_Int count );
+
+ typedef void
+ (*CFF_Builder_Add_Point_Func)( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag );
+ typedef FT_Error
+ (*CFF_Builder_Add_Point1_Func)( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+ typedef FT_Error
+ (*CFF_Builder_Start_Point_Func)( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+ typedef void
+ (*CFF_Builder_Close_Contour_Func)( CFF_Builder* builder );
+
+ typedef FT_Error
+ (*CFF_Builder_Add_Contour_Func)( CFF_Builder* builder );
+
+ typedef const struct CFF_Builder_FuncsRec_* CFF_Builder_Funcs;
+
+ typedef struct CFF_Builder_FuncsRec_
+ {
+ void
+ (*init)( CFF_Builder* builder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot glyph,
+ FT_Bool hinting );
+
+ void
+ (*done)( CFF_Builder* builder );
+
+ CFF_Builder_Check_Points_Func check_points;
+ CFF_Builder_Add_Point_Func add_point;
+ CFF_Builder_Add_Point1_Func add_point1;
+ CFF_Builder_Add_Contour_Func add_contour;
+ CFF_Builder_Start_Point_Func start_point;
+ CFF_Builder_Close_Contour_Func close_contour;
+
+ } CFF_Builder_FuncsRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Structure> */
+ /* CFF_Builder */
+ /* */
+ /* <Description> */
+ /* A structure used during glyph loading to store its outline. */
+ /* */
+ /* <Fields> */
+ /* memory :: The current memory object. */
+ /* */
+ /* face :: The current face object. */
+ /* */
+ /* glyph :: The current glyph slot. */
+ /* */
+ /* loader :: The current glyph loader. */
+ /* */
+ /* base :: The base glyph outline. */
+ /* */
+ /* current :: The current glyph outline. */
+ /* */
+ /* pos_x :: The horizontal translation (if composite glyph). */
+ /* */
+ /* pos_y :: The vertical translation (if composite glyph). */
+ /* */
+ /* left_bearing :: The left side bearing point. */
+ /* */
+ /* advance :: The horizontal advance vector. */
+ /* */
+ /* bbox :: Unused. */
+ /* */
+ /* path_begun :: A flag which indicates that a new path has begun. */
+ /* */
+ /* load_points :: If this flag is not set, no points are loaded. */
+ /* */
+ /* no_recurse :: Set but not used. */
+ /* */
+ /* metrics_only :: A boolean indicating that we only want to compute */
+ /* the metrics of a given glyph, not load all of its */
+ /* points. */
+ /* */
+ /* hints_funcs :: Auxiliary pointer for hinting. */
+ /* */
+ /* hints_globals :: Auxiliary pointer for hinting. */
+ /* */
+ /* funcs :: A table of method pointers for this object. */
+ /* */
+ struct CFF_Builder_
+ {
+ FT_Memory memory;
+ TT_Face face;
+ CFF_GlyphSlot glyph;
+ FT_GlyphLoader loader;
+ FT_Outline* base;
+ FT_Outline* current;
+
+ FT_Pos pos_x;
+ FT_Pos pos_y;
+
+ FT_Vector left_bearing;
+ FT_Vector advance;
+
+ FT_BBox bbox; /* bounding box */
+
+ FT_Bool path_begun;
+ FT_Bool load_points;
+ FT_Bool no_recurse;
+
+ FT_Bool metrics_only;
+
+ void* hints_funcs; /* hinter-specific */
+ void* hints_globals; /* hinter-specific */
+
+ CFF_Builder_FuncsRec funcs;
+ };
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** CFF DECODER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#define CFF_MAX_OPERANDS 48
+#define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
+ /* only 10 are allowed but there exist */
+ /* fonts like `HiraKakuProN-W3.ttf' */
+ /* (Hiragino Kaku Gothic ProN W3; */
+ /* 8.2d6e1; 2014-12-19) that exceed */
+ /* this limit */
+#define CFF_MAX_TRANS_ELEMENTS 32
+
+ /* execution context charstring zone */
+
+ typedef struct CFF_Decoder_Zone_
+ {
+ FT_Byte* base;
+ FT_Byte* limit;
+ FT_Byte* cursor;
+
+ } CFF_Decoder_Zone;
+
+
+ typedef struct CFF_Decoder_
+ {
+ CFF_Builder builder;
+ CFF_Font cff;
+
+ FT_Fixed stack[CFF_MAX_OPERANDS + 1];
+ FT_Fixed* top;
+
+ CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
+ CFF_Decoder_Zone* zone;
+
+ FT_Int flex_state;
+ FT_Int num_flex_vectors;
+ FT_Vector flex_vectors[7];
+
+ FT_Pos glyph_width;
+ FT_Pos nominal_width;
+
+ FT_Bool read_width;
+ FT_Bool width_only;
+ FT_Int num_hints;
+ FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
+
+ FT_UInt num_locals;
+ FT_UInt num_globals;
+
+ FT_Int locals_bias;
+ FT_Int globals_bias;
+
+ FT_Byte** locals;
+ FT_Byte** globals;
+
+ FT_Byte** glyph_names; /* for pure CFF fonts only */
+ FT_UInt num_glyphs; /* number of glyphs in font */
+
+ FT_Render_Mode hint_mode;
+
+ FT_Bool seac;
+
+ CFF_SubFont current_subfont; /* for current glyph_index */
+
+ CFF_Decoder_Get_Glyph_Callback get_glyph_callback;
+ CFF_Decoder_Free_Glyph_Callback free_glyph_callback;
+
+ } CFF_Decoder;
+
+
+ typedef const struct CFF_Decoder_FuncsRec_* CFF_Decoder_Funcs;
+
+ typedef struct CFF_Decoder_FuncsRec_
+ {
+ void
+ (*init)( CFF_Decoder* decoder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot slot,
+ FT_Bool hinting,
+ FT_Render_Mode hint_mode,
+ CFF_Decoder_Get_Glyph_Callback get_callback,
+ CFF_Decoder_Free_Glyph_Callback free_callback );
+
+ FT_Error
+ (*prepare)( CFF_Decoder* decoder,
+ CFF_Size size,
+ FT_UInt glyph_index );
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ FT_Error
+ (*parse_charstrings_old)( CFF_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len,
+ FT_Bool in_dict );
+#endif
+
+ FT_Error
+ (*parse_charstrings)( PS_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len );
+
+ } CFF_Decoder_FuncsRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
/***** AFM PARSER *****/
/***** *****/
/*************************************************************************/
@@ -810,11 +1288,26 @@ FT_BEGIN_HEADER
FT_Offset length,
FT_UShort seed );
+ FT_UInt32
+ (*cff_random)( FT_UInt32 r );
+
+ void
+ (*ps_decoder_init)( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 );
+
+ void
+ (*t1_make_subfont)( FT_Face face,
+ PS_Private priv,
+ CFF_SubFont subfont );
+
T1_CMap_Classes t1_cmap_classes;
/* fields after this comment line were added after version 2.1.10 */
const AFM_Parser_FuncsRec* afm_parser_funcs;
+ const CFF_Decoder_FuncsRec* cff_decoder_funcs;
+
} PSAux_ServiceRec, *PSAux_Service;
/* backward compatible type definition */
diff --git a/thirdparty/freetype/include/freetype/internal/pshints.h b/thirdparty/freetype/include/freetype/internal/pshints.h
index 49116eb443..d29314ec2e 100644
--- a/thirdparty/freetype/include/freetype/internal/pshints.h
+++ b/thirdparty/freetype/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
/* recorders (specification only). These are used to support native */
/* T1/T2 hints in the `type1', `cid', and `cff' font drivers. */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svbdf.h b/thirdparty/freetype/include/freetype/internal/services/svbdf.h
index eeebf67da1..4a9ec20075 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svbdf.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svbdf.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType BDF services (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svcfftl.h b/thirdparty/freetype/include/freetype/internal/services/svcfftl.h
new file mode 100644
index 0000000000..db623e6840
--- /dev/null
+++ b/thirdparty/freetype/include/freetype/internal/services/svcfftl.h
@@ -0,0 +1,112 @@
+/***************************************************************************/
+/* */
+/* svcfftl.h */
+/* */
+/* The FreeType CFF tables loader service (specification). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef SVCFFTL_H_
+#define SVCFFTL_H_
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_CFF_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_CFF_LOAD "cff-load"
+
+
+ typedef FT_UShort
+ (*FT_Get_Standard_Encoding_Func)( FT_UInt charcode );
+
+ typedef FT_Error
+ (*FT_Load_Private_Dict_Func)( CFF_Font font,
+ CFF_SubFont subfont,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
+ typedef FT_Byte
+ (*FT_FD_Select_Get_Func)( CFF_FDSelect fdselect,
+ FT_UInt glyph_index );
+
+ typedef FT_Bool
+ (*FT_Blend_Check_Vector_Func)( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
+ typedef FT_Error
+ (*FT_Blend_Build_Vector_Func)( CFF_Blend blend,
+ FT_UInt vsindex,
+ FT_UInt lenNDV,
+ FT_Fixed* NDV );
+
+
+ FT_DEFINE_SERVICE( CFFLoad )
+ {
+ FT_Get_Standard_Encoding_Func get_standard_encoding;
+ FT_Load_Private_Dict_Func load_private_dict;
+ FT_FD_Select_Get_Func fd_select_get;
+ FT_Blend_Check_Vector_Func blend_check_vector;
+ FT_Blend_Build_Vector_Func blend_build_vector;
+ };
+
+
+#ifndef FT_CONFIG_OPTION_PIC
+
+#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
+ get_standard_encoding_, \
+ load_private_dict_, \
+ fd_select_get_, \
+ blend_check_vector_, \
+ blend_build_vector_ ) \
+ static const FT_Service_CFFLoadRec class_ = \
+ { \
+ get_standard_encoding_, \
+ load_private_dict_, \
+ fd_select_get_, \
+ blend_check_vector_, \
+ blend_build_vector_ \
+ };
+
+#else /* FT_CONFIG_OPTION_PIC */
+
+#define FT_DEFINE_SERVICE_CFFLOADREC( class_, \
+ get_standard_encoding_, \
+ load_private_dict_, \
+ fd_select_get_, \
+ blend_check_vector_, \
+ blend_build_vector_ ) \
+ void \
+ FT_Init_Class_ ## class_( FT_Service_CFFLoadRec* clazz ) \
+ { \
+ clazz->get_standard_encoding = get_standard_encoding_; \
+ clazz->load_private_dict = load_private_dict_; \
+ clazz->fd_select_get = fd_select_get_; \
+ clazz->blend_check_vector = blend_check_vector_; \
+ clazz->blend_build_vector = blend_build_vector_; \
+ }
+
+#endif /* FT_CONFIG_OPTION_PIC */
+
+
+FT_END_HEADER
+
+
+#endif
+
+
+/* END */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svcid.h b/thirdparty/freetype/include/freetype/internal/services/svcid.h
index cce94d8df6..cb59ac6a29 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svcid.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType CID font services (specification). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
index 376d9255bb..3b732be1a1 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType font format service (specification only). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svgldict.h b/thirdparty/freetype/include/freetype/internal/services/svgldict.h
index 0cd13618d8..f1a68e3110 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svgldict.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph dictionary services (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -56,7 +56,7 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
- name_index_) \
+ name_index_ ) \
static const FT_Service_GlyphDictRec class_ = \
{ \
get_name_, name_index_ \
@@ -66,7 +66,7 @@ FT_BEGIN_HEADER
#define FT_DEFINE_SERVICE_GLYPHDICTREC( class_, \
get_name_, \
- name_index_) \
+ name_index_ ) \
void \
FT_Init_Class_ ## class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz ) \
diff --git a/thirdparty/freetype/include/freetype/internal/services/svgxval.h b/thirdparty/freetype/include/freetype/internal/services/svgxval.h
index 71bfa97af8..ed79ebeaa8 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svgxval.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svkern.h b/thirdparty/freetype/include/freetype/internal/services/svkern.h
index b8344e96e9..c7e8f6ef27 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svkern.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Kerning service (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svmetric.h b/thirdparty/freetype/include/freetype/internal/services/svmetric.h
index 1f7d5ddd0c..abaacddbbe 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svmetric.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svmetric.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType services for metrics variations (specification). */
/* */
-/* Copyright 2016-2017 by */
+/* Copyright 2016-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svmm.h b/thirdparty/freetype/include/freetype/internal/services/svmm.h
index 1d51cd9090..bcbb38e2ce 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svmm.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svmm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Multiple Masters and GX var services (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -48,11 +48,15 @@ FT_BEGIN_HEADER
FT_UInt num_coords,
FT_Long* coords );
+ /* use return value -1 to indicate that the new coordinates */
+ /* are equal to the current ones; no changes are thus needed */
typedef FT_Error
(*FT_Set_Var_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
+ /* use return value -1 to indicate that the new coordinates */
+ /* are equal to the current ones; no changes are thus needed */
typedef FT_Error
(*FT_Set_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
@@ -64,6 +68,10 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
typedef FT_Error
+ (*FT_Set_Instance_Func)( FT_Face face,
+ FT_UInt instance_index );
+
+ typedef FT_Error
(*FT_Get_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
@@ -88,6 +96,7 @@ FT_BEGIN_HEADER
FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design;
FT_Get_Var_Design_Func get_var_design;
+ FT_Set_Instance_Func set_instance;
/* for internal use; only needed for code sharing between modules */
FT_Get_Var_Blend_Func get_var_blend;
@@ -97,27 +106,29 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_PIC
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_blend_, \
- get_mm_var_, \
- set_var_design_, \
- get_var_design_, \
- get_var_blend_, \
- done_blend_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- { \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_blend_, \
- get_mm_var_, \
- set_var_design_, \
- get_var_design_, \
- get_var_blend_, \
- done_blend_ \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ set_instance_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ { \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ set_instance_, \
+ get_var_blend_, \
+ done_blend_ \
};
#else /* FT_CONFIG_OPTION_PIC */
@@ -130,6 +141,7 @@ FT_BEGIN_HEADER
get_mm_var_, \
set_var_design_, \
get_var_design_, \
+ set_instance_, \
get_var_blend_, \
done_blend_ ) \
void \
@@ -142,6 +154,7 @@ FT_BEGIN_HEADER
clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \
clazz->get_var_design = get_var_design_; \
+ clazz->set_instance = set_instance_; \
clazz->get_var_blend = get_var_blend_; \
clazz->done_blend = done_blend_; \
}
diff --git a/thirdparty/freetype/include/freetype/internal/services/svotval.h b/thirdparty/freetype/include/freetype/internal/services/svotval.h
index ac84abee46..31294296a6 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svotval.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svotval.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType OpenType validation service (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpfr.h b/thirdparty/freetype/include/freetype/internal/services/svpfr.h
index c9a182fe39..e65d57e91b 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpfr.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpfr.h
@@ -4,7 +4,7 @@
/* */
/* Internal PFR service functions (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
index 022cdec195..4a49d8b053 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript name services (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svprop.h b/thirdparty/freetype/include/freetype/internal/services/svprop.h
index eb2d4eed15..adc0bcf439 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svprop.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType property service (specification). */
/* */
-/* Copyright 2012-2017 by */
+/* Copyright 2012-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
index b32122e5d6..5589575b92 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript charmap service (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
index 0220ce529c..408f406dfa 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType PostScript info service (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
index 49d18e43e0..e8b37bc47f 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType SFNT table loading service (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
index 30f7feec71..cd0e6fda6f 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType/sfnt cmap extra information service. */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* Masatake YAMATO, Redhat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svtteng.h b/thirdparty/freetype/include/freetype/internal/services/svtteng.h
index e4b368ad40..92e3c541f5 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svtteng.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType engine query service (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
index b7793059fd..16fac1ca18 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType TrueType glyph service. */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
index c94b7e1073..80d481cbd1 100644
--- a/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/services/svwinfnt.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType Windows FNT/FONT service (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/sfnt.h b/thirdparty/freetype/include/freetype/internal/sfnt.h
index b8667a003a..fb1e327aeb 100644
--- a/thirdparty/freetype/include/freetype/internal/sfnt.h
+++ b/thirdparty/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/t1types.h b/thirdparty/freetype/include/freetype/internal/t1types.h
index b2e35d42d1..2118e33674 100644
--- a/thirdparty/freetype/include/freetype/internal/t1types.h
+++ b/thirdparty/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
/* Basic Type1/Type2 type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/internal/tttypes.h b/thirdparty/freetype/include/freetype/internal/tttypes.h
index c0758e25fc..10dd336a89 100644
--- a/thirdparty/freetype/include/freetype/internal/tttypes.h
+++ b/thirdparty/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -148,7 +148,7 @@ FT_BEGIN_HEADER
/* <Fields> */
/* See */
/* */
- /* http://www.w3.org/TR/WOFF/#WOFFHeader */
+ /* https://www.w3.org/TR/WOFF/#WOFFHeader */
/* */
typedef struct WOFF_HeaderRec_
{
@@ -1299,10 +1299,6 @@ FT_BEGIN_HEADER
/* variation tables (rather like Multiple */
/* Master data). */
/* */
- /* is_default_instance :: Set if the glyph outlines can be used */
- /* unmodified (i.e., without applying glyph */
- /* variation deltas). */
- /* */
/* variation_support :: Flags that indicate which OpenType */
/* functionality related to font variation */
/* support is present, valid, and usable. */
@@ -1445,6 +1441,9 @@ FT_BEGIN_HEADER
void* var;
#endif
+ /* a typeless pointer to the PostScript Aux service */
+ void* psaux;
+
/***********************************************************************/
/* */
@@ -1509,7 +1508,6 @@ FT_BEGIN_HEADER
FT_Bool doblend;
GX_Blend blend;
- FT_Bool is_default_instance; /* since 2.7.1 */
FT_UInt32 variation_support; /* since 2.7.1 */
const char* var_postscript_prefix; /* since 2.7.2 */
diff --git a/thirdparty/freetype/include/freetype/t1tables.h b/thirdparty/freetype/include/freetype/t1tables.h
index 3f6b36e108..3503c2616b 100644
--- a/thirdparty/freetype/include/freetype/t1tables.h
+++ b/thirdparty/freetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
/* Basic Type 1/Type 2 tables definitions and interface (specification */
/* only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -554,6 +554,9 @@ FT_BEGIN_HEADER
/* T1_ENCODING_TYPE_ISOLATIN1 :: */
/* T1_ENCODING_TYPE_EXPERT :: */
/* */
+ /* <Since> */
+ /* 2.4.8 */
+ /* */
typedef enum T1_EncodingType_
{
T1_ENCODING_TYPE_NONE = 0,
@@ -622,6 +625,9 @@ FT_BEGIN_HEADER
/* PS_DICT_FS_TYPE :: */
/* PS_DICT_ITALIC_ANGLE :: */
/* */
+ /* <Since> */
+ /* 2.4.8 */
+ /* */
typedef enum PS_Dict_Keys_
{
/* conventionally in the font dictionary */
@@ -743,6 +749,9 @@ FT_BEGIN_HEADER
* If the font's format is not PostScript-based, this function returns
* the `FT_Err_Invalid_Argument' error code.
*
+ * @since:
+ * 2.4.8
+ *
*/
FT_EXPORT( FT_Long )
FT_Get_PS_Font_Value( FT_Face face,
diff --git a/thirdparty/freetype/include/freetype/ttnameid.h b/thirdparty/freetype/include/freetype/ttnameid.h
index 494d677186..8605183dc7 100644
--- a/thirdparty/freetype/include/freetype/ttnameid.h
+++ b/thirdparty/freetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
/* */
/* TrueType name ID definitions (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -437,7 +437,7 @@ FT_BEGIN_HEADER
*
* The canonical source for Microsoft's IDs is
*
- * http://www.microsoft.com/globaldev/reference/lcid-all.mspx ,
+ * https://www.microsoft.com/globaldev/reference/lcid-all.mspx ,
*
* however, we only provide macros for language identifiers present in
* the OpenType specification: Microsoft has abandoned the concept of
diff --git a/thirdparty/freetype/include/freetype/tttables.h b/thirdparty/freetype/include/freetype/tttables.h
index 58312044ca..ce6a61779c 100644
--- a/thirdparty/freetype/include/freetype/tttables.h
+++ b/thirdparty/freetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
/* Basic SFNT/TrueType tables definitions and interface */
/* (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/freetype/tttags.h b/thirdparty/freetype/include/freetype/tttags.h
index b7d3bac0f1..e5cee68a15 100644
--- a/thirdparty/freetype/include/freetype/tttags.h
+++ b/thirdparty/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
/* */
/* Tags for TrueType and OpenType tables (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/include/ft2build.h b/thirdparty/freetype/include/ft2build.h
index e7d808f3f4..e7ce99bc94 100644
--- a/thirdparty/freetype/include/ft2build.h
+++ b/thirdparty/freetype/include/ft2build.h
@@ -4,7 +4,7 @@
/* */
/* FreeType 2 build and setup macros. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afangles.c b/thirdparty/freetype/src/autofit/afangles.c
index ccdae84136..c65a3ae23e 100644
--- a/thirdparty/freetype/src/autofit/afangles.c
+++ b/thirdparty/freetype/src/autofit/afangles.c
@@ -5,7 +5,7 @@
/* Routines used to compute vector angles with limited accuracy */
/* and very high speed. It also contains sorting routines (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afblue.c b/thirdparty/freetype/src/autofit/afblue.c
index fedeacf797..e4078fd044 100644
--- a/thirdparty/freetype/src/autofit/afblue.c
+++ b/thirdparty/freetype/src/autofit/afblue.c
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -166,6 +166,10 @@
'\0',
'\xE2', '\xB4', '\x84', ' ', '\xE2', '\xB4', '\x85', ' ', '\xE2', '\xB4', '\x94', ' ', '\xE2', '\xB4', '\x95', ' ', '\xE2', '\xB4', '\x81', ' ', '\xE2', '\xB4', '\x82', ' ', '\xE2', '\xB4', '\x98', ' ', '\xE2', '\xB4', '\x9D', /* â´„ â´… â´” â´• â´ â´‚ â´˜ â´ */
'\0',
+ '\xE1', '\xB2', '\x9C', ' ', '\xE1', '\xB2', '\x9F', ' ', '\xE1', '\xB2', '\xB3', ' ', '\xE1', '\xB2', '\xB8', ' ', '\xE1', '\xB2', '\x92', ' ', '\xE1', '\xB2', '\x94', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xB4', /* Ნ Ჟ Ჳ Ჸ Გ Ე ᲠᲴ */
+ '\0',
+ '\xE1', '\xB2', '\x98', ' ', '\xE1', '\xB2', '\xB2', ' ', '\xE1', '\xB2', '\x9D', ' ', '\xE1', '\xB2', '\xA9', ' ', '\xE1', '\xB2', '\x9B', ' ', '\xE1', '\xB2', '\xA8', ' ', '\xE1', '\xB2', '\xAF', ' ', '\xE1', '\xB2', '\xBD', /* Ი Ჲ ᲠᲩ Მ Შ Ჯ Ჽ */
+ '\0',
'\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x94', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\xAB', ' ', '\xE2', '\xB0', '\x8B', /* â°… â°” â°ª â°„ â°‚ â°Š â°« â°‹ */
'\0',
'\xE2', '\xB0', '\x85', ' ', '\xE2', '\xB0', '\x84', ' ', '\xE2', '\xB0', '\x82', ' ', '\xE2', '\xB0', '\xAA', ' ', '\xE2', '\xB0', '\x9E', ' ', '\xE2', '\xB0', '\xA1', ' ', '\xE2', '\xB0', '\x8A', ' ', '\xE2', '\xB0', '\x94', /* â°… â°„ â°‚ â°ª â°ž â°¡ â°Š â°” */
@@ -539,6 +543,8 @@
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 },
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_ASOMTAVRULI_BOTTOM, 0 },
diff --git a/thirdparty/freetype/src/autofit/afblue.cin b/thirdparty/freetype/src/autofit/afblue.cin
index f9080c54d4..4913e2eb6f 100644
--- a/thirdparty/freetype/src/autofit/afblue.cin
+++ b/thirdparty/freetype/src/autofit/afblue.cin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (body). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afblue.dat b/thirdparty/freetype/src/autofit/afblue.dat
index f62eb82a1a..bc2f0d2754 100644
--- a/thirdparty/freetype/src/autofit/afblue.dat
+++ b/thirdparty/freetype/src/autofit/afblue.dat
@@ -2,7 +2,7 @@
//
// Auto-fitter data for blue strings.
//
-// Copyright 2013-2017 by
+// Copyright 2013-2018 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
@@ -242,6 +242,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER
"â´„ â´… â´” â´• â´ â´‚ â´˜ â´"
+ AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP
+ "Ნ Ჟ Ჳ Ჸ Გ Ე ᲠᲴ"
+ AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM
+ "Ი Ჲ ᲠᲩ Მ Შ Ჯ Ჽ"
+
AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP
"â°… â°” â°ª â°„ â°‚ â°Š â°« â°‹"
AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM
@@ -795,13 +800,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
- // blue zones for Mtavruli are missing (not yet defined in Unicode)
AF_BLUE_STRINGSET_GEOR
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM, 0 }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GEORGIAN_MKHEDRULI_DESCENDER, 0 }
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM, 0 }
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GEOK
diff --git a/thirdparty/freetype/src/autofit/afblue.h b/thirdparty/freetype/src/autofit/afblue.h
index 99ef51cd4a..de31e259c3 100644
--- a/thirdparty/freetype/src/autofit/afblue.h
+++ b/thirdparty/freetype/src/autofit/afblue.h
@@ -7,7 +7,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -147,119 +147,121 @@ FT_BEGIN_HEADER
AF_BLUE_STRING_GEORGIAN_NUSKHURI_BOTTOM = 1813,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER = 1845,
AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER = 1877,
- AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP = 1909,
- AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM = 1941,
- AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP = 1973,
- AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM = 2005,
- AF_BLUE_STRING_GOTHIC_TOP = 2037,
- AF_BLUE_STRING_GOTHIC_BOTTOM = 2077,
- AF_BLUE_STRING_GREEK_CAPITAL_TOP = 2097,
- AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 2118,
- AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 2136,
- AF_BLUE_STRING_GREEK_SMALL = 2154,
- AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 2178,
- AF_BLUE_STRING_GUJARATI_TOP = 2202,
- AF_BLUE_STRING_GUJARATI_BOTTOM = 2234,
- AF_BLUE_STRING_GUJARATI_ASCENDER = 2266,
- AF_BLUE_STRING_GUJARATI_DESCENDER = 2316,
- AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 2349,
- AF_BLUE_STRING_GURMUKHI_BASE = 2369,
- AF_BLUE_STRING_GURMUKHI_HEAD = 2401,
- AF_BLUE_STRING_GURMUKHI_TOP = 2433,
- AF_BLUE_STRING_GURMUKHI_BOTTOM = 2465,
- AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 2497,
- AF_BLUE_STRING_HEBREW_TOP = 2517,
- AF_BLUE_STRING_HEBREW_BOTTOM = 2541,
- AF_BLUE_STRING_HEBREW_DESCENDER = 2559,
- AF_BLUE_STRING_KANNADA_TOP = 2574,
- AF_BLUE_STRING_KANNADA_BOTTOM = 2618,
- AF_BLUE_STRING_KAYAH_LI_TOP = 2650,
- AF_BLUE_STRING_KAYAH_LI_BOTTOM = 2674,
- AF_BLUE_STRING_KAYAH_LI_ASCENDER = 2694,
- AF_BLUE_STRING_KAYAH_LI_DESCENDER = 2702,
- AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER = 2714,
- AF_BLUE_STRING_KHMER_TOP = 2735,
- AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 2759,
- AF_BLUE_STRING_KHMER_BOTTOM = 2799,
- AF_BLUE_STRING_KHMER_DESCENDER = 2831,
- AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 2865,
- AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 2952,
- AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 2960,
- AF_BLUE_STRING_LAO_TOP = 2968,
- AF_BLUE_STRING_LAO_BOTTOM = 3000,
- AF_BLUE_STRING_LAO_ASCENDER = 3032,
- AF_BLUE_STRING_LAO_LARGE_ASCENDER = 3048,
- AF_BLUE_STRING_LAO_DESCENDER = 3060,
- AF_BLUE_STRING_LATIN_CAPITAL_TOP = 3084,
- AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 3100,
- AF_BLUE_STRING_LATIN_SMALL_F_TOP = 3116,
- AF_BLUE_STRING_LATIN_SMALL_TOP = 3130,
- AF_BLUE_STRING_LATIN_SMALL_BOTTOM = 3146,
- AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 3162,
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 3172,
- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 3192,
- AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 3212,
- AF_BLUE_STRING_LATIN_SUBS_SMALL = 3232,
- AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 3268,
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 3288,
- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 3319,
- AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 3348,
- AF_BLUE_STRING_LATIN_SUPS_SMALL = 3374,
- AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 3399,
- AF_BLUE_STRING_LISU_TOP = 3410,
- AF_BLUE_STRING_LISU_BOTTOM = 3442,
- AF_BLUE_STRING_MALAYALAM_TOP = 3474,
- AF_BLUE_STRING_MALAYALAM_BOTTOM = 3518,
- AF_BLUE_STRING_MYANMAR_TOP = 3550,
- AF_BLUE_STRING_MYANMAR_BOTTOM = 3582,
- AF_BLUE_STRING_MYANMAR_ASCENDER = 3614,
- AF_BLUE_STRING_MYANMAR_DESCENDER = 3642,
- AF_BLUE_STRING_NKO_TOP = 3674,
- AF_BLUE_STRING_NKO_BOTTOM = 3698,
- AF_BLUE_STRING_NKO_SMALL_TOP = 3713,
- AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3722,
- AF_BLUE_STRING_OL_CHIKI = 3734,
- AF_BLUE_STRING_OLD_TURKIC_TOP = 3758,
- AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3773,
- AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3793,
- AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3833,
- AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3863,
- AF_BLUE_STRING_OSAGE_SMALL_TOP = 3878,
- AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3918,
- AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 3958,
- AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 3983,
- AF_BLUE_STRING_OSMANYA_TOP = 3998,
- AF_BLUE_STRING_OSMANYA_BOTTOM = 4038,
- AF_BLUE_STRING_SAURASHTRA_TOP = 4078,
- AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4110,
- AF_BLUE_STRING_SHAVIAN_TOP = 4130,
- AF_BLUE_STRING_SHAVIAN_BOTTOM = 4140,
- AF_BLUE_STRING_SHAVIAN_DESCENDER = 4165,
- AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4175,
- AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4210,
- AF_BLUE_STRING_SINHALA_TOP = 4225,
- AF_BLUE_STRING_SINHALA_BOTTOM = 4257,
- AF_BLUE_STRING_SINHALA_DESCENDER = 4289,
- AF_BLUE_STRING_SUNDANESE_TOP = 4333,
- AF_BLUE_STRING_SUNDANESE_BOTTOM = 4357,
- AF_BLUE_STRING_SUNDANESE_DESCENDER = 4389,
- AF_BLUE_STRING_TAI_VIET_TOP = 4397,
- AF_BLUE_STRING_TAI_VIET_BOTTOM = 4417,
- AF_BLUE_STRING_TAMIL_TOP = 4429,
- AF_BLUE_STRING_TAMIL_BOTTOM = 4461,
- AF_BLUE_STRING_TELUGU_TOP = 4493,
- AF_BLUE_STRING_TELUGU_BOTTOM = 4521,
- AF_BLUE_STRING_THAI_TOP = 4549,
- AF_BLUE_STRING_THAI_BOTTOM = 4573,
- AF_BLUE_STRING_THAI_ASCENDER = 4601,
- AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4613,
- AF_BLUE_STRING_THAI_DESCENDER = 4625,
- AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4641,
- AF_BLUE_STRING_THAI_DIGIT_TOP = 4649,
- AF_BLUE_STRING_TIFINAGH = 4661,
- AF_BLUE_STRING_VAI_TOP = 4693,
- AF_BLUE_STRING_VAI_BOTTOM = 4725,
- af_blue_1_1 = 4756,
+ AF_BLUE_STRING_GEORGIAN_MTAVRULI_TOP = 1909,
+ AF_BLUE_STRING_GEORGIAN_MTAVRULI_BOTTOM = 1941,
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP = 1973,
+ AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM = 2005,
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP = 2037,
+ AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM = 2069,
+ AF_BLUE_STRING_GOTHIC_TOP = 2101,
+ AF_BLUE_STRING_GOTHIC_BOTTOM = 2141,
+ AF_BLUE_STRING_GREEK_CAPITAL_TOP = 2161,
+ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 2182,
+ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 2200,
+ AF_BLUE_STRING_GREEK_SMALL = 2218,
+ AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 2242,
+ AF_BLUE_STRING_GUJARATI_TOP = 2266,
+ AF_BLUE_STRING_GUJARATI_BOTTOM = 2298,
+ AF_BLUE_STRING_GUJARATI_ASCENDER = 2330,
+ AF_BLUE_STRING_GUJARATI_DESCENDER = 2380,
+ AF_BLUE_STRING_GUJARATI_DIGIT_TOP = 2413,
+ AF_BLUE_STRING_GURMUKHI_BASE = 2433,
+ AF_BLUE_STRING_GURMUKHI_HEAD = 2465,
+ AF_BLUE_STRING_GURMUKHI_TOP = 2497,
+ AF_BLUE_STRING_GURMUKHI_BOTTOM = 2529,
+ AF_BLUE_STRING_GURMUKHI_DIGIT_TOP = 2561,
+ AF_BLUE_STRING_HEBREW_TOP = 2581,
+ AF_BLUE_STRING_HEBREW_BOTTOM = 2605,
+ AF_BLUE_STRING_HEBREW_DESCENDER = 2623,
+ AF_BLUE_STRING_KANNADA_TOP = 2638,
+ AF_BLUE_STRING_KANNADA_BOTTOM = 2682,
+ AF_BLUE_STRING_KAYAH_LI_TOP = 2714,
+ AF_BLUE_STRING_KAYAH_LI_BOTTOM = 2738,
+ AF_BLUE_STRING_KAYAH_LI_ASCENDER = 2758,
+ AF_BLUE_STRING_KAYAH_LI_DESCENDER = 2766,
+ AF_BLUE_STRING_KAYAH_LI_LARGE_DESCENDER = 2778,
+ AF_BLUE_STRING_KHMER_TOP = 2799,
+ AF_BLUE_STRING_KHMER_SUBSCRIPT_TOP = 2823,
+ AF_BLUE_STRING_KHMER_BOTTOM = 2863,
+ AF_BLUE_STRING_KHMER_DESCENDER = 2895,
+ AF_BLUE_STRING_KHMER_LARGE_DESCENDER = 2929,
+ AF_BLUE_STRING_KHMER_SYMBOLS_WAXING_TOP = 3016,
+ AF_BLUE_STRING_KHMER_SYMBOLS_WANING_BOTTOM = 3024,
+ AF_BLUE_STRING_LAO_TOP = 3032,
+ AF_BLUE_STRING_LAO_BOTTOM = 3064,
+ AF_BLUE_STRING_LAO_ASCENDER = 3096,
+ AF_BLUE_STRING_LAO_LARGE_ASCENDER = 3112,
+ AF_BLUE_STRING_LAO_DESCENDER = 3124,
+ AF_BLUE_STRING_LATIN_CAPITAL_TOP = 3148,
+ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 3164,
+ AF_BLUE_STRING_LATIN_SMALL_F_TOP = 3180,
+ AF_BLUE_STRING_LATIN_SMALL_TOP = 3194,
+ AF_BLUE_STRING_LATIN_SMALL_BOTTOM = 3210,
+ AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 3226,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 3236,
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 3256,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 3276,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL = 3296,
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 3332,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 3352,
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 3383,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 3412,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL = 3438,
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 3463,
+ AF_BLUE_STRING_LISU_TOP = 3474,
+ AF_BLUE_STRING_LISU_BOTTOM = 3506,
+ AF_BLUE_STRING_MALAYALAM_TOP = 3538,
+ AF_BLUE_STRING_MALAYALAM_BOTTOM = 3582,
+ AF_BLUE_STRING_MYANMAR_TOP = 3614,
+ AF_BLUE_STRING_MYANMAR_BOTTOM = 3646,
+ AF_BLUE_STRING_MYANMAR_ASCENDER = 3678,
+ AF_BLUE_STRING_MYANMAR_DESCENDER = 3706,
+ AF_BLUE_STRING_NKO_TOP = 3738,
+ AF_BLUE_STRING_NKO_BOTTOM = 3762,
+ AF_BLUE_STRING_NKO_SMALL_TOP = 3777,
+ AF_BLUE_STRING_NKO_SMALL_BOTTOM = 3786,
+ AF_BLUE_STRING_OL_CHIKI = 3798,
+ AF_BLUE_STRING_OLD_TURKIC_TOP = 3822,
+ AF_BLUE_STRING_OLD_TURKIC_BOTTOM = 3837,
+ AF_BLUE_STRING_OSAGE_CAPITAL_TOP = 3857,
+ AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM = 3897,
+ AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER = 3927,
+ AF_BLUE_STRING_OSAGE_SMALL_TOP = 3942,
+ AF_BLUE_STRING_OSAGE_SMALL_BOTTOM = 3982,
+ AF_BLUE_STRING_OSAGE_SMALL_ASCENDER = 4022,
+ AF_BLUE_STRING_OSAGE_SMALL_DESCENDER = 4047,
+ AF_BLUE_STRING_OSMANYA_TOP = 4062,
+ AF_BLUE_STRING_OSMANYA_BOTTOM = 4102,
+ AF_BLUE_STRING_SAURASHTRA_TOP = 4142,
+ AF_BLUE_STRING_SAURASHTRA_BOTTOM = 4174,
+ AF_BLUE_STRING_SHAVIAN_TOP = 4194,
+ AF_BLUE_STRING_SHAVIAN_BOTTOM = 4204,
+ AF_BLUE_STRING_SHAVIAN_DESCENDER = 4229,
+ AF_BLUE_STRING_SHAVIAN_SMALL_TOP = 4239,
+ AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM = 4274,
+ AF_BLUE_STRING_SINHALA_TOP = 4289,
+ AF_BLUE_STRING_SINHALA_BOTTOM = 4321,
+ AF_BLUE_STRING_SINHALA_DESCENDER = 4353,
+ AF_BLUE_STRING_SUNDANESE_TOP = 4397,
+ AF_BLUE_STRING_SUNDANESE_BOTTOM = 4421,
+ AF_BLUE_STRING_SUNDANESE_DESCENDER = 4453,
+ AF_BLUE_STRING_TAI_VIET_TOP = 4461,
+ AF_BLUE_STRING_TAI_VIET_BOTTOM = 4481,
+ AF_BLUE_STRING_TAMIL_TOP = 4493,
+ AF_BLUE_STRING_TAMIL_BOTTOM = 4525,
+ AF_BLUE_STRING_TELUGU_TOP = 4557,
+ AF_BLUE_STRING_TELUGU_BOTTOM = 4585,
+ AF_BLUE_STRING_THAI_TOP = 4613,
+ AF_BLUE_STRING_THAI_BOTTOM = 4637,
+ AF_BLUE_STRING_THAI_ASCENDER = 4665,
+ AF_BLUE_STRING_THAI_LARGE_ASCENDER = 4677,
+ AF_BLUE_STRING_THAI_DESCENDER = 4689,
+ AF_BLUE_STRING_THAI_LARGE_DESCENDER = 4705,
+ AF_BLUE_STRING_THAI_DIGIT_TOP = 4713,
+ AF_BLUE_STRING_TIFINAGH = 4725,
+ AF_BLUE_STRING_VAI_TOP = 4757,
+ AF_BLUE_STRING_VAI_BOTTOM = 4789,
+ af_blue_1_1 = 4820,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
@@ -336,41 +338,41 @@ FT_BEGIN_HEADER
AF_BLUE_STRINGSET_DSRT = 75,
AF_BLUE_STRINGSET_ETHI = 80,
AF_BLUE_STRINGSET_GEOR = 83,
- AF_BLUE_STRINGSET_GEOK = 88,
- AF_BLUE_STRINGSET_GLAG = 95,
- AF_BLUE_STRINGSET_GOTH = 100,
- AF_BLUE_STRINGSET_GREK = 103,
- AF_BLUE_STRINGSET_GUJR = 110,
- AF_BLUE_STRINGSET_GURU = 116,
- AF_BLUE_STRINGSET_HEBR = 122,
- AF_BLUE_STRINGSET_KALI = 126,
- AF_BLUE_STRINGSET_KHMR = 132,
- AF_BLUE_STRINGSET_KHMS = 138,
- AF_BLUE_STRINGSET_KNDA = 141,
- AF_BLUE_STRINGSET_LAO = 144,
- AF_BLUE_STRINGSET_LATN = 150,
- AF_BLUE_STRINGSET_LATB = 157,
- AF_BLUE_STRINGSET_LATP = 164,
- AF_BLUE_STRINGSET_LISU = 171,
- AF_BLUE_STRINGSET_MLYM = 174,
- AF_BLUE_STRINGSET_MYMR = 177,
- AF_BLUE_STRINGSET_NKOO = 182,
- AF_BLUE_STRINGSET_NONE = 187,
- AF_BLUE_STRINGSET_OLCK = 188,
- AF_BLUE_STRINGSET_ORKH = 191,
- AF_BLUE_STRINGSET_OSGE = 194,
- AF_BLUE_STRINGSET_OSMA = 202,
- AF_BLUE_STRINGSET_SAUR = 205,
- AF_BLUE_STRINGSET_SHAW = 208,
- AF_BLUE_STRINGSET_SINH = 214,
- AF_BLUE_STRINGSET_SUND = 218,
- AF_BLUE_STRINGSET_TAML = 222,
- AF_BLUE_STRINGSET_TAVT = 225,
- AF_BLUE_STRINGSET_TELU = 228,
- AF_BLUE_STRINGSET_TFNG = 231,
- AF_BLUE_STRINGSET_THAI = 234,
- AF_BLUE_STRINGSET_VAII = 242,
- af_blue_2_1 = 245,
+ AF_BLUE_STRINGSET_GEOK = 90,
+ AF_BLUE_STRINGSET_GLAG = 97,
+ AF_BLUE_STRINGSET_GOTH = 102,
+ AF_BLUE_STRINGSET_GREK = 105,
+ AF_BLUE_STRINGSET_GUJR = 112,
+ AF_BLUE_STRINGSET_GURU = 118,
+ AF_BLUE_STRINGSET_HEBR = 124,
+ AF_BLUE_STRINGSET_KALI = 128,
+ AF_BLUE_STRINGSET_KHMR = 134,
+ AF_BLUE_STRINGSET_KHMS = 140,
+ AF_BLUE_STRINGSET_KNDA = 143,
+ AF_BLUE_STRINGSET_LAO = 146,
+ AF_BLUE_STRINGSET_LATN = 152,
+ AF_BLUE_STRINGSET_LATB = 159,
+ AF_BLUE_STRINGSET_LATP = 166,
+ AF_BLUE_STRINGSET_LISU = 173,
+ AF_BLUE_STRINGSET_MLYM = 176,
+ AF_BLUE_STRINGSET_MYMR = 179,
+ AF_BLUE_STRINGSET_NKOO = 184,
+ AF_BLUE_STRINGSET_NONE = 189,
+ AF_BLUE_STRINGSET_OLCK = 190,
+ AF_BLUE_STRINGSET_ORKH = 193,
+ AF_BLUE_STRINGSET_OSGE = 196,
+ AF_BLUE_STRINGSET_OSMA = 204,
+ AF_BLUE_STRINGSET_SAUR = 207,
+ AF_BLUE_STRINGSET_SHAW = 210,
+ AF_BLUE_STRINGSET_SINH = 216,
+ AF_BLUE_STRINGSET_SUND = 220,
+ AF_BLUE_STRINGSET_TAML = 224,
+ AF_BLUE_STRINGSET_TAVT = 227,
+ AF_BLUE_STRINGSET_TELU = 230,
+ AF_BLUE_STRINGSET_TFNG = 233,
+ AF_BLUE_STRINGSET_THAI = 236,
+ AF_BLUE_STRINGSET_VAII = 244,
+ af_blue_2_1 = 247,
#ifdef AF_CONFIG_OPTION_CJK
AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0,
af_blue_2_1_1 = af_blue_2_1 + 2,
diff --git a/thirdparty/freetype/src/autofit/afblue.hin b/thirdparty/freetype/src/autofit/afblue.hin
index 268bcbc531..682147cb30 100644
--- a/thirdparty/freetype/src/autofit/afblue.hin
+++ b/thirdparty/freetype/src/autofit/afblue.hin
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter data for blue strings (specification). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afcjk.c b/thirdparty/freetype/src/autofit/afcjk.c
index 897533d148..21b6bffa33 100644
--- a/thirdparty/freetype/src/autofit/afcjk.c
+++ b/thirdparty/freetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -16,9 +16,9 @@
/***************************************************************************/
/*
- * The algorithm is based on akito's autohint patch, available here:
+ * The algorithm is based on akito's autohint patch, archived at
*
- * http://www.kde.gr.jp/~akito/patch/freetype2/
+ * https://web.archive.org/web/20051219160454/http://www.kde.gr.jp:80/~akito/patch/freetype2/2.1.7/
*
*/
diff --git a/thirdparty/freetype/src/autofit/afcjk.h b/thirdparty/freetype/src/autofit/afcjk.h
index 84f892f909..d229c0c9cf 100644
--- a/thirdparty/freetype/src/autofit/afcjk.h
+++ b/thirdparty/freetype/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for CJK writing system (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afcover.h b/thirdparty/freetype/src/autofit/afcover.h
index 1b18c666ab..6eeb8fc9fb 100644
--- a/thirdparty/freetype/src/autofit/afcover.h
+++ b/thirdparty/freetype/src/autofit/afcover.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter coverages (specification only). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afdummy.c b/thirdparty/freetype/src/autofit/afdummy.c
index 61c32db5bf..f30c517cbb 100644
--- a/thirdparty/freetype/src/autofit/afdummy.c
+++ b/thirdparty/freetype/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afdummy.h b/thirdparty/freetype/src/autofit/afdummy.h
index ebaa7d76ea..b382acd92a 100644
--- a/thirdparty/freetype/src/autofit/afdummy.h
+++ b/thirdparty/freetype/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
/* Auto-fitter dummy routines to be used if no hinting should be */
/* performed (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aferrors.h b/thirdparty/freetype/src/autofit/aferrors.h
index dde182f3c8..e5de54360f 100644
--- a/thirdparty/freetype/src/autofit/aferrors.h
+++ b/thirdparty/freetype/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
/* */
/* Autofitter error codes (specification only). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afglobal.c b/thirdparty/freetype/src/autofit/afglobal.c
index 85bef001f7..3d09c53e8a 100644
--- a/thirdparty/freetype/src/autofit/afglobal.c
+++ b/thirdparty/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter routines to compute global hinting values (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afglobal.h b/thirdparty/freetype/src/autofit/afglobal.h
index de6142ea26..489ed46d9e 100644
--- a/thirdparty/freetype/src/autofit/afglobal.h
+++ b/thirdparty/freetype/src/autofit/afglobal.h
@@ -5,7 +5,7 @@
/* Auto-fitter routines to compute global hinting values */
/* (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afhints.c b/thirdparty/freetype/src/autofit/afhints.c
index 1b21c06c2c..0666dbc8e2 100644
--- a/thirdparty/freetype/src/autofit/afhints.c
+++ b/thirdparty/freetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -314,8 +314,12 @@
AF_DUMP(( "Table of points:\n" ));
if ( hints->num_points )
+ {
AF_DUMP(( " index hedge hseg vedge vseg flags "
+ /* " XXXXX XXXXX XXXXX XXXXX XXXXX XXXXXX" */
" xorg yorg xscale yscale xfit yfit" ));
+ /* " XXXXX XXXXX XXXX.XX XXXX.XX XXXX.XX XXXX.XX" */
+ }
else
AF_DUMP(( " (none)\n" ));
@@ -420,9 +424,14 @@
dimension == AF_DIMENSION_HORZ ? "vertical"
: "horizontal" ));
if ( axis->num_segments )
+ {
AF_DUMP(( " index pos delta dir from to "
+ /* " XXXXX XXXXX XXXXX XXXXX XXXX XXXX" */
" link serif edge"
+ /* " XXXX XXXXX XXXX" */
" height extra flags\n" ));
+ /* " XXXXXX XXXXX XXXXXXXXXXX" */
+ }
else
AF_DUMP(( " (none)\n" ));
@@ -564,8 +573,12 @@
10.0 * hints->y_scale / 65536.0 / 64.0 ));
if ( axis->num_edges )
+ {
AF_DUMP(( " index pos dir link serif"
+ /* " XXXXX XXXX.XX XXXXX XXXX XXXXX" */
" blue opos pos flags\n" ));
+ /* " X XXXX.XX XXXX.XX XXXXXXXXXXX" */
+ }
else
AF_DUMP(( " (none)\n" ));
diff --git a/thirdparty/freetype/src/autofit/afhints.h b/thirdparty/freetype/src/autofit/afhints.h
index 16638b1030..3326ebc44e 100644
--- a/thirdparty/freetype/src/autofit/afhints.h
+++ b/thirdparty/freetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -62,7 +62,7 @@ FT_BEGIN_HEADER
*
* by David Turner and Werner Lemberg
*
- * http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
+ * https://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf
*
* with appropriate updates.
*
diff --git a/thirdparty/freetype/src/autofit/afindic.c b/thirdparty/freetype/src/autofit/afindic.c
index 23be46ed51..dfbea5f34c 100644
--- a/thirdparty/freetype/src/autofit/afindic.c
+++ b/thirdparty/freetype/src/autofit/afindic.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for Indic writing system (body). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afindic.h b/thirdparty/freetype/src/autofit/afindic.h
index ec9e263161..5688738e6e 100644
--- a/thirdparty/freetype/src/autofit/afindic.h
+++ b/thirdparty/freetype/src/autofit/afindic.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for Indic writing system */
/* (specification). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin.c b/thirdparty/freetype/src/autofit/aflatin.c
index 02b3b8bbd3..9f1b54056f 100644
--- a/thirdparty/freetype/src/autofit/aflatin.c
+++ b/thirdparty/freetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin.h b/thirdparty/freetype/src/autofit/aflatin.h
index d80e125ddc..432cccce4e 100644
--- a/thirdparty/freetype/src/autofit/aflatin.h
+++ b/thirdparty/freetype/src/autofit/aflatin.h
@@ -5,7 +5,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin2.c b/thirdparty/freetype/src/autofit/aflatin2.c
index fb42445116..5c71378118 100644
--- a/thirdparty/freetype/src/autofit/aflatin2.c
+++ b/thirdparty/freetype/src/autofit/aflatin2.c
@@ -9,7 +9,7 @@
/* */
/* Auto-fitter hinting routines for latin writing system (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aflatin2.h b/thirdparty/freetype/src/autofit/aflatin2.h
index 2d0b154f58..0129dc707e 100644
--- a/thirdparty/freetype/src/autofit/aflatin2.h
+++ b/thirdparty/freetype/src/autofit/aflatin2.h
@@ -10,7 +10,7 @@
/* Auto-fitter hinting routines for latin writing system */
/* (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afloader.c b/thirdparty/freetype/src/autofit/afloader.c
index 067ebd17f6..a55550b338 100644
--- a/thirdparty/freetype/src/autofit/afloader.c
+++ b/thirdparty/freetype/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afloader.h b/thirdparty/freetype/src/autofit/afloader.h
index 2578abed16..d4d72d1583 100644
--- a/thirdparty/freetype/src/autofit/afloader.h
+++ b/thirdparty/freetype/src/autofit/afloader.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afmodule.c b/thirdparty/freetype/src/autofit/afmodule.c
index 9d7ba224da..dcaa17a27e 100644
--- a/thirdparty/freetype/src/autofit/afmodule.c
+++ b/thirdparty/freetype/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -56,7 +56,7 @@
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
-#include FT_AUTOHINTER_H
+#include FT_DRIVER_H
#include FT_SERVICE_PROPERTIES_H
diff --git a/thirdparty/freetype/src/autofit/afmodule.h b/thirdparty/freetype/src/autofit/afmodule.h
index 0571d14d59..56f64eaf23 100644
--- a/thirdparty/freetype/src/autofit/afmodule.h
+++ b/thirdparty/freetype/src/autofit/afmodule.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (specification). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afpic.c b/thirdparty/freetype/src/autofit/afpic.c
index 3125e03e27..d48d016a0e 100644
--- a/thirdparty/freetype/src/autofit/afpic.c
+++ b/thirdparty/freetype/src/autofit/afpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afpic.h b/thirdparty/freetype/src/autofit/afpic.h
index 8cd3392123..0c73456785 100644
--- a/thirdparty/freetype/src/autofit/afpic.h
+++ b/thirdparty/freetype/src/autofit/afpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afranges.c b/thirdparty/freetype/src/autofit/afranges.c
index 7f37eea1e0..cf67fafb11 100644
--- a/thirdparty/freetype/src/autofit/afranges.c
+++ b/thirdparty/freetype/src/autofit/afranges.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (body). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -91,7 +91,7 @@
AF_UNIRANGE_REC( 0x06E7, 0x06E8 ),
AF_UNIRANGE_REC( 0x06EA, 0x06ED ),
AF_UNIRANGE_REC( 0x08D4, 0x08E1 ),
- AF_UNIRANGE_REC( 0x08E3, 0x08FF ),
+ AF_UNIRANGE_REC( 0x08D3, 0x08FF ),
AF_UNIRANGE_REC( 0xFBB2, 0xFBC1 ),
AF_UNIRANGE_REC( 0xFE70, 0xFE70 ),
AF_UNIRANGE_REC( 0xFE72, 0xFE72 ),
@@ -163,6 +163,7 @@
AF_UNIRANGE_REC( 0x09C1, 0x09C4 ),
AF_UNIRANGE_REC( 0x09CD, 0x09CD ),
AF_UNIRANGE_REC( 0x09E2, 0x09E3 ),
+ AF_UNIRANGE_REC( 0x09FE, 0x09FE ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -190,6 +191,7 @@
{
AF_UNIRANGE_REC( 0x11100, 0x11102 ),
AF_UNIRANGE_REC( 0x11127, 0x11134 ),
+ AF_UNIRANGE_REC( 0x11146, 0x11146 ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -304,6 +306,7 @@
AF_UNIRANGE_REC( 0x0953, 0x0957 ),
AF_UNIRANGE_REC( 0x0962, 0x0963 ),
AF_UNIRANGE_REC( 0xA8E0, 0xA8F1 ),
+ AF_UNIRANGE_REC( 0xA8FF, 0xA8FF ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -338,11 +341,8 @@
const AF_Script_UniRangeRec af_geor_uniranges[] =
{
- AF_UNIRANGE_REC( 0x10D0, 0x10FF ), /* Georgian (Mkhedruli) */
-#if 0
- /* the following range is proposed for inclusion in Unicode */
- AF_UNIRANGE_REC( 0x1C90, 0x1CBF ), /* Georgian (Mtavruli) */
-#endif
+ AF_UNIRANGE_REC( 0x10D0, 0x10FF ), /* Georgian (Mkhedruli) */
+ AF_UNIRANGE_REC( 0x1C90, 0x1CBF ), /* Georgian Extended (Mtavruli) */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -355,8 +355,8 @@
const AF_Script_UniRangeRec af_geok_uniranges[] =
{
/* Khutsuri */
- AF_UNIRANGE_REC( 0x10A0, 0x10CD ), /* Georgian (Asomtavruli) */
- AF_UNIRANGE_REC( 0x2D00, 0x2D2D ), /* Georgian (Nuskhuri) */
+ AF_UNIRANGE_REC( 0x10A0, 0x10CD ), /* Georgian (Asomtavruli) */
+ AF_UNIRANGE_REC( 0x2D00, 0x2D2D ), /* Georgian Supplement (Nuskhuri) */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -425,6 +425,7 @@
AF_UNIRANGE_REC( 0x0AC1, 0x0AC8 ),
AF_UNIRANGE_REC( 0x0ACD, 0x0ACD ),
AF_UNIRANGE_REC( 0x0AE2, 0x0AE3 ),
+ AF_UNIRANGE_REC( 0x0AFA, 0x0AFF ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -655,7 +656,8 @@
const AF_Script_UniRangeRec af_mlym_nonbase_uniranges[] =
{
- AF_UNIRANGE_REC( 0x0D01, 0x0D01 ),
+ AF_UNIRANGE_REC( 0x0D00, 0x0D01 ),
+ AF_UNIRANGE_REC( 0x0D3B, 0x0D3C ),
AF_UNIRANGE_REC( 0x0D4D, 0x0D4E ),
AF_UNIRANGE_REC( 0x0D62, 0x0D63 ),
AF_UNIRANGE_REC( 0, 0 )
@@ -697,6 +699,7 @@
const AF_Script_UniRangeRec af_nkoo_nonbase_uniranges[] =
{
AF_UNIRANGE_REC( 0x07EB, 0x07F5 ),
+ AF_UNIRANGE_REC( 0x07FD, 0x07FD ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -856,6 +859,7 @@
const AF_Script_UniRangeRec af_telu_nonbase_uniranges[] =
{
AF_UNIRANGE_REC( 0x0C00, 0x0C00 ),
+ AF_UNIRANGE_REC( 0x0C04, 0x0C04 ),
AF_UNIRANGE_REC( 0x0C3E, 0x0C40 ),
AF_UNIRANGE_REC( 0x0C46, 0x0C56 ),
AF_UNIRANGE_REC( 0x0C62, 0x0C63 ),
@@ -1006,10 +1010,13 @@
AF_UNIRANGE_REC( 0xFE30, 0xFE4F ), /* CJK Compatibility Forms */
AF_UNIRANGE_REC( 0xFF00, 0xFFEF ), /* Halfwidth and Fullwidth Forms */
AF_UNIRANGE_REC( 0x1B000, 0x1B0FF ), /* Kana Supplement */
+ AF_UNIRANGE_REC( 0x1B100, 0x1B12F ), /* Kana Extended-A */
AF_UNIRANGE_REC( 0x1D300, 0x1D35F ), /* Tai Xuan Hing Symbols */
AF_UNIRANGE_REC( 0x20000, 0x2A6DF ), /* CJK Unified Ideographs Extension B */
AF_UNIRANGE_REC( 0x2A700, 0x2B73F ), /* CJK Unified Ideographs Extension C */
AF_UNIRANGE_REC( 0x2B740, 0x2B81F ), /* CJK Unified Ideographs Extension D */
+ AF_UNIRANGE_REC( 0x2B820, 0x2CEAF ), /* CJK Unified Ideographs Extension E */
+ AF_UNIRANGE_REC( 0x2CEB0, 0x2EBEF ), /* CJK Unified Ideographs Extension F */
AF_UNIRANGE_REC( 0x2F800, 0x2FA1F ), /* CJK Compatibility Ideographs Supplement */
AF_UNIRANGE_REC( 0, 0 )
};
diff --git a/thirdparty/freetype/src/autofit/afranges.h b/thirdparty/freetype/src/autofit/afranges.h
index 72d9eaad2c..ba3b5e7ccb 100644
--- a/thirdparty/freetype/src/autofit/afranges.h
+++ b/thirdparty/freetype/src/autofit/afranges.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter Unicode script ranges (specification). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afscript.h b/thirdparty/freetype/src/autofit/afscript.h
index cb815dbb40..623a1734a6 100644
--- a/thirdparty/freetype/src/autofit/afscript.h
+++ b/thirdparty/freetype/src/autofit/afscript.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter scripts (specification only). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -137,7 +137,7 @@
"Georgian (Mkhedruli)",
HB_SCRIPT_GEORGIAN,
HINTING_BOTTOM_TO_TOP,
- "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90" ) /* ი ე რ*/
+ "\xE1\x83\x98 \xE1\x83\x94 \xE1\x83\x90 \xE1\xB2\xBF" ) /* ი ე რᲘ */
SCRIPT( geok, GEOK,
"Georgian (Khutsuri)",
diff --git a/thirdparty/freetype/src/autofit/afshaper.c b/thirdparty/freetype/src/autofit/afshaper.c
index d259964217..f30828173c 100644
--- a/thirdparty/freetype/src/autofit/afshaper.c
+++ b/thirdparty/freetype/src/autofit/afshaper.c
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (body). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -104,10 +104,10 @@
{
hb_face_t* face;
- hb_set_t* gsub_lookups; /* GSUB lookups for a given script */
- hb_set_t* gsub_glyphs; /* glyphs covered by GSUB lookups */
- hb_set_t* gpos_lookups; /* GPOS lookups for a given script */
- hb_set_t* gpos_glyphs; /* glyphs covered by GPOS lookups */
+ hb_set_t* gsub_lookups = NULL; /* GSUB lookups for a given script */
+ hb_set_t* gsub_glyphs = NULL; /* glyphs covered by GSUB lookups */
+ hb_set_t* gpos_lookups = NULL; /* GPOS lookups for a given script */
+ hb_set_t* gpos_glyphs = NULL; /* glyphs covered by GPOS lookups */
hb_script_t script;
const hb_tag_t* coverage_tags;
@@ -127,11 +127,6 @@
face = hb_font_get_face( globals->hb_font );
- gsub_lookups = hb_set_create();
- gsub_glyphs = hb_set_create();
- gpos_lookups = hb_set_create();
- gpos_glyphs = hb_set_create();
-
coverage_tags = coverages[style_class->coverage];
script = scripts[style_class->script];
@@ -168,6 +163,7 @@
script_tags[1] = HB_TAG_NONE;
}
+ gsub_lookups = hb_set_create();
hb_ot_layout_collect_lookups( face,
HB_OT_TAG_GSUB,
script_tags,
@@ -178,13 +174,6 @@
if ( hb_set_is_empty( gsub_lookups ) )
goto Exit; /* nothing to do */
- hb_ot_layout_collect_lookups( face,
- HB_OT_TAG_GPOS,
- script_tags,
- NULL,
- coverage_tags,
- gpos_lookups );
-
FT_TRACE4(( "GSUB lookups (style `%s'):\n"
" ",
af_style_names[style_class->style] ));
@@ -193,6 +182,7 @@
count = 0;
#endif
+ gsub_glyphs = hb_set_create();
for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -220,10 +210,19 @@
" ",
af_style_names[style_class->style] ));
+ gpos_lookups = hb_set_create();
+ hb_ot_layout_collect_lookups( face,
+ HB_OT_TAG_GPOS,
+ script_tags,
+ NULL,
+ coverage_tags,
+ gpos_lookups );
+
#ifdef FT_DEBUG_LEVEL_TRACE
count = 0;
#endif
+ gpos_glyphs = hb_set_create();
for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
diff --git a/thirdparty/freetype/src/autofit/afshaper.h b/thirdparty/freetype/src/autofit/afshaper.h
index 9185d19003..7efd9f6a4e 100644
--- a/thirdparty/freetype/src/autofit/afshaper.h
+++ b/thirdparty/freetype/src/autofit/afshaper.h
@@ -4,7 +4,7 @@
/* */
/* HarfBuzz interface for accessing OpenType features (specification). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afstyles.h b/thirdparty/freetype/src/autofit/afstyles.h
index 281559eea2..e2688b3fc2 100644
--- a/thirdparty/freetype/src/autofit/afstyles.h
+++ b/thirdparty/freetype/src/autofit/afstyles.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter styles (specification only). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/aftypes.h b/thirdparty/freetype/src/autofit/aftypes.h
index 718dab70b6..6bd8c895b2 100644
--- a/thirdparty/freetype/src/autofit/aftypes.h
+++ b/thirdparty/freetype/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter types (specification only). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -76,9 +76,9 @@ extern void* _af_debug_hints;
typedef struct AF_WidthRec_
{
- FT_Pos org; /* original position/width in font units */
- FT_Pos cur; /* current/scaled position/width in device sub-pixels */
- FT_Pos fit; /* current/fitted position/width in device sub-pixels */
+ FT_Pos org; /* original position/width in font units */
+ FT_Pos cur; /* current/scaled position/width in device subpixels */
+ FT_Pos fit; /* current/fitted position/width in device subpixels */
} AF_WidthRec, *AF_Width;
diff --git a/thirdparty/freetype/src/autofit/afwarp.c b/thirdparty/freetype/src/autofit/afwarp.c
index f99aa6d987..2a75ea7b35 100644
--- a/thirdparty/freetype/src/autofit/afwarp.c
+++ b/thirdparty/freetype/src/autofit/afwarp.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afwarp.h b/thirdparty/freetype/src/autofit/afwarp.h
index 2e85cbd851..520b1be907 100644
--- a/thirdparty/freetype/src/autofit/afwarp.h
+++ b/thirdparty/freetype/src/autofit/afwarp.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter warping algorithm (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/afwrtsys.h b/thirdparty/freetype/src/autofit/afwrtsys.h
index 86749a2a83..4675f3242d 100644
--- a/thirdparty/freetype/src/autofit/afwrtsys.h
+++ b/thirdparty/freetype/src/autofit/afwrtsys.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter writing systems (specification only). */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/autofit.c b/thirdparty/freetype/src/autofit/autofit.c
index bbedad7b5f..c1605160a1 100644
--- a/thirdparty/freetype/src/autofit/autofit.c
+++ b/thirdparty/freetype/src/autofit/autofit.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/autofit/module.mk b/thirdparty/freetype/src/autofit/module.mk
index c4e249b6f1..ff05f83e7e 100644
--- a/thirdparty/freetype/src/autofit/module.mk
+++ b/thirdparty/freetype/src/autofit/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2017 by
+# Copyright 2003-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/autofit/rules.mk b/thirdparty/freetype/src/autofit/rules.mk
index ec4e1302d1..75171b412c 100644
--- a/thirdparty/freetype/src/autofit/rules.mk
+++ b/thirdparty/freetype/src/autofit/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003-2017 by
+# Copyright 2003-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/base/basepic.c b/thirdparty/freetype/src/base/basepic.c
index 57fb8169ad..bc80406441 100644
--- a/thirdparty/freetype/src/base/basepic.c
+++ b/thirdparty/freetype/src/base/basepic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/basepic.h b/thirdparty/freetype/src/base/basepic.h
index 258d4ce2ba..492d1ede56 100644
--- a/thirdparty/freetype/src/base/basepic.h
+++ b/thirdparty/freetype/src/base/basepic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for base. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftadvanc.c b/thirdparty/freetype/src/base/ftadvanc.c
index 1557607fc5..230c84d6ad 100644
--- a/thirdparty/freetype/src/base/ftadvanc.c
+++ b/thirdparty/freetype/src/base/ftadvanc.c
@@ -4,7 +4,7 @@
/* */
/* Quick computation of advance widths (body). */
/* */
-/* Copyright 2008-2017 by */
+/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -116,9 +116,12 @@
FT_Int32 flags,
FT_Fixed *padvances )
{
+ FT_Error error = FT_Err_Ok;
+
FT_Face_GetAdvancesFunc func;
- FT_UInt num, end, nn;
- FT_Error error = FT_Err_Ok;
+
+ FT_UInt num, end, nn;
+ FT_Int factor;
if ( !face )
@@ -152,16 +155,17 @@
return FT_THROW( Unimplemented_Feature );
flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
+ factor = ( flags & FT_LOAD_NO_SCALE ) ? 1 : 1024;
for ( nn = 0; nn < count; nn++ )
{
error = FT_Load_Glyph( face, start + nn, flags );
if ( error )
break;
- /* scale from 26.6 to 16.16 */
+ /* scale from 26.6 to 16.16, unless NO_SCALE was requested */
padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
- ? face->glyph->advance.y * 1024
- : face->glyph->advance.x * 1024;
+ ? face->glyph->advance.y * factor
+ : face->glyph->advance.x * factor;
}
return error;
diff --git a/thirdparty/freetype/src/base/ftapi.c b/thirdparty/freetype/src/base/ftapi.c
index 4262d37e39..32d6e95d19 100644
--- a/thirdparty/freetype/src/base/ftapi.c
+++ b/thirdparty/freetype/src/base/ftapi.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType compatibility functions (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftbase.c b/thirdparty/freetype/src/base/ftbase.c
index 55f7359942..f914b9b247 100644
--- a/thirdparty/freetype/src/base/ftbase.c
+++ b/thirdparty/freetype/src/base/ftbase.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,12 +23,15 @@
#include "ftadvanc.c"
#include "ftcalc.c"
#include "ftdbgmem.c"
+#include "ftfntfmt.c"
#include "ftgloadr.c"
#include "fthash.c"
+#include "ftlcdfil.c"
#include "ftmac.c"
#include "ftobjs.c"
#include "ftoutln.c"
#include "ftpic.c"
+#include "ftpsprop.c"
#include "ftrfork.c"
#include "ftsnames.c"
#include "ftstream.c"
diff --git a/thirdparty/freetype/src/base/ftbase.h b/thirdparty/freetype/src/base/ftbase.h
index 2072284f06..7e8cfad959 100644
--- a/thirdparty/freetype/src/base/ftbase.h
+++ b/thirdparty/freetype/src/base/ftbase.h
@@ -2,9 +2,9 @@
/* */
/* ftbase.h */
/* */
-/* The FreeType private functions used in base module (specification). */
+/* Private functions used in the `base' module (specification). */
/* */
-/* Copyright 2008-2017 by */
+/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,6 +27,8 @@
FT_BEGIN_HEADER
+#ifdef FT_CONFIG_OPTION_MAC_FONTS
+
/* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
/* see https://support.microsoft.com/en-us/kb/130437 */
#define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL
@@ -65,6 +67,8 @@ FT_BEGIN_HEADER
ft_raccess_rule_by_darwin_vfs( FT_Library library, FT_UInt rule_index );
#endif
+#endif /* FT_CONFIG_OPTION_MAC_FONTS */
+
FT_END_HEADER
diff --git a/thirdparty/freetype/src/base/ftbbox.c b/thirdparty/freetype/src/base/ftbbox.c
index 6e19da63cb..151e85c97a 100644
--- a/thirdparty/freetype/src/base/ftbbox.c
+++ b/thirdparty/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
/* */
/* FreeType bbox computation (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/base/ftbdf.c b/thirdparty/freetype/src/base/ftbdf.c
index 40f0ca2bb8..c4ea502fbc 100644
--- a/thirdparty/freetype/src/base/ftbdf.c
+++ b/thirdparty/freetype/src/base/ftbdf.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing BDF-specific strings (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftbitmap.c b/thirdparty/freetype/src/base/ftbitmap.c
index e567a0453e..a9746663fa 100644
--- a/thirdparty/freetype/src/base/ftbitmap.c
+++ b/thirdparty/freetype/src/base/ftbitmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility functions for bitmaps (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -153,38 +153,36 @@
FT_UInt ypixels )
{
FT_Error error;
- int pitch;
- int new_pitch;
+ unsigned int pitch;
+ unsigned int new_pitch;
FT_UInt bpp;
- FT_UInt i, width, height;
+ FT_UInt width, height;
unsigned char* buffer = NULL;
width = bitmap->width;
height = bitmap->rows;
- pitch = bitmap->pitch;
- if ( pitch < 0 )
- pitch = -pitch;
+ pitch = (unsigned int)FT_ABS( bitmap->pitch );
switch ( bitmap->pixel_mode )
{
case FT_PIXEL_MODE_MONO:
bpp = 1;
- new_pitch = (int)( ( width + xpixels + 7 ) >> 3 );
+ new_pitch = ( width + xpixels + 7 ) >> 3;
break;
case FT_PIXEL_MODE_GRAY2:
bpp = 2;
- new_pitch = (int)( ( width + xpixels + 3 ) >> 2 );
+ new_pitch = ( width + xpixels + 3 ) >> 2;
break;
case FT_PIXEL_MODE_GRAY4:
bpp = 4;
- new_pitch = (int)( ( width + xpixels + 1 ) >> 1 );
+ new_pitch = ( width + xpixels + 1 ) >> 1;
break;
case FT_PIXEL_MODE_GRAY:
case FT_PIXEL_MODE_LCD:
case FT_PIXEL_MODE_LCD_V:
bpp = 8;
- new_pitch = (int)( width + xpixels );
+ new_pitch = width + xpixels;
break;
default:
return FT_THROW( Invalid_Glyph_Format );
@@ -194,7 +192,7 @@
if ( ypixels == 0 && new_pitch <= pitch )
{
/* zero the padding */
- FT_UInt bit_width = (FT_UInt)pitch * 8;
+ FT_UInt bit_width = pitch * 8;
FT_UInt bit_last = ( width + xpixels ) * bpp;
@@ -235,31 +233,60 @@
{
FT_UInt len = ( width * bpp + 7 ) >> 3;
+ unsigned char* in = bitmap->buffer;
+ unsigned char* out = buffer;
+
+ unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
+ unsigned int delta = new_pitch - len;
+
+
+ FT_MEM_ZERO( out, new_pitch * ypixels );
+ out += new_pitch * ypixels;
- for ( i = 0; i < bitmap->rows; i++ )
- FT_MEM_COPY( buffer + (FT_UInt)new_pitch * ( ypixels + i ),
- bitmap->buffer + (FT_UInt)pitch * i,
- len );
+ while ( in < limit )
+ {
+ FT_MEM_COPY( out, in, len );
+ in += pitch;
+ out += len;
+
+ /* we use FT_QALLOC_MULT, which doesn't zero out the buffer; */
+ /* consequently, we have to manually zero out the remaining bytes */
+ FT_MEM_ZERO( out, delta );
+ out += delta;
+ }
}
else
{
FT_UInt len = ( width * bpp + 7 ) >> 3;
+ unsigned char* in = bitmap->buffer;
+ unsigned char* out = buffer;
+
+ unsigned char* limit = bitmap->buffer + pitch * bitmap->rows;
+ unsigned int delta = new_pitch - len;
+
- for ( i = 0; i < bitmap->rows; i++ )
- FT_MEM_COPY( buffer + (FT_UInt)new_pitch * i,
- bitmap->buffer + (FT_UInt)pitch * i,
- len );
+ while ( in < limit )
+ {
+ FT_MEM_COPY( out, in, len );
+ in += pitch;
+ out += len;
+
+ FT_MEM_ZERO( out, delta );
+ out += delta;
+ }
+
+ FT_MEM_ZERO( out, new_pitch * ypixels );
}
FT_FREE( bitmap->buffer );
bitmap->buffer = buffer;
- if ( bitmap->pitch < 0 )
- new_pitch = -new_pitch;
-
/* set pitch only, width and height are left untouched */
- bitmap->pitch = new_pitch;
+ if ( bitmap->pitch < 0 )
+ bitmap->pitch = -(int)new_pitch;
+ else
+ bitmap->pitch = (int)new_pitch;
return FT_Err_Ok;
}
@@ -444,7 +471,7 @@
* A gamma of 2.2 is fair to assume. And then, we need to
* undo the premultiplication too.
*
- * http://accessibility.kde.org/hsl-adjusted.php
+ * https://accessibility.kde.org/hsl-adjusted.php
*
* We do the computation with integers only, applying a gamma of 2.0.
* We guarantee 32-bit arithmetic to avoid overflow but the resulting
diff --git a/thirdparty/freetype/src/base/ftcalc.c b/thirdparty/freetype/src/base/ftcalc.c
index 00d63c6e6b..f4ff45f8ef 100644
--- a/thirdparty/freetype/src/base/ftcalc.c
+++ b/thirdparty/freetype/src/base/ftcalc.c
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftcid.c b/thirdparty/freetype/src/base/ftcid.c
index 398396b845..f5184649bf 100644
--- a/thirdparty/freetype/src/base/ftcid.c
+++ b/thirdparty/freetype/src/base/ftcid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing CID font information. */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* Derek Clegg and Michael Toftdal. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftdbgmem.c b/thirdparty/freetype/src/base/ftdbgmem.c
index 242246bfd1..c33d8acb4e 100644
--- a/thirdparty/freetype/src/base/ftdbgmem.c
+++ b/thirdparty/freetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -826,7 +826,7 @@
FT_Int result = 0;
- if ( getenv( "FT2_DEBUG_MEMORY" ) )
+ if ( ft_getenv( "FT2_DEBUG_MEMORY" ) )
{
table = ft_mem_table_new( memory );
if ( table )
@@ -839,7 +839,7 @@
memory->realloc = ft_mem_debug_realloc;
memory->free = ft_mem_debug_free;
- p = getenv( "FT2_ALLOC_TOTAL_MAX" );
+ p = ft_getenv( "FT2_ALLOC_TOTAL_MAX" );
if ( p )
{
FT_Long total_max = ft_strtol( p, NULL, 10 );
@@ -852,7 +852,7 @@
}
}
- p = getenv( "FT2_ALLOC_COUNT_MAX" );
+ p = ft_getenv( "FT2_ALLOC_COUNT_MAX" );
if ( p )
{
FT_Long total_count = ft_strtol( p, NULL, 10 );
@@ -865,7 +865,7 @@
}
}
- p = getenv( "FT2_KEEP_ALIVE" );
+ p = ft_getenv( "FT2_KEEP_ALIVE" );
if ( p )
{
FT_Long keep_alive = ft_strtol( p, NULL, 10 );
diff --git a/thirdparty/freetype/src/base/ftdebug.c b/thirdparty/freetype/src/base/ftdebug.c
index 20c617089f..fe26309101 100644
--- a/thirdparty/freetype/src/base/ftdebug.c
+++ b/thirdparty/freetype/src/base/ftdebug.c
@@ -4,7 +4,7 @@
/* */
/* Debugging and logging component (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -161,7 +161,7 @@
FT_BASE_DEF( void )
ft_debug_init( void )
{
- const char* ft2_debug = getenv( "FT2_DEBUG" );
+ const char* ft2_debug = ft_getenv( "FT2_DEBUG" );
if ( ft2_debug )
diff --git a/thirdparty/freetype/src/base/ftfntfmt.c b/thirdparty/freetype/src/base/ftfntfmt.c
index dcbeba0053..a2900ceb09 100644
--- a/thirdparty/freetype/src/base/ftfntfmt.c
+++ b/thirdparty/freetype/src/base/ftfntfmt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for font formats (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftfstype.c b/thirdparty/freetype/src/base/ftfstype.c
index cec4fb3025..e6cdf6e2ec 100644
--- a/thirdparty/freetype/src/base/ftfstype.c
+++ b/thirdparty/freetype/src/base/ftfstype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file to access FSType data (body). */
/* */
-/* Copyright 2008-2017 by */
+/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftgasp.c b/thirdparty/freetype/src/base/ftgasp.c
index 477b72558c..4f80bba630 100644
--- a/thirdparty/freetype/src/base/ftgasp.c
+++ b/thirdparty/freetype/src/base/ftgasp.c
@@ -4,7 +4,7 @@
/* */
/* Access of TrueType's `gasp' table (body). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftgloadr.c b/thirdparty/freetype/src/base/ftgloadr.c
index 8134003b4b..47202496b9 100644
--- a/thirdparty/freetype/src/base/ftgloadr.c
+++ b/thirdparty/freetype/src/base/ftgloadr.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftglyph.c b/thirdparty/freetype/src/base/ftglyph.c
index 3f78a8c36b..6759aa25d0 100644
--- a/thirdparty/freetype/src/base/ftglyph.c
+++ b/thirdparty/freetype/src/base/ftglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftgxval.c b/thirdparty/freetype/src/base/ftgxval.c
index ff24d336df..19e2d6acb5 100644
--- a/thirdparty/freetype/src/base/ftgxval.c
+++ b/thirdparty/freetype/src/base/ftgxval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating TrueTypeGX/AAT tables (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/base/ftinit.c b/thirdparty/freetype/src/base/ftinit.c
index b3b08fa541..1fa4721094 100644
--- a/thirdparty/freetype/src/base/ftinit.c
+++ b/thirdparty/freetype/src/base/ftinit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType initialization layer (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftlcdfil.c b/thirdparty/freetype/src/base/ftlcdfil.c
index 60c813fd9e..8d314df080 100644
--- a/thirdparty/freetype/src/base/ftlcdfil.c
+++ b/thirdparty/freetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,8 +31,41 @@
#define FT_SHIFTCLAMP( x ) ( x >>= 8, (FT_Byte)( x > 255 ? 255 : x ) )
+
+ /* add padding according to filter weights */
+ FT_BASE_DEF (void)
+ ft_lcd_padding( FT_Pos* Min,
+ FT_Pos* Max,
+ FT_GlyphSlot slot )
+ {
+ FT_Byte* lcd_weights;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func;
+
+
+ /* Per-face LCD filtering takes priority if set up. */
+ if ( slot->face && slot->face->internal->lcd_filter_func )
+ {
+ lcd_weights = slot->face->internal->lcd_weights;
+ lcd_filter_func = slot->face->internal->lcd_filter_func;
+ }
+ else
+ {
+ lcd_weights = slot->library->lcd_weights;
+ lcd_filter_func = slot->library->lcd_filter_func;
+ }
+
+ if ( lcd_filter_func == ft_lcd_filter_fir )
+ {
+ *Min -= lcd_weights[0] ? 43 :
+ lcd_weights[1] ? 22 : 0;
+ *Max += lcd_weights[4] ? 43 :
+ lcd_weights[3] ? 22 : 0;
+ }
+ }
+
+
/* FIR filter used by the default and light filters */
- FT_BASE( void )
+ FT_BASE_DEF( void )
ft_lcd_filter_fir( FT_Bitmap* bitmap,
FT_Render_Mode mode,
FT_LcdFiveTapFilter weights )
@@ -44,7 +77,7 @@
/* take care of bitmap flow */
- if ( pitch > 0 )
+ if ( pitch > 0 && height > 0 )
origin += pitch * (FT_Int)( height - 1 );
/* horizontal in-place FIR filter */
@@ -159,7 +192,7 @@
/* take care of bitmap flow */
- if ( pitch > 0 )
+ if ( pitch > 0 && height > 0 )
origin += pitch * (FT_Int)( height - 1 );
/* horizontal in-place intra-pixel filter */
@@ -305,21 +338,21 @@
return FT_THROW( Invalid_Argument );
}
- library->lcd_filter = filter;
-
return FT_Err_Ok;
}
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
- FT_BASE( void )
- ft_lcd_filter_fir( FT_Bitmap* bitmap,
- FT_Render_Mode mode,
- FT_LcdFiveTapFilter weights )
+ /* add padding according to accommodate outline shifts */
+ FT_BASE_DEF (void)
+ ft_lcd_padding( FT_Pos* Min,
+ FT_Pos* Max,
+ FT_GlyphSlot slot )
{
- FT_UNUSED( bitmap );
- FT_UNUSED( mode );
- FT_UNUSED( weights );
+ FT_UNUSED( slot );
+
+ *Min -= 21;
+ *Max += 21;
}
diff --git a/thirdparty/freetype/src/base/ftmac.c b/thirdparty/freetype/src/base/ftmac.c
index 4e76585e5f..fd4c0cc274 100644
--- a/thirdparty/freetype/src/base/ftmac.c
+++ b/thirdparty/freetype/src/base/ftmac.c
@@ -8,7 +8,7 @@
/* This file is for Mac OS X only; see builds/mac/ftoldmac.c for */
/* classic platforms built by MPW. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftmm.c b/thirdparty/freetype/src/base/ftmm.c
index 43877ece45..800441bcac 100644
--- a/thirdparty/freetype/src/base/ftmm.c
+++ b/thirdparty/freetype/src/base/ftmm.c
@@ -4,7 +4,7 @@
/* */
/* Multiple Master font support (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -148,6 +148,25 @@
/* documentation is in ftmm.h */
FT_EXPORT_DEF( FT_Error )
+ FT_Done_MM_Var( FT_Library library,
+ FT_MM_Var* amaster )
+ {
+ FT_Memory memory;
+
+
+ if ( !library )
+ return FT_THROW( Invalid_Library_Handle );
+
+ memory = library->memory;
+ FT_FREE( amaster );
+
+ return FT_Err_Ok;
+ }
+
+
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords )
@@ -203,6 +222,10 @@
error = FT_ERR( Invalid_Argument );
if ( service_mm->set_var_design )
error = service_mm->set_var_design( face, num_coords, coords );
+
+ /* internal error code -1 means `no change'; we can exit immediately */
+ if ( error == -1 )
+ return FT_Err_Ok;
}
if ( !error )
@@ -275,6 +298,10 @@
error = FT_ERR( Invalid_Argument );
if ( service_mm->set_mm_blend )
error = service_mm->set_mm_blend( face, num_coords, coords );
+
+ /* internal error code -1 means `no change'; we can exit immediately */
+ if ( error == -1 )
+ return FT_Err_Ok;
}
if ( !error )
@@ -322,6 +349,10 @@
error = FT_ERR( Invalid_Argument );
if ( service_mm->set_mm_blend )
error = service_mm->set_mm_blend( face, num_coords, coords );
+
+ /* internal error code -1 means `no change'; we can exit immediately */
+ if ( error == -1 )
+ return FT_Err_Ok;
}
if ( !error )
@@ -426,4 +457,52 @@
}
+ /* documentation is in ftmm.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Set_Named_Instance( FT_Face face,
+ FT_UInt instance_index )
+ {
+ FT_Error error;
+
+ FT_Service_MultiMasters service_mm = NULL;
+ FT_Service_MetricsVariations service_mvar = NULL;
+
+
+ /* check of `face' delayed to `ft_face_get_mm_service' */
+
+ error = ft_face_get_mm_service( face, &service_mm );
+ if ( !error )
+ {
+ error = FT_ERR( Invalid_Argument );
+ if ( service_mm->set_instance )
+ error = service_mm->set_instance( face, instance_index );
+ }
+
+ if ( !error )
+ {
+ (void)ft_face_get_mvar_service( face, &service_mvar );
+
+ if ( service_mvar && service_mvar->metrics_adjust )
+ service_mvar->metrics_adjust( face );
+ }
+
+ /* enforce recomputation of auto-hinting data */
+ if ( !error && face->autohint.finalizer )
+ {
+ face->autohint.finalizer( face->autohint.data );
+ face->autohint.data = NULL;
+ }
+
+ if ( !error )
+ {
+ face->face_index = ( instance_index << 16 ) |
+ ( face->face_index & 0xFFFFL );
+ face->face_flags &= ~FT_FACE_FLAG_VARIATION;
+ }
+
+ return error;
+ }
+
+
/* END */
diff --git a/thirdparty/freetype/src/base/ftobjs.c b/thirdparty/freetype/src/base/ftobjs.c
index 6db8136cfc..8d07e35ae3 100644
--- a/thirdparty/freetype/src/base/ftobjs.c
+++ b/thirdparty/freetype/src/base/ftobjs.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,12 +19,16 @@
#include <ft2build.h>
#include FT_LIST_H
#include FT_OUTLINE_H
+#include FT_FONT_FORMATS_H
+
#include FT_INTERNAL_VALIDATE_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_RFORK_H
#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */
+#include FT_INTERNAL_SFNT_H /* for SFNT_Load_Table_Func */
+#include FT_INTERNAL_POSTSCRIPT_AUX_H /* for PS_Driver */
+
#include FT_TRUETYPE_TABLES_H
#include FT_TRUETYPE_TAGS_H
#include FT_TRUETYPE_IDS_H
@@ -37,8 +41,7 @@
#include FT_SERVICE_KERNING_H
#include FT_SERVICE_TRUETYPE_ENGINE_H
-#include FT_AUTOHINTER_H
-#include FT_CFF_DRIVER_H
+#include FT_DRIVER_H
#ifdef FT_CONFIG_OPTION_MAC_FONTS
#include "ftbase.h"
@@ -328,6 +331,138 @@
FT_BASE_DEF( void )
+ ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
+ FT_Render_Mode mode,
+ const FT_Vector* origin )
+ {
+ FT_Outline* outline = &slot->outline;
+ FT_Bitmap* bitmap = &slot->bitmap;
+
+ FT_Pixel_Mode pixel_mode;
+
+ FT_BBox cbox;
+ FT_Pos x_shift = 0;
+ FT_Pos y_shift = 0;
+ FT_Pos x_left, y_top;
+ FT_Pos width, height, pitch;
+
+
+ if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
+ return;
+
+ if ( origin )
+ {
+ x_shift = origin->x;
+ y_shift = origin->y;
+ }
+
+ /* compute the control box, and grid-fit it, */
+ /* taking into account the origin shift */
+ FT_Outline_Get_CBox( outline, &cbox );
+
+ cbox.xMin += x_shift;
+ cbox.yMin += y_shift;
+ cbox.xMax += x_shift;
+ cbox.yMax += y_shift;
+
+ switch ( mode )
+ {
+ case FT_RENDER_MODE_MONO:
+ pixel_mode = FT_PIXEL_MODE_MONO;
+#if 1
+ /* undocumented but confirmed: bbox values get rounded */
+ /* unless the rounded box can collapse for a narrow glyph */
+ if ( cbox.xMax - cbox.xMin < 64 )
+ {
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
+ }
+ else
+ {
+ cbox.xMin = FT_PIX_ROUND_LONG( cbox.xMin );
+ cbox.xMax = FT_PIX_ROUND_LONG( cbox.xMax );
+ }
+
+ if ( cbox.yMax - cbox.yMin < 64 )
+ {
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+ }
+ else
+ {
+ cbox.yMin = FT_PIX_ROUND_LONG( cbox.yMin );
+ cbox.yMax = FT_PIX_ROUND_LONG( cbox.yMax );
+ }
+#else
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+#endif
+ break;
+
+ case FT_RENDER_MODE_LCD:
+ pixel_mode = FT_PIXEL_MODE_LCD;
+ ft_lcd_padding( &cbox.xMin, &cbox.xMax, slot );
+ goto Round;
+
+ case FT_RENDER_MODE_LCD_V:
+ pixel_mode = FT_PIXEL_MODE_LCD_V;
+ ft_lcd_padding( &cbox.yMin, &cbox.yMax, slot );
+ goto Round;
+
+ case FT_RENDER_MODE_NORMAL:
+ case FT_RENDER_MODE_LIGHT:
+ default:
+ pixel_mode = FT_PIXEL_MODE_GRAY;
+ Round:
+ cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
+ cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
+ cbox.xMax = FT_PIX_CEIL_LONG( cbox.xMax );
+ cbox.yMax = FT_PIX_CEIL_LONG( cbox.yMax );
+ }
+
+ x_shift = SUB_LONG( x_shift, cbox.xMin );
+ y_shift = SUB_LONG( y_shift, cbox.yMin );
+
+ x_left = cbox.xMin >> 6;
+ y_top = cbox.yMax >> 6;
+
+ width = ( (FT_ULong)cbox.xMax - (FT_ULong)cbox.xMin ) >> 6;
+ height = ( (FT_ULong)cbox.yMax - (FT_ULong)cbox.yMin ) >> 6;
+
+ switch ( pixel_mode )
+ {
+ case FT_PIXEL_MODE_MONO:
+ pitch = ( ( width + 15 ) >> 4 ) << 1;
+ break;
+
+ case FT_PIXEL_MODE_LCD:
+ width *= 3;
+ pitch = FT_PAD_CEIL( width, 4 );
+ break;
+
+ case FT_PIXEL_MODE_LCD_V:
+ height *= 3;
+ /* fall through */
+
+ case FT_PIXEL_MODE_GRAY:
+ default:
+ pitch = width;
+ }
+
+ slot->bitmap_left = (FT_Int)x_left;
+ slot->bitmap_top = (FT_Int)y_top;
+
+ bitmap->pixel_mode = (unsigned char)pixel_mode;
+ bitmap->num_grays = 256;
+ bitmap->width = (unsigned int)width;
+ bitmap->rows = (unsigned int)height;
+ bitmap->pitch = pitch;
+ }
+
+
+ FT_BASE_DEF( void )
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
FT_Byte* buffer )
{
@@ -669,9 +804,13 @@
* Determine whether we need to auto-hint or not.
* The general rules are:
*
- * - Do only auto-hinting if we have a hinter module, a scalable font
- * format dealing with outlines, and no transforms except simple
- * slants and/or rotations by integer multiples of 90 degrees.
+ * - Do only auto-hinting if we have
+ *
+ * - a hinter module,
+ * - a scalable font format dealing with outlines,
+ * - not a tricky font, and
+ * - no transforms except simple slants and/or rotations by
+ * integer multiples of 90 degrees.
*
* - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
* have a native font hinter.
@@ -701,8 +840,15 @@
else
{
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
+ FT_Bool is_light_type1;
+ /* only the new Adobe engine (for both CFF and Type 1) is `light'; */
+ /* we use `strstr' to catch both `Type 1' and `CID Type 1' */
+ is_light_type1 =
+ ft_strstr( FT_Get_Font_Format( face ), "Type 1" ) != NULL &&
+ ((PS_Driver)driver)->hinting_engine == FT_HINTING_ADOBE;
+
/* the check for `num_locations' assures that we actually */
/* test for instructions in a TTF and not in a CFF-based OTF */
/* */
@@ -710,8 +856,9 @@
/* check the size of the `fpgm' and `prep' tables, too -- */
/* the assumption is that there don't exist real TTFs where */
/* both `fpgm' and `prep' tables are missing */
- if ( ( mode == FT_RENDER_MODE_LIGHT &&
- !FT_DRIVER_HINTS_LIGHTLY( driver ) ) ||
+ if ( ( mode == FT_RENDER_MODE_LIGHT &&
+ ( !FT_DRIVER_HINTS_LIGHTLY( driver ) &&
+ !is_light_type1 ) ) ||
( FT_IS_SFNT( face ) &&
ttface->num_locations &&
ttface->max_profile.maxSizeOfInstructions == 0 &&
@@ -731,8 +878,8 @@
/* XXX: This is really a temporary hack that should disappear */
/* promptly with FreeType 2.1! */
/* */
- if ( FT_HAS_FIXED_SIZES( face ) &&
- ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
+ if ( FT_HAS_FIXED_SIZES( face ) &&
+ ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
error = driver->clazz->load_glyph( slot, face->size,
glyph_index,
@@ -800,7 +947,7 @@
/* compute the linear advance in 16.16 pixels */
if ( ( load_flags & FT_LOAD_LINEAR_DESIGN ) == 0 &&
- ( FT_IS_SCALABLE( face ) ) )
+ FT_IS_SCALABLE( face ) )
{
FT_Size_Metrics* metrics = &face->size->metrics;
@@ -848,28 +995,37 @@
}
}
- FT_TRACE5(( " x advance: %d\n" , slot->advance.x ));
- FT_TRACE5(( " y advance: %d\n" , slot->advance.y ));
-
- FT_TRACE5(( " linear x advance: %d\n" , slot->linearHoriAdvance ));
- FT_TRACE5(( " linear y advance: %d\n" , slot->linearVertAdvance ));
-
- /* do we need to render the image now? */
+ /* do we need to render the image or preset the bitmap now? */
if ( !error &&
+ ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
slot->format != FT_GLYPH_FORMAT_BITMAP &&
- slot->format != FT_GLYPH_FORMAT_COMPOSITE &&
- load_flags & FT_LOAD_RENDER )
+ slot->format != FT_GLYPH_FORMAT_COMPOSITE )
{
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
- if ( mode == FT_RENDER_MODE_NORMAL &&
- (load_flags & FT_LOAD_MONOCHROME ) )
+ if ( mode == FT_RENDER_MODE_NORMAL &&
+ load_flags & FT_LOAD_MONOCHROME )
mode = FT_RENDER_MODE_MONO;
- error = FT_Render_Glyph( slot, mode );
+ if ( load_flags & FT_LOAD_RENDER )
+ error = FT_Render_Glyph( slot, mode );
+ else
+ ft_glyphslot_preset_bitmap( slot, mode, NULL );
}
+ FT_TRACE5(( "FT_Load_Glyph: index %d, flags %x\n",
+ glyph_index, load_flags ));
+ FT_TRACE5(( " x advance: %f\n", slot->advance.x / 64.0 ));
+ FT_TRACE5(( " y advance: %f\n", slot->advance.y / 64.0 ));
+ FT_TRACE5(( " linear x advance: %f\n",
+ slot->linearHoriAdvance / 65536.0 ));
+ FT_TRACE5(( " linear y advance: %f\n",
+ slot->linearVertAdvance / 65536.0 ));
+ FT_TRACE5(( " bitmap %dx%d, mode %d\n",
+ slot->bitmap.width, slot->bitmap.rows,
+ slot->bitmap.pixel_mode ));
+
Exit:
return error;
}
@@ -2441,7 +2597,8 @@
internal->no_stem_darkening = -1;
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- ft_memset( internal->lcd_weights, 0, FT_LCD_FILTER_FIVE_TAPS );
+ /* Per-face filtering can only be set up by FT_Face_Properties */
+ internal->lcd_filter_func = NULL;
#endif
}
@@ -2864,18 +3021,6 @@
metrics->height = bsize->height << 6;
metrics->max_advance = bsize->x_ppem;
}
-
- FT_TRACE5(( "FT_Select_Metrics:\n" ));
- FT_TRACE5(( " x scale: %d (%f)\n",
- metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %d (%f)\n",
- metrics->y_scale, metrics->y_scale / 65536.0 ));
- FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
- FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
- FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
- FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
- FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
- FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
}
@@ -2984,18 +3129,6 @@
metrics->x_scale = 1L << 16;
metrics->y_scale = 1L << 16;
}
-
- FT_TRACE5(( "FT_Request_Metrics:\n" ));
- FT_TRACE5(( " x scale: %d (%f)\n",
- metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %d (%f)\n",
- metrics->y_scale, metrics->y_scale / 65536.0 ));
- FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
- FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
- FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
- FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
- FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
- FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
}
@@ -3005,6 +3138,7 @@
FT_Select_Size( FT_Face face,
FT_Int strike_index )
{
+ FT_Error error = FT_Err_Ok;
FT_Driver_Class clazz;
@@ -3018,36 +3152,37 @@
if ( clazz->select_size )
{
- FT_Error error;
+ error = clazz->select_size( face->size, (FT_ULong)strike_index );
+ FT_TRACE5(( "FT_Select_Size (%s driver):\n",
+ face->driver->root.clazz->module_name ));
+ }
+ else
+ {
+ FT_Select_Metrics( face, (FT_ULong)strike_index );
- error = clazz->select_size( face->size, (FT_ULong)strike_index );
+ FT_TRACE5(( "FT_Select_Size:\n" ));
+ }
#ifdef FT_DEBUG_LEVEL_TRACE
- {
- FT_Size_Metrics* metrics = &face->size->metrics;
-
-
- FT_TRACE5(( "FT_Select_Size (font driver's `select_size'):\n" ));
- FT_TRACE5(( " x scale: %d (%f)\n",
- metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %d (%f)\n",
- metrics->y_scale, metrics->y_scale / 65536.0 ));
- FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
- FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
- FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
- FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
- FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
- FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
- }
-#endif
+ {
+ FT_Size_Metrics* metrics = &face->size->metrics;
- return error;
- }
- FT_Select_Metrics( face, (FT_ULong)strike_index );
+ FT_TRACE5(( " x scale: %d (%f)\n",
+ metrics->x_scale, metrics->x_scale / 65536.0 ));
+ FT_TRACE5(( " y scale: %d (%f)\n",
+ metrics->y_scale, metrics->y_scale / 65536.0 ));
+ FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
+ FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
+ FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
+ FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
+ FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
+ FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
+ }
+#endif
- return FT_Err_Ok;
+ return error;
}
@@ -3057,6 +3192,7 @@
FT_Request_Size( FT_Face face,
FT_Size_Request req )
{
+ FT_Error error = FT_Err_Ok;
FT_Driver_Class clazz;
FT_ULong strike_index;
@@ -3076,55 +3212,52 @@
if ( clazz->request_size )
{
- FT_Error error;
-
-
error = clazz->request_size( face->size, req );
-#ifdef FT_DEBUG_LEVEL_TRACE
- {
- FT_Size_Metrics* metrics = &face->size->metrics;
-
-
- FT_TRACE5(( "FT_Request_Size (font driver's `request_size'):\n" ));
- FT_TRACE5(( " x scale: %d (%f)\n",
- metrics->x_scale, metrics->x_scale / 65536.0 ));
- FT_TRACE5(( " y scale: %d (%f)\n",
- metrics->y_scale, metrics->y_scale / 65536.0 ));
- FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
- FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
- FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
- FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
- FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
- FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
- }
-#endif
-
- return error;
+ FT_TRACE5(( "FT_Request_Size (%s driver):\n",
+ face->driver->root.clazz->module_name ));
}
-
- /*
- * The reason that a driver doesn't have `request_size' defined is
- * either that the scaling here suffices or that the supported formats
- * are bitmap-only and size matching is not implemented.
- *
- * In the latter case, a simple size matching is done.
- */
- if ( !FT_IS_SCALABLE( face ) && FT_HAS_FIXED_SIZES( face ) )
+ else if ( !FT_IS_SCALABLE( face ) && FT_HAS_FIXED_SIZES( face ) )
{
- FT_Error error;
-
-
+ /*
+ * The reason that a driver doesn't have `request_size' defined is
+ * either that the scaling here suffices or that the supported formats
+ * are bitmap-only and size matching is not implemented.
+ *
+ * In the latter case, a simple size matching is done.
+ */
error = FT_Match_Size( face, req, 0, &strike_index );
if ( error )
return error;
return FT_Select_Size( face, (FT_Int)strike_index );
}
+ else
+ {
+ FT_Request_Metrics( face, req );
- FT_Request_Metrics( face, req );
+ FT_TRACE5(( "FT_Request_Size:\n" ));
+ }
- return FT_Err_Ok;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_Size_Metrics* metrics = &face->size->metrics;
+
+
+ FT_TRACE5(( " x scale: %d (%f)\n",
+ metrics->x_scale, metrics->x_scale / 65536.0 ));
+ FT_TRACE5(( " y scale: %d (%f)\n",
+ metrics->y_scale, metrics->y_scale / 65536.0 ));
+ FT_TRACE5(( " ascender: %f\n", metrics->ascender / 64.0 ));
+ FT_TRACE5(( " descender: %f\n", metrics->descender / 64.0 ));
+ FT_TRACE5(( " height: %f\n", metrics->height / 64.0 ));
+ FT_TRACE5(( " max advance: %f\n", metrics->max_advance / 64.0 ));
+ FT_TRACE5(( " x ppem: %d\n", metrics->x_ppem ));
+ FT_TRACE5(( " y ppem: %d\n", metrics->y_ppem ));
+ }
+#endif
+
+ return error;
}
@@ -3653,16 +3786,11 @@
{
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
if ( properties->data )
+ {
ft_memcpy( face->internal->lcd_weights,
properties->data,
FT_LCD_FILTER_FIVE_TAPS );
- else
- {
- /* Value NULL indicates `no custom weights, use library */
- /* defaults', signaled by filling the weight field with zeros. */
- ft_memset( face->internal->lcd_weights,
- 0,
- FT_LCD_FILTER_FIVE_TAPS );
+ face->internal->lcd_filter_func = ft_lcd_filter_fir;
}
#else
error = FT_THROW( Unimplemented_Feature );
@@ -4414,43 +4542,97 @@
*/
/* we use FT_TRACE3 in this block */
- if ( ft_trace_levels[trace_bitmap] >= 3 )
+ if ( !error &&
+ ft_trace_levels[trace_bitmap] >= 3 &&
+ slot->bitmap.buffer )
{
+ FT_Bitmap bitmap;
+ FT_Error err;
+
+
+ FT_Bitmap_Init( &bitmap );
+
/* we convert to a single bitmap format for computing the checksum */
- if ( !error && slot->bitmap.buffer )
+ /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */
+ err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );
+ if ( !err )
{
- FT_Bitmap bitmap;
- FT_Error err;
+ MD5_CTX ctx;
+ unsigned char md5[16];
+ unsigned long coverage = 0;
+ int i, j;
+ int rows = (int)bitmap.rows;
+ int pitch = bitmap.pitch;
+
+
+ FT_TRACE3(( "FT_Render_Glyph: bitmap %dx%d, mode %d\n",
+ rows, pitch, slot->bitmap.pixel_mode ));
+
+ for ( i = 0; i < rows; i++ )
+ for ( j = 0; j < pitch; j++ )
+ coverage += bitmap.buffer[i * pitch + j];
+ FT_TRACE3(( " Total coverage: %lu\n", coverage ));
- FT_Bitmap_Init( &bitmap );
+ MD5_Init( &ctx );
+ if ( bitmap.buffer )
+ MD5_Update( &ctx, bitmap.buffer,
+ (unsigned long)rows * (unsigned long)pitch );
+ MD5_Final( md5, &ctx );
- /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */
- err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );
- if ( !err )
+ FT_TRACE3(( " MD5 checksum: " ));
+ for ( i = 0; i < 16; i++ )
+ FT_TRACE3(( "%02X", md5[i] ));
+ FT_TRACE3(( "\n" ));
+ }
+
+ FT_Bitmap_Done( library, &bitmap );
+ }
+
+ /*
+ * Dump bitmap in Netpbm format (PBM or PGM).
+ */
+
+ /* we use FT_TRACE7 in this block */
+ if ( !error &&
+ ft_trace_levels[trace_bitmap] >= 7 &&
+ slot->bitmap.rows < 128U &&
+ slot->bitmap.width < 128U &&
+ slot->bitmap.buffer )
+ {
+ int rows = (int)slot->bitmap.rows;
+ int width = (int)slot->bitmap.width;
+ int pitch = slot->bitmap.pitch;
+ int i, j, m;
+ unsigned char* topleft = slot->bitmap.buffer;
+
+ if ( pitch < 0 )
+ topleft -= pitch * ( rows - 1 );
+
+ FT_TRACE7(( "Netpbm image: start\n" ));
+ switch ( slot->bitmap.pixel_mode )
+ {
+ case FT_PIXEL_MODE_MONO:
+ FT_TRACE7(( "P1 %d %d\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
{
- MD5_CTX ctx;
- unsigned char md5[16];
- int i;
- unsigned int rows = bitmap.rows;
- unsigned int pitch = (unsigned int)bitmap.pitch;
-
-
- MD5_Init( &ctx );
- if ( bitmap.buffer )
- MD5_Update( &ctx, bitmap.buffer, rows * pitch );
- MD5_Final( md5, &ctx );
-
- FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n"
- " ",
- rows, pitch ));
- for ( i = 0; i < 16; i++ )
- FT_TRACE3(( "%02X", md5[i] ));
- FT_TRACE3(( "\n" ));
+ for ( j = 0; j < width; )
+ for ( m = 128; m > 0 && j < width; m >>= 1, j++ )
+ FT_TRACE7(( " %d", ( topleft[i * pitch + j / 8] & m ) != 0 ));
+ FT_TRACE7(( "\n" ));
}
+ break;
- FT_Bitmap_Done( library, &bitmap );
+ default:
+ FT_TRACE7(( "P2 %d %d 255\n", width, rows ));
+ for ( i = 0; i < rows; i++ )
+ {
+ for ( j = 0; j < width; j += 1 )
+ FT_TRACE7(( " %3u", topleft[i * pitch + j] ));
+ FT_TRACE7(( "\n" ));
+ }
}
+ FT_TRACE7(( "Netpbm image: end\n" ));
}
#undef FT_COMPONENT
@@ -4995,9 +5177,9 @@
#ifdef FT_CONFIG_OPTION_PIC
Fail:
ft_pic_container_destroy( library );
-#endif
FT_FREE( library );
return error;
+#endif
}
diff --git a/thirdparty/freetype/src/base/ftotval.c b/thirdparty/freetype/src/base/ftotval.c
index 5fa098691e..a2944a7950 100644
--- a/thirdparty/freetype/src/base/ftotval.c
+++ b/thirdparty/freetype/src/base/ftotval.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for validating OpenType tables (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftoutln.c b/thirdparty/freetype/src/base/ftoutln.c
index 9ceb9cf1ba..cb91321deb 100644
--- a/thirdparty/freetype/src/base/ftoutln.c
+++ b/thirdparty/freetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -286,12 +286,13 @@
FT_TRACE5(( "FT_Outline_Decompose: Done\n", n ));
return FT_Err_Ok;
+ Invalid_Outline:
+ error = FT_THROW( Invalid_Outline );
+ /* fall through */
+
Exit:
FT_TRACE5(( "FT_Outline_Decompose: Error 0x%x\n", error ));
return error;
-
- Invalid_Outline:
- return FT_THROW( Invalid_Outline );
}
@@ -540,8 +541,8 @@
for ( n = 0; n < outline->n_points; n++ )
{
- vec->x += xOffset;
- vec->y += yOffset;
+ vec->x = ADD_LONG( vec->x, xOffset );
+ vec->y = ADD_LONG( vec->y, yOffset );
vec++;
}
}
diff --git a/thirdparty/freetype/src/base/ftpatent.c b/thirdparty/freetype/src/base/ftpatent.c
index 9900f99bfc..e23ee2e3f4 100644
--- a/thirdparty/freetype/src/base/ftpatent.c
+++ b/thirdparty/freetype/src/base/ftpatent.c
@@ -5,7 +5,7 @@
/* FreeType API for checking patented TrueType bytecode instructions */
/* (body). Obsolete, retained for backward compatibility. */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftpfr.c b/thirdparty/freetype/src/base/ftpfr.c
index 5cc0b70726..bfe13520eb 100644
--- a/thirdparty/freetype/src/base/ftpfr.c
+++ b/thirdparty/freetype/src/base/ftpfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftpic.c b/thirdparty/freetype/src/base/ftpic.c
index 0f84fddc98..1492e1809a 100644
--- a/thirdparty/freetype/src/base/ftpic.c
+++ b/thirdparty/freetype/src/base/ftpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services (body). */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftpsprop.c b/thirdparty/freetype/src/base/ftpsprop.c
new file mode 100644
index 0000000000..459b5e6054
--- /dev/null
+++ b/thirdparty/freetype/src/base/ftpsprop.c
@@ -0,0 +1,285 @@
+/***************************************************************************/
+/* */
+/* ftpsprop.c */
+/* */
+/* Get and set properties of PostScript drivers (body). */
+/* See `ftdriver.h' for available properties. */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_DRIVER_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_POSTSCRIPT_PROPS_H
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_psprops
+
+
+ FT_BASE_CALLBACK_DEF( FT_Error )
+ ps_property_set( FT_Module module, /* PS_Driver */
+ const char* property_name,
+ const void* value,
+ FT_Bool value_is_string )
+ {
+ FT_Error error = FT_Err_Ok;
+ PS_Driver driver = (PS_Driver)module;
+
+#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_UNUSED( value_is_string );
+#endif
+
+
+ if ( !ft_strcmp( property_name, "darkening-parameters" ) )
+ {
+ FT_Int* darken_params;
+ FT_Int x1, y1, x2, y2, x3, y3, x4, y4;
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ FT_Int dp[8];
+
+
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ char* ep;
+ int i;
+
+
+ /* eight comma-separated numbers */
+ for ( i = 0; i < 7; i++ )
+ {
+ dp[i] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( *ep != ',' || s == ep )
+ return FT_THROW( Invalid_Argument );
+
+ s = ep + 1;
+ }
+
+ dp[7] = (FT_Int)ft_strtol( s, &ep, 10 );
+ if ( !( *ep == '\0' || *ep == ' ' ) || s == ep )
+ return FT_THROW( Invalid_Argument );
+
+ darken_params = dp;
+ }
+ else
+#endif
+ darken_params = (FT_Int*)value;
+
+ x1 = darken_params[0];
+ y1 = darken_params[1];
+ x2 = darken_params[2];
+ y2 = darken_params[3];
+ x3 = darken_params[4];
+ y3 = darken_params[5];
+ x4 = darken_params[6];
+ y4 = darken_params[7];
+
+ if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 ||
+ y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 ||
+ x1 > x2 || x2 > x3 || x3 > x4 ||
+ y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 )
+ return FT_THROW( Invalid_Argument );
+
+ driver->darken_params[0] = x1;
+ driver->darken_params[1] = y1;
+ driver->darken_params[2] = x2;
+ driver->darken_params[3] = y2;
+ driver->darken_params[4] = x3;
+ driver->darken_params[5] = y3;
+ driver->darken_params[6] = x4;
+ driver->darken_params[7] = y4;
+
+ return error;
+ }
+
+ else if ( !ft_strcmp( property_name, "hinting-engine" ) )
+ {
+#if defined( CFF_CONFIG_OPTION_OLD_ENGINE ) || \
+ defined( T1_CONFIG_OPTION_OLD_ENGINE )
+ const char* module_name = module->clazz->module_name;
+#endif
+
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+
+
+ if ( !ft_strcmp( s, "adobe" ) )
+ driver->hinting_engine = FT_HINTING_ADOBE;
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ else if ( !ft_strcmp( module_name, "cff" ) &&
+ !ft_strcmp( s, "freetype" ) )
+ driver->hinting_engine = FT_HINTING_FREETYPE;
+#endif
+
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ else if ( ( !ft_strcmp( module_name, "type1" ) ||
+ !ft_strcmp( module_name, "t1cid" ) ) &&
+ !ft_strcmp( s, "freetype" ) )
+ driver->hinting_engine = FT_HINTING_FREETYPE;
+#endif
+
+ else
+ return FT_THROW( Invalid_Argument );
+ }
+ else
+#endif /* FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES */
+ {
+ FT_UInt* hinting_engine = (FT_UInt*)value;
+
+
+ if ( *hinting_engine == FT_HINTING_ADOBE
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ || ( *hinting_engine == FT_HINTING_FREETYPE &&
+ !ft_strcmp( module_name, "cff" ) )
+#endif
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ || ( *hinting_engine == FT_HINTING_FREETYPE &&
+ ( !ft_strcmp( module_name, "type1" ) ||
+ !ft_strcmp( module_name, "t1cid" ) ) )
+#endif
+ )
+ driver->hinting_engine = *hinting_engine;
+ else
+ error = FT_ERR( Unimplemented_Feature );
+
+ return error;
+ }
+ }
+
+ else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
+ {
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+ long nsd = ft_strtol( s, NULL, 10 );
+
+
+ if ( !nsd )
+ driver->no_stem_darkening = FALSE;
+ else
+ driver->no_stem_darkening = TRUE;
+ }
+ else
+#endif
+ {
+ FT_Bool* no_stem_darkening = (FT_Bool*)value;
+
+
+ driver->no_stem_darkening = *no_stem_darkening;
+ }
+
+ return error;
+ }
+
+ else if ( !ft_strcmp( property_name, "random-seed" ) )
+ {
+ FT_Int32 random_seed;
+
+
+#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
+ if ( value_is_string )
+ {
+ const char* s = (const char*)value;
+
+
+ random_seed = (FT_Int32)ft_strtol( s, NULL, 10 );
+ }
+ else
+#endif
+ random_seed = *(FT_Int32*)value;
+
+ if ( random_seed < 0 )
+ random_seed = 0;
+
+ driver->random_seed = random_seed;
+
+ return error;
+ }
+
+ FT_TRACE0(( "ps_property_set: missing property `%s'\n",
+ property_name ));
+ return FT_THROW( Missing_Property );
+ }
+
+
+ FT_BASE_CALLBACK_DEF( FT_Error )
+ ps_property_get( FT_Module module, /* PS_Driver */
+ const char* property_name,
+ void* value )
+ {
+ FT_Error error = FT_Err_Ok;
+ PS_Driver driver = (PS_Driver)module;
+
+
+ if ( !ft_strcmp( property_name, "darkening-parameters" ) )
+ {
+ FT_Int* darken_params = driver->darken_params;
+ FT_Int* val = (FT_Int*)value;
+
+
+ val[0] = darken_params[0];
+ val[1] = darken_params[1];
+ val[2] = darken_params[2];
+ val[3] = darken_params[3];
+ val[4] = darken_params[4];
+ val[5] = darken_params[5];
+ val[6] = darken_params[6];
+ val[7] = darken_params[7];
+
+ return error;
+ }
+
+ else if ( !ft_strcmp( property_name, "hinting-engine" ) )
+ {
+ FT_UInt hinting_engine = driver->hinting_engine;
+ FT_UInt* val = (FT_UInt*)value;
+
+
+ *val = hinting_engine;
+
+ return error;
+ }
+
+ else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
+ {
+ FT_Bool no_stem_darkening = driver->no_stem_darkening;
+ FT_Bool* val = (FT_Bool*)value;
+
+
+ *val = no_stem_darkening;
+
+ return error;
+ }
+
+ FT_TRACE0(( "ps_property_get: missing property `%s'\n",
+ property_name ));
+ return FT_THROW( Missing_Property );
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/base/ftrfork.c b/thirdparty/freetype/src/base/ftrfork.c
index f5ad2874d8..c3a2b9151a 100644
--- a/thirdparty/freetype/src/base/ftrfork.c
+++ b/thirdparty/freetype/src/base/ftrfork.c
@@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@@ -478,7 +478,7 @@
}
-#ifndef FT_MACINTOSH
+#if defined( FT_CONFIG_OPTION_MAC_FONTS ) && !defined( FT_MACINTOSH )
static FT_RFork_Rule
raccess_get_rule_type_from_rule_index( FT_Library library,
FT_UInt rule_index )
diff --git a/thirdparty/freetype/src/base/ftsnames.c b/thirdparty/freetype/src/base/ftsnames.c
index 3609450088..90ea1e2be7 100644
--- a/thirdparty/freetype/src/base/ftsnames.c
+++ b/thirdparty/freetype/src/base/ftsnames.c
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftstream.c b/thirdparty/freetype/src/base/ftstream.c
index a3f8c8b3c9..18df7dcfef 100644
--- a/thirdparty/freetype/src/base/ftstream.c
+++ b/thirdparty/freetype/src/base/ftstream.c
@@ -4,7 +4,7 @@
/* */
/* I/O stream support (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftstroke.c b/thirdparty/freetype/src/base/ftstroke.c
index d32de0d62b..6ae1819067 100644
--- a/thirdparty/freetype/src/base/ftstroke.c
+++ b/thirdparty/freetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
/* */
/* FreeType path stroker (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftsynth.c b/thirdparty/freetype/src/base/ftsynth.c
index 5cf386f48d..c28346707b 100644
--- a/thirdparty/freetype/src/base/ftsynth.c
+++ b/thirdparty/freetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType synthesizing code for emboldening and slanting (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftsystem.c b/thirdparty/freetype/src/base/ftsystem.c
index 324f949a49..6adebdb938 100644
--- a/thirdparty/freetype/src/base/ftsystem.c
+++ b/thirdparty/freetype/src/base/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific FreeType low-level system interface (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/fttrigon.c b/thirdparty/freetype/src/base/fttrigon.c
index 7a4d17c829..d6dd098c42 100644
--- a/thirdparty/freetype/src/base/fttrigon.c
+++ b/thirdparty/freetype/src/base/fttrigon.c
@@ -4,7 +4,7 @@
/* */
/* FreeType trigonometric functions (body). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/fttype1.c b/thirdparty/freetype/src/base/fttype1.c
index 4d16a6371a..aa8f8ccbbb 100644
--- a/thirdparty/freetype/src/base/fttype1.c
+++ b/thirdparty/freetype/src/base/fttype1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for PS names support (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftutil.c b/thirdparty/freetype/src/base/ftutil.c
index 7bd5bee87c..4de5f2c145 100644
--- a/thirdparty/freetype/src/base/ftutil.c
+++ b/thirdparty/freetype/src/base/ftutil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for memory and list management (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/ftver.rc b/thirdparty/freetype/src/base/ftver.rc
new file mode 100644
index 0000000000..a2903d5883
--- /dev/null
+++ b/thirdparty/freetype/src/base/ftver.rc
@@ -0,0 +1,61 @@
+/***************************************************************************/
+/* */
+/* ftver.rc */
+/* */
+/* FreeType VERSIONINFO resource for Windows DLLs. */
+/* */
+/* Copyright 2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include<windows.h>
+
+#define FT_VERSION 2,9,1,0
+#define FT_VERSION_STR "2.9.1"
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION FT_VERSION
+PRODUCTVERSION FT_VERSION
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+FILEFLAGS VS_FF_DEBUG
+#endif
+#ifdef _DLL
+FILETYPE VFT_DLL
+#define FT_FILENAME "freetype.dll"
+#else
+FILETYPE VFT_STATIC_LIB
+#define FT_FILENAME "freetype.lib"
+#endif
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "The FreeType Project"
+ VALUE "FileDescription", "Font Rendering Library"
+ VALUE "FileVersion", FT_VERSION_STR
+ VALUE "ProductName", "FreeType"
+ VALUE "ProductVersion", FT_VERSION_STR
+ VALUE "LegalCopyright", "\251 2018 The FreeType Project www.freetype.org. All rights reserved."
+ VALUE "InternalName", "freetype"
+ VALUE "OriginalFilename", FT_FILENAME
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ /* The following line should only be modified for localized versions. */
+ /* It consists of any number of WORD,WORD pairs, with each pair */
+ /* describing a "language,codepage" combination supported by the file. */
+ VALUE "Translation", 0x409, 1252
+ END
+END
diff --git a/thirdparty/freetype/src/base/ftwinfnt.c b/thirdparty/freetype/src/base/ftwinfnt.c
index 05baa02da6..11bd28afb7 100644
--- a/thirdparty/freetype/src/base/ftwinfnt.c
+++ b/thirdparty/freetype/src/base/ftwinfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing Windows FNT specific info (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/base/rules.mk b/thirdparty/freetype/src/base/rules.mk
index 2a1e93cb00..e9805bd068 100644
--- a/thirdparty/freetype/src/base/rules.mk
+++ b/thirdparty/freetype/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -40,11 +40,14 @@ BASE_SRC := $(BASE_DIR)/basepic.c \
$(BASE_DIR)/ftadvanc.c \
$(BASE_DIR)/ftcalc.c \
$(BASE_DIR)/ftdbgmem.c \
+ $(BASE_DIR)/ftfntfmt.c \
$(BASE_DIR)/ftgloadr.c \
$(BASE_DIR)/fthash.c \
+ $(BASE_DIR)/ftlcdfil.c \
$(BASE_DIR)/ftobjs.c \
$(BASE_DIR)/ftoutln.c \
$(BASE_DIR)/ftpic.c \
+ $(BASE_DIR)/ftpsprop.c \
$(BASE_DIR)/ftrfork.c \
$(BASE_DIR)/ftsnames.c \
$(BASE_DIR)/ftstream.c \
diff --git a/thirdparty/freetype/src/bdf/README b/thirdparty/freetype/src/bdf/README
index b761aba2b2..996ac2d2aa 100644
--- a/thirdparty/freetype/src/bdf/README
+++ b/thirdparty/freetype/src/bdf/README
@@ -13,7 +13,7 @@ This code implements a BDF driver for the FreeType library, following the
Adobe Specification V 2.2. The specification of the BDF font format is
available from Adobe's web site:
- http://partners.adobe.com/public/developer/en/font/5005.BDF_Spec.pdf
+ https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
They do not define vertical metrics, because the X Consortium BDF
diff --git a/thirdparty/freetype/src/bdf/bdfdrivr.c b/thirdparty/freetype/src/bdf/bdfdrivr.c
index fb77810007..ca937f89ce 100644
--- a/thirdparty/freetype/src/bdf/bdfdrivr.c
+++ b/thirdparty/freetype/src/bdf/bdfdrivr.c
@@ -813,7 +813,7 @@ THE SOFTWARE.
bitmap->rows = glyph.bbx.height;
bitmap->width = glyph.bbx.width;
- if ( glyph.bpr > INT_MAX )
+ if ( glyph.bpr > FT_INT_MAX )
FT_TRACE1(( "BDF_Glyph_Load: too large pitch %d is truncated\n",
glyph.bpr ));
bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */
diff --git a/thirdparty/freetype/src/bdf/bdflib.c b/thirdparty/freetype/src/bdf/bdflib.c
index bf10887fd4..2f5c99d544 100644
--- a/thirdparty/freetype/src/bdf/bdflib.c
+++ b/thirdparty/freetype/src/bdf/bdflib.c
@@ -705,11 +705,11 @@
for ( v = 0; sbitset( ddigits, *s ); s++ )
{
- if ( v < ( ULONG_MAX - 9 ) / 10 )
+ if ( v < ( FT_ULONG_MAX - 9 ) / 10 )
v = v * 10 + a2i[(int)*s];
else
{
- v = ULONG_MAX;
+ v = FT_ULONG_MAX;
break;
}
}
@@ -738,11 +738,11 @@
for ( v = 0; sbitset( ddigits, *s ); s++ )
{
- if ( v < ( LONG_MAX - 9 ) / 10 )
+ if ( v < ( FT_LONG_MAX - 9 ) / 10 )
v = v * 10 + a2i[(int)*s];
else
{
- v = LONG_MAX;
+ v = FT_LONG_MAX;
break;
}
}
@@ -763,11 +763,11 @@
for ( v = 0; sbitset( ddigits, *s ); s++ )
{
- if ( v < ( USHRT_MAX - 9 ) / 10 )
+ if ( v < ( FT_USHORT_MAX - 9 ) / 10 )
v = (unsigned short)( v * 10 + a2i[(int)*s] );
else
{
- v = USHRT_MAX;
+ v = FT_USHORT_MAX;
break;
}
}
diff --git a/thirdparty/freetype/src/bzip2/ftbzip2.c b/thirdparty/freetype/src/bzip2/ftbzip2.c
index 7fc71e7079..16019485a9 100644
--- a/thirdparty/freetype/src/bzip2/ftbzip2.c
+++ b/thirdparty/freetype/src/bzip2/ftbzip2.c
@@ -8,7 +8,7 @@
/* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2010-2017 by */
+/* Copyright 2010-2018 by */
/* Joel Klinghed. */
/* */
/* based on `src/gzip/ftgzip.c' */
diff --git a/thirdparty/freetype/src/bzip2/rules.mk b/thirdparty/freetype/src/bzip2/rules.mk
index f63ddc4d34..95954d7520 100644
--- a/thirdparty/freetype/src/bzip2/rules.mk
+++ b/thirdparty/freetype/src/bzip2/rules.mk
@@ -2,7 +2,7 @@
# FreeType 2 BZIP2 support configuration rules
#
-# Copyright 2010-2017 by
+# Copyright 2010-2018 by
# Joel Klinghed.
#
# based on `src/lzw/rules.mk'
diff --git a/thirdparty/freetype/src/cache/ftcache.c b/thirdparty/freetype/src/cache/ftcache.c
index 8226188314..1b425af911 100644
--- a/thirdparty/freetype/src/cache/ftcache.c
+++ b/thirdparty/freetype/src/cache/ftcache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType Caching sub-system (body only). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcbasic.c b/thirdparty/freetype/src/cache/ftcbasic.c
index e804776ab4..994aa12286 100644
--- a/thirdparty/freetype/src/cache/ftcbasic.c
+++ b/thirdparty/freetype/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType basic cache interface (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftccache.c b/thirdparty/freetype/src/cache/ftccache.c
index 37dc3abb1d..12ec585a25 100644
--- a/thirdparty/freetype/src/cache/ftccache.c
+++ b/thirdparty/freetype/src/cache/ftccache.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType internal cache interface (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftccache.h b/thirdparty/freetype/src/cache/ftccache.h
index d3c11ce082..859c547e46 100644
--- a/thirdparty/freetype/src/cache/ftccache.h
+++ b/thirdparty/freetype/src/cache/ftccache.h
@@ -4,7 +4,7 @@
/* */
/* FreeType internal cache interface (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftccback.h b/thirdparty/freetype/src/cache/ftccback.h
index 2681e8c022..e51d8d6e55 100644
--- a/thirdparty/freetype/src/cache/ftccback.h
+++ b/thirdparty/freetype/src/cache/ftccback.h
@@ -4,7 +4,7 @@
/* */
/* Callback functions of the caching sub-system (specification only). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftccmap.c b/thirdparty/freetype/src/cache/ftccmap.c
index 2fa84979c8..d20b0f48fe 100644
--- a/thirdparty/freetype/src/cache/ftccmap.c
+++ b/thirdparty/freetype/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcerror.h b/thirdparty/freetype/src/cache/ftcerror.h
index 84fe52f546..a26cd5935b 100644
--- a/thirdparty/freetype/src/cache/ftcerror.h
+++ b/thirdparty/freetype/src/cache/ftcerror.h
@@ -4,7 +4,7 @@
/* */
/* Caching sub-system error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcglyph.c b/thirdparty/freetype/src/cache/ftcglyph.c
index d2468f2f43..782cc0ed09 100644
--- a/thirdparty/freetype/src/cache/ftcglyph.c
+++ b/thirdparty/freetype/src/cache/ftcglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Glyph Image (FT_Glyph) cache (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcglyph.h b/thirdparty/freetype/src/cache/ftcglyph.h
index cab58ed311..23c24d223f 100644
--- a/thirdparty/freetype/src/cache/ftcglyph.h
+++ b/thirdparty/freetype/src/cache/ftcglyph.h
@@ -4,7 +4,7 @@
/* */
/* FreeType abstract glyph cache (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcimage.c b/thirdparty/freetype/src/cache/ftcimage.c
index 359f818cce..77a100153e 100644
--- a/thirdparty/freetype/src/cache/ftcimage.c
+++ b/thirdparty/freetype/src/cache/ftcimage.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcimage.h b/thirdparty/freetype/src/cache/ftcimage.h
index 14049af9d2..24a221053b 100644
--- a/thirdparty/freetype/src/cache/ftcimage.h
+++ b/thirdparty/freetype/src/cache/ftcimage.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Generic Image cache (specification) */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmanag.c b/thirdparty/freetype/src/cache/ftcmanag.c
index edec2b6b5b..2bcd9df502 100644
--- a/thirdparty/freetype/src/cache/ftcmanag.c
+++ b/thirdparty/freetype/src/cache/ftcmanag.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmanag.h b/thirdparty/freetype/src/cache/ftcmanag.h
index 556842e131..b4b4755356 100644
--- a/thirdparty/freetype/src/cache/ftcmanag.h
+++ b/thirdparty/freetype/src/cache/ftcmanag.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Cache Manager (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmru.c b/thirdparty/freetype/src/cache/ftcmru.c
index e293269f2f..1087be4d89 100644
--- a/thirdparty/freetype/src/cache/ftcmru.c
+++ b/thirdparty/freetype/src/cache/ftcmru.c
@@ -4,7 +4,7 @@
/* */
/* FreeType MRU support (body). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcmru.h b/thirdparty/freetype/src/cache/ftcmru.h
index c4c330d558..82396b917d 100644
--- a/thirdparty/freetype/src/cache/ftcmru.h
+++ b/thirdparty/freetype/src/cache/ftcmru.h
@@ -4,7 +4,7 @@
/* */
/* Simple MRU list-cache (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcsbits.c b/thirdparty/freetype/src/cache/ftcsbits.c
index 2f9336decd..018f1ecdb7 100644
--- a/thirdparty/freetype/src/cache/ftcsbits.c
+++ b/thirdparty/freetype/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
/* */
/* FreeType sbits manager (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/ftcsbits.h b/thirdparty/freetype/src/cache/ftcsbits.h
index 1e15ce9764..206a1bb3fc 100644
--- a/thirdparty/freetype/src/cache/ftcsbits.h
+++ b/thirdparty/freetype/src/cache/ftcsbits.h
@@ -4,7 +4,7 @@
/* */
/* A small-bitmap cache (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cache/rules.mk b/thirdparty/freetype/src/cache/rules.mk
index 6204689505..558935976d 100644
--- a/thirdparty/freetype/src/cache/rules.mk
+++ b/thirdparty/freetype/src/cache/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2000-2017 by
+# Copyright 2000-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cff/cff.c b/thirdparty/freetype/src/cff/cff.c
index 397f6dfafe..1a755d5dad 100644
--- a/thirdparty/freetype/src/cff/cff.c
+++ b/thirdparty/freetype/src/cff/cff.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,15 +27,4 @@
#include "cffload.c"
#include "cffobjs.c"
-#include "cf2arrst.c"
-#include "cf2blues.c"
-#include "cf2error.c"
-#include "cf2font.c"
-#include "cf2ft.c"
-#include "cf2hints.c"
-#include "cf2intrp.c"
-#include "cf2read.c"
-#include "cf2stack.c"
-
-
/* END */
diff --git a/thirdparty/freetype/src/cff/cffcmap.c b/thirdparty/freetype/src/cff/cffcmap.c
index 4adce7a54d..e45ae1127b 100644
--- a/thirdparty/freetype/src/cff/cffcmap.c
+++ b/thirdparty/freetype/src/cff/cffcmap.c
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffcmap.h b/thirdparty/freetype/src/cff/cffcmap.h
index 7792e04248..856a43dd1b 100644
--- a/thirdparty/freetype/src/cff/cffcmap.h
+++ b/thirdparty/freetype/src/cff/cffcmap.h
@@ -4,7 +4,7 @@
/* */
/* CFF character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -19,7 +19,7 @@
#ifndef CFFCMAP_H_
#define CFFCMAP_H_
-#include "cffobjs.h"
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
FT_BEGIN_HEADER
diff --git a/thirdparty/freetype/src/cff/cffdrivr.c b/thirdparty/freetype/src/cff/cffdrivr.c
index 38bfc2ca3d..df896848da 100644
--- a/thirdparty/freetype/src/cff/cffdrivr.c
+++ b/thirdparty/freetype/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,16 +21,20 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_POSTSCRIPT_PROPS_H
#include FT_SERVICE_CID_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_TT_CMAP_H
+#include FT_SERVICE_CFF_TABLE_LOAD_H
#include "cffdrivr.h"
#include "cffgload.h"
#include "cffload.h"
#include "cffcmap.h"
#include "cffparse.h"
+#include "cffobjs.h"
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_SERVICE_MULTIPLE_MASTERS_H
@@ -43,7 +47,7 @@
#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_PROPERTIES_H
-#include FT_CFF_DRIVER_H
+#include FT_DRIVER_H
/*************************************************************************/
@@ -214,8 +218,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without VVAR table */
- if ( !ttface->is_default_instance &&
- !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -237,8 +241,10 @@
&dummy,
&ah );
- FT_TRACE5(( " idx %d: advance height %d font units\n",
- start + nn, ah ));
+ FT_TRACE5(( " idx %d: advance height %d font unit%s\n",
+ start + nn,
+ ah,
+ ah == 1 ? "" : "s" ));
advances[nn] = ah;
}
}
@@ -246,8 +252,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without HVAR table */
- if ( !ttface->is_default_instance &&
- !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
+ !( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -266,8 +272,10 @@
&dummy,
&aw );
- FT_TRACE5(( " idx %d: advance width %d font units\n",
- start + nn, aw ));
+ FT_TRACE5(( " idx %d: advance width %d font unit%s\n",
+ start + nn,
+ aw,
+ aw == 1 ? "" : "s" ));
advances[nn] = aw;
}
}
@@ -493,11 +501,89 @@
}
+ static FT_Error
+ cff_ps_get_font_extra( CFF_Face face,
+ PS_FontExtraRec* afont_extra )
+ {
+ CFF_Font cff = (CFF_Font)face->extra.data;
+ FT_Error error = FT_Err_Ok;
+
+
+ if ( cff && cff->font_extra == NULL )
+ {
+ CFF_FontRecDict dict = &cff->top_font.font_dict;
+ PS_FontExtraRec* font_extra = NULL;
+ FT_Memory memory = face->root.memory;
+ FT_String* embedded_postscript;
+
+
+ if ( FT_ALLOC( font_extra, sizeof ( *font_extra ) ) )
+ goto Fail;
+
+ font_extra->fs_type = 0U;
+
+ embedded_postscript = cff_index_get_sid_string(
+ cff,
+ dict->embedded_postscript );
+ if ( embedded_postscript )
+ {
+ FT_String* start_fstype;
+ FT_String* start_def;
+
+
+ /* Identify the XYZ integer in `/FSType XYZ def' substring. */
+ if ( ( start_fstype = ft_strstr( embedded_postscript,
+ "/FSType" ) ) != NULL &&
+ ( start_def = ft_strstr( start_fstype +
+ sizeof ( "/FSType" ) - 1,
+ "def" ) ) != NULL )
+ {
+ FT_String* s;
+
+
+ for ( s = start_fstype + sizeof ( "/FSType" ) - 1;
+ s != start_def;
+ s++ )
+ {
+ if ( *s >= '0' && *s <= '9' )
+ {
+ if ( font_extra->fs_type >= ( FT_USHORT_MAX - 9 ) / 10 )
+ {
+ /* Overflow - ignore the FSType value. */
+ font_extra->fs_type = 0U;
+ break;
+ }
+
+ font_extra->fs_type *= 10;
+ font_extra->fs_type += (FT_UShort)( *s - '0' );
+ }
+ else if ( *s != ' ' && *s != '\n' && *s != '\r' )
+ {
+ /* Non-whitespace character between `/FSType' and next `def' */
+ /* - ignore the FSType value. */
+ font_extra->fs_type = 0U;
+ break;
+ }
+ }
+ }
+ }
+
+ cff->font_extra = font_extra;
+ }
+
+ if ( cff )
+ *afont_extra = *cff->font_extra;
+
+ Fail:
+ return error;
+ }
+
+
FT_DEFINE_SERVICE_PSINFOREC(
cff_service_ps_info,
(PS_GetFontInfoFunc) cff_ps_get_font_info, /* ps_get_font_info */
- (PS_GetFontExtraFunc) NULL, /* ps_get_font_extra */
+ (PS_GetFontExtraFunc) cff_ps_get_font_extra, /* ps_get_font_extra */
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, /* ps_has_glyph_names */
/* unsupported with CFF fonts */
(PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */
@@ -735,231 +821,12 @@
* PROPERTY SERVICE
*
*/
- static FT_Error
- cff_property_set( FT_Module module, /* CFF_Driver */
- const char* property_name,
- const void* value,
- FT_Bool value_is_string )
- {
- FT_Error error = FT_Err_Ok;
- CFF_Driver driver = (CFF_Driver)module;
-
-#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
- FT_UNUSED( value_is_string );
-#endif
-
-
- if ( !ft_strcmp( property_name, "darkening-parameters" ) )
- {
- FT_Int* darken_params;
- FT_Int x1, y1, x2, y2, x3, y3, x4, y4;
-
-#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
- FT_Int dp[8];
-
-
- if ( value_is_string )
- {
- const char* s = (const char*)value;
- char* ep;
- int i;
-
-
- /* eight comma-separated numbers */
- for ( i = 0; i < 7; i++ )
- {
- dp[i] = (FT_Int)ft_strtol( s, &ep, 10 );
- if ( *ep != ',' || s == ep )
- return FT_THROW( Invalid_Argument );
-
- s = ep + 1;
- }
-
- dp[7] = (FT_Int)ft_strtol( s, &ep, 10 );
- if ( !( *ep == '\0' || *ep == ' ' ) || s == ep )
- return FT_THROW( Invalid_Argument );
-
- darken_params = dp;
- }
- else
-#endif
- darken_params = (FT_Int*)value;
-
- x1 = darken_params[0];
- y1 = darken_params[1];
- x2 = darken_params[2];
- y2 = darken_params[3];
- x3 = darken_params[4];
- y3 = darken_params[5];
- x4 = darken_params[6];
- y4 = darken_params[7];
-
- if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 ||
- y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 ||
- x1 > x2 || x2 > x3 || x3 > x4 ||
- y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 )
- return FT_THROW( Invalid_Argument );
-
- driver->darken_params[0] = x1;
- driver->darken_params[1] = y1;
- driver->darken_params[2] = x2;
- driver->darken_params[3] = y2;
- driver->darken_params[4] = x3;
- driver->darken_params[5] = y3;
- driver->darken_params[6] = x4;
- driver->darken_params[7] = y4;
-
- return error;
- }
- else if ( !ft_strcmp( property_name, "hinting-engine" ) )
- {
-#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
- if ( value_is_string )
- {
- const char* s = (const char*)value;
-
-
- if ( !ft_strcmp( s, "adobe" ) )
- driver->hinting_engine = FT_CFF_HINTING_ADOBE;
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- else if ( !ft_strcmp( s, "freetype" ) )
- driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
-#endif
- else
- return FT_THROW( Invalid_Argument );
- }
- else
-#endif
- {
- FT_UInt* hinting_engine = (FT_UInt*)value;
-
-
- if ( *hinting_engine == FT_CFF_HINTING_ADOBE
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- || *hinting_engine == FT_CFF_HINTING_FREETYPE
-#endif
- )
- driver->hinting_engine = *hinting_engine;
- else
- error = FT_ERR( Unimplemented_Feature );
-
- return error;
- }
- }
- else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
- {
-#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
- if ( value_is_string )
- {
- const char* s = (const char*)value;
- long nsd = ft_strtol( s, NULL, 10 );
-
-
- if ( !nsd )
- driver->no_stem_darkening = FALSE;
- else
- driver->no_stem_darkening = TRUE;
- }
- else
-#endif
- {
- FT_Bool* no_stem_darkening = (FT_Bool*)value;
-
-
- driver->no_stem_darkening = *no_stem_darkening;
- }
-
- return error;
- }
- else if ( !ft_strcmp( property_name, "random-seed" ) )
- {
- FT_Int32 random_seed;
-
-
-#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
- if ( value_is_string )
- {
- const char* s = (const char*)value;
-
-
- random_seed = (FT_Int32)ft_strtol( s, NULL, 10 );
- }
- else
-#endif
- random_seed = *(FT_Int32*)value;
-
- if ( random_seed < 0 )
- random_seed = 0;
-
- driver->random_seed = random_seed;
-
- return error;
- }
-
- FT_TRACE0(( "cff_property_set: missing property `%s'\n",
- property_name ));
- return FT_THROW( Missing_Property );
- }
-
-
- static FT_Error
- cff_property_get( FT_Module module, /* CFF_Driver */
- const char* property_name,
- const void* value )
- {
- FT_Error error = FT_Err_Ok;
- CFF_Driver driver = (CFF_Driver)module;
-
-
- if ( !ft_strcmp( property_name, "darkening-parameters" ) )
- {
- FT_Int* darken_params = driver->darken_params;
- FT_Int* val = (FT_Int*)value;
-
-
- val[0] = darken_params[0];
- val[1] = darken_params[1];
- val[2] = darken_params[2];
- val[3] = darken_params[3];
- val[4] = darken_params[4];
- val[5] = darken_params[5];
- val[6] = darken_params[6];
- val[7] = darken_params[7];
-
- return error;
- }
- else if ( !ft_strcmp( property_name, "hinting-engine" ) )
- {
- FT_UInt hinting_engine = driver->hinting_engine;
- FT_UInt* val = (FT_UInt*)value;
-
-
- *val = hinting_engine;
-
- return error;
- }
- else if ( !ft_strcmp( property_name, "no-stem-darkening" ) )
- {
- FT_Bool no_stem_darkening = driver->no_stem_darkening;
- FT_Bool* val = (FT_Bool*)value;
-
-
- *val = no_stem_darkening;
-
- return error;
- }
-
- FT_TRACE0(( "cff_property_get: missing property `%s'\n",
- property_name ));
- return FT_THROW( Missing_Property );
- }
-
FT_DEFINE_SERVICE_PROPERTIESREC(
cff_service_properties,
- (FT_Properties_SetFunc)cff_property_set, /* set_property */
- (FT_Properties_GetFunc)cff_property_get ) /* get_property */
+ (FT_Properties_SetFunc)ps_property_set, /* set_property */
+ (FT_Properties_GetFunc)ps_property_get ) /* get_property */
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
@@ -1028,6 +895,17 @@
}
+ static FT_Error
+ cff_set_instance( CFF_Face face,
+ FT_UInt instance_index )
+ {
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+
+
+ return mm->set_instance( FT_FACE( face ), instance_index );
+ }
+
+
FT_DEFINE_SERVICE_MULTIMASTERSREC(
cff_service_multi_masters,
@@ -1038,6 +916,7 @@
(FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
(FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
(FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */
+ (FT_Set_Instance_Func) cff_set_instance, /* set_instance */
(FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
(FT_Done_Blend_Func) cff_done_blend /* done_blend */
@@ -1088,6 +967,22 @@
#endif
+ /*
+ * CFFLOAD SERVICE
+ *
+ */
+
+ FT_DEFINE_SERVICE_CFFLOADREC(
+ cff_service_cff_load,
+
+ (FT_Get_Standard_Encoding_Func)cff_get_standard_encoding,
+ (FT_Load_Private_Dict_Func) cff_load_private_dict,
+ (FT_FD_Select_Get_Func) cff_fd_select_get,
+ (FT_Blend_Check_Vector_Func) cff_blend_check_vector,
+ (FT_Blend_Build_Vector_Func) cff_blend_build_vector
+ )
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -1102,7 +997,7 @@
#if !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES && \
defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_DEFINE_SERVICEDESCREC9(
+ FT_DEFINE_SERVICEDESCREC10(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
@@ -1113,10 +1008,11 @@
FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
+ FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
)
#elif !defined FT_CONFIG_OPTION_NO_GLYPH_NAMES
- FT_DEFINE_SERVICEDESCREC7(
+ FT_DEFINE_SERVICEDESCREC8(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
@@ -1125,10 +1021,11 @@
FT_SERVICE_ID_GLYPH_DICT, &CFF_SERVICE_GLYPH_DICT_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
+ FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
)
#elif defined TT_CONFIG_OPTION_GX_VAR_SUPPORT
- FT_DEFINE_SERVICEDESCREC8(
+ FT_DEFINE_SERVICEDESCREC9(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
@@ -1138,10 +1035,11 @@
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
+ FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
)
#else
- FT_DEFINE_SERVICEDESCREC6(
+ FT_DEFINE_SERVICEDESCREC7(
cff_services,
FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_CFF,
@@ -1149,7 +1047,8 @@
FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &CFF_SERVICE_PS_NAME_GET,
FT_SERVICE_ID_TT_CMAP, &CFF_SERVICE_GET_CMAP_INFO_GET,
FT_SERVICE_ID_CID, &CFF_SERVICE_CID_INFO_GET,
- FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET
+ FT_SERVICE_ID_PROPERTIES, &CFF_SERVICE_PROPERTIES_GET,
+ FT_SERVICE_ID_CFF_LOAD, &CFF_SERVICE_CFF_LOAD_GET
)
#endif
@@ -1208,7 +1107,7 @@
FT_MODULE_DRIVER_HAS_HINTER |
FT_MODULE_DRIVER_HINTS_LIGHTLY,
- sizeof ( CFF_DriverRec ),
+ sizeof ( PS_DriverRec ),
"cff",
0x10000L,
0x20000L,
diff --git a/thirdparty/freetype/src/cff/cffdrivr.h b/thirdparty/freetype/src/cff/cffdrivr.h
index 05381e66db..ad7c3ad70a 100644
--- a/thirdparty/freetype/src/cff/cffdrivr.h
+++ b/thirdparty/freetype/src/cff/cffdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level OpenType driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cfferrs.h b/thirdparty/freetype/src/cff/cfferrs.h
index 40808c1051..b2e1bfaf9d 100644
--- a/thirdparty/freetype/src/cff/cfferrs.h
+++ b/thirdparty/freetype/src/cff/cfferrs.h
@@ -4,7 +4,7 @@
/* */
/* CFF error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffgload.c b/thirdparty/freetype/src/cff/cffgload.c
index 20f3a2c28e..c58471ce86 100644
--- a/thirdparty/freetype/src/cff/cffgload.c
+++ b/thirdparty/freetype/src/cff/cffgload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,13 +21,12 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_OUTLINE_H
-#include FT_CFF_DRIVER_H
+#include FT_DRIVER_H
-#include "cffobjs.h"
#include "cffload.h"
#include "cffgload.h"
-#include "cf2ft.h" /* for cf2_decoder_parse_charstrings */
#include "cfferrs.h"
@@ -42,623 +41,6 @@
#define FT_COMPONENT trace_cffgload
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
-
- typedef enum CFF_Operator_
- {
- cff_op_unknown = 0,
-
- cff_op_rmoveto,
- cff_op_hmoveto,
- cff_op_vmoveto,
-
- cff_op_rlineto,
- cff_op_hlineto,
- cff_op_vlineto,
-
- cff_op_rrcurveto,
- cff_op_hhcurveto,
- cff_op_hvcurveto,
- cff_op_rcurveline,
- cff_op_rlinecurve,
- cff_op_vhcurveto,
- cff_op_vvcurveto,
-
- cff_op_flex,
- cff_op_hflex,
- cff_op_hflex1,
- cff_op_flex1,
-
- cff_op_endchar,
-
- cff_op_hstem,
- cff_op_vstem,
- cff_op_hstemhm,
- cff_op_vstemhm,
-
- cff_op_hintmask,
- cff_op_cntrmask,
- cff_op_dotsection, /* deprecated, acts as no-op */
-
- cff_op_abs,
- cff_op_add,
- cff_op_sub,
- cff_op_div,
- cff_op_neg,
- cff_op_random,
- cff_op_mul,
- cff_op_sqrt,
-
- cff_op_blend,
-
- cff_op_drop,
- cff_op_exch,
- cff_op_index,
- cff_op_roll,
- cff_op_dup,
-
- cff_op_put,
- cff_op_get,
- cff_op_store,
- cff_op_load,
-
- cff_op_and,
- cff_op_or,
- cff_op_not,
- cff_op_eq,
- cff_op_ifelse,
-
- cff_op_callsubr,
- cff_op_callgsubr,
- cff_op_return,
-
- /* Type 1 opcodes: invalid but seen in real life */
- cff_op_hsbw,
- cff_op_closepath,
- cff_op_callothersubr,
- cff_op_pop,
- cff_op_seac,
- cff_op_sbw,
- cff_op_setcurrentpoint,
-
- /* do not remove */
- cff_op_max
-
- } CFF_Operator;
-
-
-#define CFF_COUNT_CHECK_WIDTH 0x80
-#define CFF_COUNT_EXACT 0x40
-#define CFF_COUNT_CLEAR_STACK 0x20
-
- /* count values which have the `CFF_COUNT_CHECK_WIDTH' flag set are */
- /* used for checking the width and requested numbers of arguments */
- /* only; they are set to zero afterwards */
-
- /* the other two flags are informative only and unused currently */
-
- static const FT_Byte cff_argument_counts[] =
- {
- 0, /* unknown */
-
- 2 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, /* rmoveto */
- 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,
- 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,
-
- 0 | CFF_COUNT_CLEAR_STACK, /* rlineto */
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
-
- 0 | CFF_COUNT_CLEAR_STACK, /* rrcurveto */
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
- 0 | CFF_COUNT_CLEAR_STACK,
-
- 13, /* flex */
- 7,
- 9,
- 11,
-
- 0 | CFF_COUNT_CHECK_WIDTH, /* endchar */
-
- 2 | CFF_COUNT_CHECK_WIDTH, /* hstem */
- 2 | CFF_COUNT_CHECK_WIDTH,
- 2 | CFF_COUNT_CHECK_WIDTH,
- 2 | CFF_COUNT_CHECK_WIDTH,
-
- 0 | CFF_COUNT_CHECK_WIDTH, /* hintmask */
- 0 | CFF_COUNT_CHECK_WIDTH, /* cntrmask */
- 0, /* dotsection */
-
- 1, /* abs */
- 2,
- 2,
- 2,
- 1,
- 0,
- 2,
- 1,
-
- 1, /* blend */
-
- 1, /* drop */
- 2,
- 1,
- 2,
- 1,
-
- 2, /* put */
- 1,
- 4,
- 3,
-
- 2, /* and */
- 2,
- 1,
- 2,
- 4,
-
- 1, /* callsubr */
- 1,
- 0,
-
- 2, /* hsbw */
- 0,
- 0,
- 0,
- 5, /* seac */
- 4, /* sbw */
- 2 /* setcurrentpoint */
- };
-
-#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /********** *********/
- /********** *********/
- /********** GENERIC CHARSTRING PARSING *********/
- /********** *********/
- /********** *********/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_builder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph builder. */
- /* */
- /* <InOut> */
- /* builder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* glyph :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting is active. */
- /* */
- static void
- cff_builder_init( CFF_Builder* builder,
- TT_Face face,
- CFF_Size size,
- CFF_GlyphSlot glyph,
- FT_Bool hinting )
- {
- builder->path_begun = 0;
- builder->load_points = 1;
-
- builder->face = face;
- builder->glyph = glyph;
- builder->memory = face->root.memory;
-
- if ( glyph )
- {
- FT_GlyphLoader loader = glyph->root.internal->loader;
-
-
- builder->loader = loader;
- builder->base = &loader->base.outline;
- builder->current = &loader->current.outline;
- FT_GlyphLoader_Rewind( loader );
-
- builder->hints_globals = NULL;
- builder->hints_funcs = NULL;
-
- if ( hinting && size )
- {
- FT_Size ftsize = FT_SIZE( size );
- CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
-
-
- if ( internal )
- {
- builder->hints_globals = (void *)internal->topfont;
- builder->hints_funcs = glyph->root.internal->glyph_hints;
- }
- }
- }
-
- builder->pos_x = 0;
- builder->pos_y = 0;
-
- builder->left_bearing.x = 0;
- builder->left_bearing.y = 0;
- builder->advance.x = 0;
- builder->advance.y = 0;
- }
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_builder_done */
- /* */
- /* <Description> */
- /* Finalizes a given glyph builder. Its contents can still be used */
- /* after the call, but the function saves important information */
- /* within the corresponding glyph slot. */
- /* */
- /* <Input> */
- /* builder :: A pointer to the glyph builder to finalize. */
- /* */
- static void
- cff_builder_done( CFF_Builder* builder )
- {
- CFF_GlyphSlot glyph = builder->glyph;
-
-
- if ( glyph )
- glyph->root.outline = *builder->base;
- }
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_compute_bias */
- /* */
- /* <Description> */
- /* Computes the bias value in dependence of the number of glyph */
- /* subroutines. */
- /* */
- /* <Input> */
- /* in_charstring_type :: The `CharstringType' value of the top DICT */
- /* dictionary. */
- /* */
- /* num_subrs :: The number of glyph subroutines. */
- /* */
- /* <Return> */
- /* The bias value. */
- static FT_Int
- cff_compute_bias( FT_Int in_charstring_type,
- FT_UInt num_subrs )
- {
- FT_Int result;
-
-
- if ( in_charstring_type == 1 )
- result = 0;
- else if ( num_subrs < 1240 )
- result = 107;
- else if ( num_subrs < 33900U )
- result = 1131;
- else
- result = 32768U;
-
- return result;
- }
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_decoder_init */
- /* */
- /* <Description> */
- /* Initializes a given glyph decoder. */
- /* */
- /* <InOut> */
- /* decoder :: A pointer to the glyph builder to initialize. */
- /* */
- /* <Input> */
- /* face :: The current face object. */
- /* */
- /* size :: The current size object. */
- /* */
- /* slot :: The current glyph object. */
- /* */
- /* hinting :: Whether hinting is active. */
- /* */
- /* hint_mode :: The hinting mode. */
- /* */
- FT_LOCAL_DEF( void )
- cff_decoder_init( CFF_Decoder* decoder,
- TT_Face face,
- CFF_Size size,
- CFF_GlyphSlot slot,
- FT_Bool hinting,
- FT_Render_Mode hint_mode )
- {
- CFF_Font cff = (CFF_Font)face->extra.data;
-
-
- /* clear everything */
- FT_ZERO( decoder );
-
- /* initialize builder */
- cff_builder_init( &decoder->builder, face, size, slot, hinting );
-
- /* initialize Type2 decoder */
- decoder->cff = cff;
- decoder->num_globals = cff->global_subrs_index.count;
- decoder->globals = cff->global_subrs;
- decoder->globals_bias = cff_compute_bias(
- cff->top_font.font_dict.charstring_type,
- decoder->num_globals );
-
- decoder->hint_mode = hint_mode;
- }
-
-
- /* this function is used to select the subfont */
- /* and the locals subrs array */
- FT_LOCAL_DEF( FT_Error )
- cff_decoder_prepare( CFF_Decoder* decoder,
- CFF_Size size,
- FT_UInt glyph_index )
- {
- CFF_Builder *builder = &decoder->builder;
- CFF_Font cff = (CFF_Font)builder->face->extra.data;
- CFF_SubFont sub = &cff->top_font;
- FT_Error error = FT_Err_Ok;
-
-
- /* manage CID fonts */
- if ( cff->num_subfonts )
- {
- FT_Byte fd_index = cff_fd_select_get( &cff->fd_select, glyph_index );
-
-
- if ( fd_index >= cff->num_subfonts )
- {
- FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
- error = FT_THROW( Invalid_File_Format );
- goto Exit;
- }
-
- FT_TRACE3(( " in subfont %d:\n", fd_index ));
-
- sub = cff->subfonts[fd_index];
-
- if ( builder->hints_funcs && size )
- {
- FT_Size ftsize = FT_SIZE( size );
- CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
-
-
- /* for CFFs without subfonts, this value has already been set */
- builder->hints_globals = (void *)internal->subfonts[fd_index];
- }
- }
-
- decoder->num_locals = sub->local_subrs_index.count;
- decoder->locals = sub->local_subrs;
- decoder->locals_bias = cff_compute_bias(
- decoder->cff->top_font.font_dict.charstring_type,
- decoder->num_locals );
-
- decoder->glyph_width = sub->private_dict.default_width;
- decoder->nominal_width = sub->private_dict.nominal_width;
-
- decoder->current_subfont = sub;
-
- Exit:
- return error;
- }
-
-
- /* check that there is enough space for `count' more points */
- FT_LOCAL_DEF( FT_Error )
- cff_check_points( CFF_Builder* builder,
- FT_Int count )
- {
- return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );
- }
-
-
- /* add a new point, do not check space */
- FT_LOCAL_DEF( void )
- cff_builder_add_point( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y,
- FT_Byte flag )
- {
- FT_Outline* outline = builder->current;
-
-
- if ( builder->load_points )
- {
- FT_Vector* point = outline->points + outline->n_points;
- FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points;
-
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- CFF_Driver driver = (CFF_Driver)FT_FACE_DRIVER( builder->face );
-
-
- if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )
- {
- point->x = x >> 16;
- point->y = y >> 16;
- }
- else
-#endif
- {
- /* cf2_decoder_parse_charstrings uses 16.16 coordinates */
- point->x = x >> 10;
- point->y = y >> 10;
- }
- *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );
- }
-
- outline->n_points++;
- }
-
-
- /* check space for a new on-curve point, then add it */
- FT_LOCAL_DEF( FT_Error )
- cff_builder_add_point1( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y )
- {
- FT_Error error;
-
-
- error = cff_check_points( builder, 1 );
- if ( !error )
- cff_builder_add_point( builder, x, y, 1 );
-
- return error;
- }
-
-
- /* check space for a new contour, then add it */
- static FT_Error
- cff_builder_add_contour( CFF_Builder* builder )
- {
- FT_Outline* outline = builder->current;
- FT_Error error;
-
-
- if ( !builder->load_points )
- {
- outline->n_contours++;
- return FT_Err_Ok;
- }
-
- error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
- if ( !error )
- {
- if ( outline->n_contours > 0 )
- outline->contours[outline->n_contours - 1] =
- (short)( outline->n_points - 1 );
-
- outline->n_contours++;
- }
-
- return error;
- }
-
-
- /* if a path was begun, add its first on-curve point */
- FT_LOCAL_DEF( FT_Error )
- cff_builder_start_point( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y )
- {
- FT_Error error = FT_Err_Ok;
-
-
- /* test whether we are building a new contour */
- if ( !builder->path_begun )
- {
- builder->path_begun = 1;
- error = cff_builder_add_contour( builder );
- if ( !error )
- error = cff_builder_add_point1( builder, x, y );
- }
-
- return error;
- }
-
-
- /* close the current contour */
- FT_LOCAL_DEF( void )
- cff_builder_close_contour( CFF_Builder* builder )
- {
- FT_Outline* outline = builder->current;
- FT_Int first;
-
-
- if ( !outline )
- return;
-
- first = outline->n_contours <= 1
- ? 0 : outline->contours[outline->n_contours - 2] + 1;
-
- /* We must not include the last point in the path if it */
- /* is located on the first point. */
- if ( outline->n_points > 1 )
- {
- FT_Vector* p1 = outline->points + first;
- FT_Vector* p2 = outline->points + outline->n_points - 1;
- FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1;
-
-
- /* `delete' last point only if it coincides with the first */
- /* point and if it is not a control point (which can happen). */
- if ( p1->x == p2->x && p1->y == p2->y )
- if ( *control == FT_CURVE_TAG_ON )
- outline->n_points--;
- }
-
- if ( outline->n_contours > 0 )
- {
- /* Don't add contours only consisting of one point, i.e., */
- /* check whether begin point and last point are the same. */
- if ( first == outline->n_points - 1 )
- {
- outline->n_contours--;
- outline->n_points--;
- }
- else
- outline->contours[outline->n_contours - 1] =
- (short)( outline->n_points - 1 );
- }
- }
-
-
- FT_LOCAL_DEF( FT_Int )
- cff_lookup_glyph_by_stdcharcode( CFF_Font cff,
- FT_Int charcode )
- {
- FT_UInt n;
- FT_UShort glyph_sid;
-
-
- /* CID-keyed fonts don't have glyph names */
- if ( !cff->charset.sids )
- return -1;
-
- /* check range of standard char code */
- if ( charcode < 0 || charcode > 255 )
- return -1;
-
- /* Get code to SID mapping from `cff_standard_encoding'. */
- glyph_sid = cff_get_standard_encoding( (FT_UInt)charcode );
-
- for ( n = 0; n < cff->num_glyphs; n++ )
- {
- if ( cff->charset.sids[n] == glyph_sid )
- return (FT_Int)n;
- }
-
- return -1;
- }
-
-
FT_LOCAL_DEF( FT_Error )
cff_get_glyph_data( TT_Face face,
FT_UInt glyph_index,
@@ -730,1950 +112,6 @@
}
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
-
- static FT_Error
- cff_operator_seac( CFF_Decoder* decoder,
- FT_Pos asb,
- FT_Pos adx,
- FT_Pos ady,
- FT_Int bchar,
- FT_Int achar )
- {
- FT_Error error;
- CFF_Builder* builder = &decoder->builder;
- FT_Int bchar_index, achar_index;
- TT_Face face = decoder->builder.face;
- FT_Vector left_bearing, advance;
- FT_Byte* charstring;
- FT_ULong charstring_len;
- FT_Pos glyph_width;
-
-
- if ( decoder->seac )
- {
- FT_ERROR(( "cff_operator_seac: invalid nested seac\n" ));
- return FT_THROW( Syntax_Error );
- }
-
- adx += decoder->builder.left_bearing.x;
- ady += decoder->builder.left_bearing.y;
-
-#ifdef FT_CONFIG_OPTION_INCREMENTAL
- /* Incremental fonts don't necessarily have valid charsets. */
- /* They use the character code, not the glyph index, in this case. */
- if ( face->root.internal->incremental_interface )
- {
- bchar_index = bchar;
- achar_index = achar;
- }
- else
-#endif /* FT_CONFIG_OPTION_INCREMENTAL */
- {
- CFF_Font cff = (CFF_Font)(face->extra.data);
-
-
- bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );
- achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar );
- }
-
- if ( bchar_index < 0 || achar_index < 0 )
- {
- FT_ERROR(( "cff_operator_seac:"
- " invalid seac character code arguments\n" ));
- return FT_THROW( Syntax_Error );
- }
-
- /* If we are trying to load a composite glyph, do not load the */
- /* accent character and return the array of subglyphs. */
- if ( builder->no_recurse )
- {
- FT_GlyphSlot glyph = (FT_GlyphSlot)builder->glyph;
- FT_GlyphLoader loader = glyph->internal->loader;
- FT_SubGlyph subg;
-
-
- /* reallocate subglyph array if necessary */
- error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 );
- if ( error )
- goto Exit;
-
- subg = loader->current.subglyphs;
-
- /* subglyph 0 = base character */
- subg->index = bchar_index;
- subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES |
- FT_SUBGLYPH_FLAG_USE_MY_METRICS;
- subg->arg1 = 0;
- subg->arg2 = 0;
- subg++;
-
- /* subglyph 1 = accent character */
- subg->index = achar_index;
- subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;
- subg->arg1 = (FT_Int)( adx >> 16 );
- subg->arg2 = (FT_Int)( ady >> 16 );
-
- /* set up remaining glyph fields */
- glyph->num_subglyphs = 2;
- glyph->subglyphs = loader->base.subglyphs;
- glyph->format = FT_GLYPH_FORMAT_COMPOSITE;
-
- loader->current.num_subglyphs = 2;
- }
-
- FT_GlyphLoader_Prepare( builder->loader );
-
- /* First load `bchar' in builder */
- error = cff_get_glyph_data( face, (FT_UInt)bchar_index,
- &charstring, &charstring_len );
- if ( !error )
- {
- /* the seac operator must not be nested */
- decoder->seac = TRUE;
- error = cff_decoder_parse_charstrings( decoder, charstring,
- charstring_len, 0 );
- decoder->seac = FALSE;
-
- cff_free_glyph_data( face, &charstring, charstring_len );
-
- if ( error )
- goto Exit;
- }
-
- /* Save the left bearing, advance and glyph width of the base */
- /* character as they will be erased by the next load. */
-
- left_bearing = builder->left_bearing;
- advance = builder->advance;
- glyph_width = decoder->glyph_width;
-
- builder->left_bearing.x = 0;
- builder->left_bearing.y = 0;
-
- builder->pos_x = adx - asb;
- builder->pos_y = ady;
-
- /* Now load `achar' on top of the base outline. */
- error = cff_get_glyph_data( face, (FT_UInt)achar_index,
- &charstring, &charstring_len );
- if ( !error )
- {
- /* the seac operator must not be nested */
- decoder->seac = TRUE;
- error = cff_decoder_parse_charstrings( decoder, charstring,
- charstring_len, 0 );
- decoder->seac = FALSE;
-
- cff_free_glyph_data( face, &charstring, charstring_len );
-
- if ( error )
- goto Exit;
- }
-
- /* Restore the left side bearing, advance and glyph width */
- /* of the base character. */
- builder->left_bearing = left_bearing;
- builder->advance = advance;
- decoder->glyph_width = glyph_width;
-
- builder->pos_x = 0;
- builder->pos_y = 0;
-
- Exit:
- return error;
- }
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* cff_decoder_parse_charstrings */
- /* */
- /* <Description> */
- /* Parses a given Type 2 charstrings program. */
- /* */
- /* <InOut> */
- /* decoder :: The current Type 1 decoder. */
- /* */
- /* <Input> */
- /* charstring_base :: The base of the charstring stream. */
- /* */
- /* charstring_len :: The length in bytes of the charstring stream. */
- /* */
- /* in_dict :: Set to 1 if function is called from top or */
- /* private DICT (needed for Multiple Master CFFs). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- FT_LOCAL_DEF( FT_Error )
- cff_decoder_parse_charstrings( CFF_Decoder* decoder,
- FT_Byte* charstring_base,
- FT_ULong charstring_len,
- FT_Bool in_dict )
- {
- FT_Error error;
- CFF_Decoder_Zone* zone;
- FT_Byte* ip;
- FT_Byte* limit;
- CFF_Builder* builder = &decoder->builder;
- FT_Pos x, y;
- FT_Fixed* stack;
- FT_Int charstring_type =
- decoder->cff->top_font.font_dict.charstring_type;
- FT_UShort num_designs =
- decoder->cff->top_font.font_dict.num_designs;
- FT_UShort num_axes =
- decoder->cff->top_font.font_dict.num_axes;
-
- T2_Hints_Funcs hinter;
-
-
- /* set default width */
- decoder->num_hints = 0;
- decoder->read_width = 1;
-
- /* initialize the decoder */
- decoder->top = decoder->stack;
- decoder->zone = decoder->zones;
- zone = decoder->zones;
- stack = decoder->top;
-
- hinter = (T2_Hints_Funcs)builder->hints_funcs;
-
- builder->path_begun = 0;
-
- zone->base = charstring_base;
- limit = zone->limit = charstring_base + charstring_len;
- ip = zone->cursor = zone->base;
-
- error = FT_Err_Ok;
-
- x = builder->pos_x;
- y = builder->pos_y;
-
- /* begin hints recording session, if any */
- if ( hinter )
- hinter->open( hinter->hints );
-
- /* now execute loop */
- while ( ip < limit )
- {
- CFF_Operator op;
- FT_Byte v;
-
-
- /********************************************************************/
- /* */
- /* Decode operator or operand */
- /* */
- v = *ip++;
- if ( v >= 32 || v == 28 )
- {
- FT_Int shift = 16;
- FT_Int32 val;
-
-
- /* this is an operand, push it on the stack */
-
- /* if we use shifts, all computations are done with unsigned */
- /* values; the conversion to a signed value is the last step */
- if ( v == 28 )
- {
- if ( ip + 1 >= limit )
- goto Syntax_Error;
- val = (FT_Short)( ( (FT_UShort)ip[0] << 8 ) | ip[1] );
- ip += 2;
- }
- else if ( v < 247 )
- val = (FT_Int32)v - 139;
- else if ( v < 251 )
- {
- if ( ip >= limit )
- goto Syntax_Error;
- val = ( (FT_Int32)v - 247 ) * 256 + *ip++ + 108;
- }
- else if ( v < 255 )
- {
- if ( ip >= limit )
- goto Syntax_Error;
- val = -( (FT_Int32)v - 251 ) * 256 - *ip++ - 108;
- }
- else
- {
- if ( ip + 3 >= limit )
- goto Syntax_Error;
- val = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
- ( (FT_UInt32)ip[1] << 16 ) |
- ( (FT_UInt32)ip[2] << 8 ) |
- (FT_UInt32)ip[3] );
- ip += 4;
- if ( charstring_type == 2 )
- shift = 0;
- }
- if ( decoder->top - stack >= CFF_MAX_OPERANDS )
- goto Stack_Overflow;
-
- val = (FT_Int32)( (FT_UInt32)val << shift );
- *decoder->top++ = val;
-
-#ifdef FT_DEBUG_LEVEL_TRACE
- if ( !( val & 0xFFFFL ) )
- FT_TRACE4(( " %hd", (FT_Short)( (FT_UInt32)val >> 16 ) ));
- else
- FT_TRACE4(( " %.5f", val / 65536.0 ));
-#endif
-
- }
- else
- {
- /* The specification says that normally arguments are to be taken */
- /* from the bottom of the stack. However, this seems not to be */
- /* correct, at least for Acroread 7.0.8 on GNU/Linux: It pops the */
- /* arguments similar to a PS interpreter. */
-
- FT_Fixed* args = decoder->top;
- FT_Int num_args = (FT_Int)( args - decoder->stack );
- FT_Int req_args;
-
-
- /* find operator */
- op = cff_op_unknown;
-
- switch ( v )
- {
- case 1:
- op = cff_op_hstem;
- break;
- case 3:
- op = cff_op_vstem;
- break;
- case 4:
- op = cff_op_vmoveto;
- break;
- case 5:
- op = cff_op_rlineto;
- break;
- case 6:
- op = cff_op_hlineto;
- break;
- case 7:
- op = cff_op_vlineto;
- break;
- case 8:
- op = cff_op_rrcurveto;
- break;
- case 9:
- op = cff_op_closepath;
- break;
- case 10:
- op = cff_op_callsubr;
- break;
- case 11:
- op = cff_op_return;
- break;
- case 12:
- {
- if ( ip >= limit )
- goto Syntax_Error;
- v = *ip++;
-
- switch ( v )
- {
- case 0:
- op = cff_op_dotsection;
- break;
- case 1: /* this is actually the Type1 vstem3 operator */
- op = cff_op_vstem;
- break;
- case 2: /* this is actually the Type1 hstem3 operator */
- op = cff_op_hstem;
- break;
- case 3:
- op = cff_op_and;
- break;
- case 4:
- op = cff_op_or;
- break;
- case 5:
- op = cff_op_not;
- break;
- case 6:
- op = cff_op_seac;
- break;
- case 7:
- op = cff_op_sbw;
- break;
- case 8:
- op = cff_op_store;
- break;
- case 9:
- op = cff_op_abs;
- break;
- case 10:
- op = cff_op_add;
- break;
- case 11:
- op = cff_op_sub;
- break;
- case 12:
- op = cff_op_div;
- break;
- case 13:
- op = cff_op_load;
- break;
- case 14:
- op = cff_op_neg;
- break;
- case 15:
- op = cff_op_eq;
- break;
- case 16:
- op = cff_op_callothersubr;
- break;
- case 17:
- op = cff_op_pop;
- break;
- case 18:
- op = cff_op_drop;
- break;
- case 20:
- op = cff_op_put;
- break;
- case 21:
- op = cff_op_get;
- break;
- case 22:
- op = cff_op_ifelse;
- break;
- case 23:
- op = cff_op_random;
- break;
- case 24:
- op = cff_op_mul;
- break;
- case 26:
- op = cff_op_sqrt;
- break;
- case 27:
- op = cff_op_dup;
- break;
- case 28:
- op = cff_op_exch;
- break;
- case 29:
- op = cff_op_index;
- break;
- case 30:
- op = cff_op_roll;
- break;
- case 33:
- op = cff_op_setcurrentpoint;
- break;
- case 34:
- op = cff_op_hflex;
- break;
- case 35:
- op = cff_op_flex;
- break;
- case 36:
- op = cff_op_hflex1;
- break;
- case 37:
- op = cff_op_flex1;
- break;
- default:
- FT_TRACE4(( " unknown op (12, %d)\n", v ));
- break;
- }
- }
- break;
- case 13:
- op = cff_op_hsbw;
- break;
- case 14:
- op = cff_op_endchar;
- break;
- case 16:
- op = cff_op_blend;
- break;
- case 18:
- op = cff_op_hstemhm;
- break;
- case 19:
- op = cff_op_hintmask;
- break;
- case 20:
- op = cff_op_cntrmask;
- break;
- case 21:
- op = cff_op_rmoveto;
- break;
- case 22:
- op = cff_op_hmoveto;
- break;
- case 23:
- op = cff_op_vstemhm;
- break;
- case 24:
- op = cff_op_rcurveline;
- break;
- case 25:
- op = cff_op_rlinecurve;
- break;
- case 26:
- op = cff_op_vvcurveto;
- break;
- case 27:
- op = cff_op_hhcurveto;
- break;
- case 29:
- op = cff_op_callgsubr;
- break;
- case 30:
- op = cff_op_vhcurveto;
- break;
- case 31:
- op = cff_op_hvcurveto;
- break;
- default:
- FT_TRACE4(( " unknown op (%d)\n", v ));
- break;
- }
-
- if ( op == cff_op_unknown )
- continue;
-
- /* in Multiple Master CFFs, T2 charstrings can appear in */
- /* dictionaries, but some operators are prohibited */
- if ( in_dict )
- {
- switch ( op )
- {
- case cff_op_hstem:
- case cff_op_vstem:
- case cff_op_vmoveto:
- case cff_op_rlineto:
- case cff_op_hlineto:
- case cff_op_vlineto:
- case cff_op_rrcurveto:
- case cff_op_hstemhm:
- case cff_op_hintmask:
- case cff_op_cntrmask:
- case cff_op_rmoveto:
- case cff_op_hmoveto:
- case cff_op_vstemhm:
- case cff_op_rcurveline:
- case cff_op_rlinecurve:
- case cff_op_vvcurveto:
- case cff_op_hhcurveto:
- case cff_op_vhcurveto:
- case cff_op_hvcurveto:
- case cff_op_hflex:
- case cff_op_flex:
- case cff_op_hflex1:
- case cff_op_flex1:
- case cff_op_callsubr:
- case cff_op_callgsubr:
- goto MM_Error;
-
- default:
- break;
- }
- }
-
- /* check arguments */
- req_args = cff_argument_counts[op];
- if ( req_args & CFF_COUNT_CHECK_WIDTH )
- {
- if ( num_args > 0 && decoder->read_width )
- {
- /* If `nominal_width' is non-zero, the number is really a */
- /* difference against `nominal_width'. Else, the number here */
- /* is truly a width, not a difference against `nominal_width'. */
- /* If the font does not set `nominal_width', then */
- /* `nominal_width' defaults to zero, and so we can set */
- /* `glyph_width' to `nominal_width' plus number on the stack */
- /* -- for either case. */
-
- FT_Int set_width_ok;
-
-
- switch ( op )
- {
- case cff_op_hmoveto:
- case cff_op_vmoveto:
- set_width_ok = num_args & 2;
- break;
-
- case cff_op_hstem:
- case cff_op_vstem:
- case cff_op_hstemhm:
- case cff_op_vstemhm:
- case cff_op_rmoveto:
- case cff_op_hintmask:
- case cff_op_cntrmask:
- set_width_ok = num_args & 1;
- break;
-
- case cff_op_endchar:
- /* If there is a width specified for endchar, we either have */
- /* 1 argument or 5 arguments. We like to argue. */
- set_width_ok = in_dict
- ? 0
- : ( ( num_args == 5 ) || ( num_args == 1 ) );
- break;
-
- default:
- set_width_ok = 0;
- break;
- }
-
- if ( set_width_ok )
- {
- decoder->glyph_width = decoder->nominal_width +
- ( stack[0] >> 16 );
-
- if ( decoder->width_only )
- {
- /* we only want the advance width; stop here */
- break;
- }
-
- /* Consumed an argument. */
- num_args--;
- }
- }
-
- decoder->read_width = 0;
- req_args = 0;
- }
-
- req_args &= 0x000F;
- if ( num_args < req_args )
- goto Stack_Underflow;
- args -= req_args;
- num_args -= req_args;
-
- /* At this point, `args' points to the first argument of the */
- /* operand in case `req_args' isn't zero. Otherwise, we have */
- /* to adjust `args' manually. */
-
- /* Note that we only pop arguments from the stack which we */
- /* really need and can digest so that we can continue in case */
- /* of superfluous stack elements. */
-
- switch ( op )
- {
- case cff_op_hstem:
- case cff_op_vstem:
- case cff_op_hstemhm:
- case cff_op_vstemhm:
- /* the number of arguments is always even here */
- FT_TRACE4((
- op == cff_op_hstem ? " hstem\n" :
- ( op == cff_op_vstem ? " vstem\n" :
- ( op == cff_op_hstemhm ? " hstemhm\n" : " vstemhm\n" ) ) ));
-
- if ( hinter )
- hinter->stems( hinter->hints,
- ( op == cff_op_hstem || op == cff_op_hstemhm ),
- num_args / 2,
- args - ( num_args & ~1 ) );
-
- decoder->num_hints += num_args / 2;
- args = stack;
- break;
-
- case cff_op_hintmask:
- case cff_op_cntrmask:
- FT_TRACE4(( op == cff_op_hintmask ? " hintmask" : " cntrmask" ));
-
- /* implement vstem when needed -- */
- /* the specification doesn't say it, but this also works */
- /* with the 'cntrmask' operator */
- /* */
- if ( num_args > 0 )
- {
- if ( hinter )
- hinter->stems( hinter->hints,
- 0,
- num_args / 2,
- args - ( num_args & ~1 ) );
-
- decoder->num_hints += num_args / 2;
- }
-
- /* In a valid charstring there must be at least one byte */
- /* after `hintmask' or `cntrmask' (e.g., for a `return' */
- /* instruction). Additionally, there must be space for */
- /* `num_hints' bits. */
-
- if ( ( ip + ( ( decoder->num_hints + 7 ) >> 3 ) ) >= limit )
- goto Syntax_Error;
-
- if ( hinter )
- {
- if ( op == cff_op_hintmask )
- hinter->hintmask( hinter->hints,
- (FT_UInt)builder->current->n_points,
- (FT_UInt)decoder->num_hints,
- ip );
- else
- hinter->counter( hinter->hints,
- (FT_UInt)decoder->num_hints,
- ip );
- }
-
-#ifdef FT_DEBUG_LEVEL_TRACE
- {
- FT_UInt maskbyte;
-
-
- FT_TRACE4(( " (maskbytes:" ));
-
- for ( maskbyte = 0;
- maskbyte < (FT_UInt)( ( decoder->num_hints + 7 ) >> 3 );
- maskbyte++, ip++ )
- FT_TRACE4(( " 0x%02X", *ip ));
-
- FT_TRACE4(( ")\n" ));
- }
-#else
- ip += ( decoder->num_hints + 7 ) >> 3;
-#endif
- args = stack;
- break;
-
- case cff_op_rmoveto:
- FT_TRACE4(( " rmoveto\n" ));
-
- cff_builder_close_contour( builder );
- builder->path_begun = 0;
- x = ADD_LONG( x, args[-2] );
- y = ADD_LONG( y, args[-1] );
- args = stack;
- break;
-
- case cff_op_vmoveto:
- FT_TRACE4(( " vmoveto\n" ));
-
- cff_builder_close_contour( builder );
- builder->path_begun = 0;
- y = ADD_LONG( y, args[-1] );
- args = stack;
- break;
-
- case cff_op_hmoveto:
- FT_TRACE4(( " hmoveto\n" ));
-
- cff_builder_close_contour( builder );
- builder->path_begun = 0;
- x = ADD_LONG( x, args[-1] );
- args = stack;
- break;
-
- case cff_op_rlineto:
- FT_TRACE4(( " rlineto\n" ));
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, num_args / 2 ) )
- goto Fail;
-
- if ( num_args < 2 )
- goto Stack_Underflow;
-
- args -= num_args & ~1;
- while ( args < decoder->top )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 1 );
- args += 2;
- }
- args = stack;
- break;
-
- case cff_op_hlineto:
- case cff_op_vlineto:
- {
- FT_Int phase = ( op == cff_op_hlineto );
-
-
- FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n"
- : " vlineto\n" ));
-
- if ( num_args < 0 )
- goto Stack_Underflow;
-
- /* there exist subsetted fonts (found in PDFs) */
- /* which call `hlineto' without arguments */
- if ( num_args == 0 )
- break;
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, num_args ) )
- goto Fail;
-
- args = stack;
- while ( args < decoder->top )
- {
- if ( phase )
- x = ADD_LONG( x, args[0] );
- else
- y = ADD_LONG( y, args[0] );
-
- if ( cff_builder_add_point1( builder, x, y ) )
- goto Fail;
-
- args++;
- phase ^= 1;
- }
- args = stack;
- }
- break;
-
- case cff_op_rrcurveto:
- {
- FT_Int nargs;
-
-
- FT_TRACE4(( " rrcurveto\n" ));
-
- if ( num_args < 6 )
- goto Stack_Underflow;
-
- nargs = num_args - num_args % 6;
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, nargs / 2 ) )
- goto Fail;
-
- args -= nargs;
- while ( args < decoder->top )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[2] );
- y = ADD_LONG( y, args[3] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[4] );
- y = ADD_LONG( y, args[5] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args += 6;
- }
- args = stack;
- }
- break;
-
- case cff_op_vvcurveto:
- {
- FT_Int nargs;
-
-
- FT_TRACE4(( " vvcurveto\n" ));
-
- if ( num_args < 4 )
- goto Stack_Underflow;
-
- /* if num_args isn't of the form 4n or 4n+1, */
- /* we enforce it by clearing the second bit */
-
- nargs = num_args & ~2;
-
- if ( cff_builder_start_point( builder, x, y ) )
- goto Fail;
-
- args -= nargs;
-
- if ( nargs & 1 )
- {
- x = ADD_LONG( x, args[0] );
- args++;
- nargs--;
- }
-
- if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
- goto Fail;
-
- while ( args < decoder->top )
- {
- y = ADD_LONG( y, args[0] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[1] );
- y = ADD_LONG( y, args[2] );
- cff_builder_add_point( builder, x, y, 0 );
-
- y = ADD_LONG( y, args[3] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args += 4;
- }
- args = stack;
- }
- break;
-
- case cff_op_hhcurveto:
- {
- FT_Int nargs;
-
-
- FT_TRACE4(( " hhcurveto\n" ));
-
- if ( num_args < 4 )
- goto Stack_Underflow;
-
- /* if num_args isn't of the form 4n or 4n+1, */
- /* we enforce it by clearing the second bit */
-
- nargs = num_args & ~2;
-
- if ( cff_builder_start_point( builder, x, y ) )
- goto Fail;
-
- args -= nargs;
- if ( nargs & 1 )
- {
- y = ADD_LONG( y, args[0] );
- args++;
- nargs--;
- }
-
- if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
- goto Fail;
-
- while ( args < decoder->top )
- {
- x = ADD_LONG( x, args[0] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[1] );
- y = ADD_LONG( y, args[2] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[3] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args += 4;
- }
- args = stack;
- }
- break;
-
- case cff_op_vhcurveto:
- case cff_op_hvcurveto:
- {
- FT_Int phase;
- FT_Int nargs;
-
-
- FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto\n"
- : " hvcurveto\n" ));
-
- if ( cff_builder_start_point( builder, x, y ) )
- goto Fail;
-
- if ( num_args < 4 )
- goto Stack_Underflow;
-
- /* if num_args isn't of the form 8n, 8n+1, 8n+4, or 8n+5, */
- /* we enforce it by clearing the second bit */
-
- nargs = num_args & ~2;
-
- args -= nargs;
- if ( cff_check_points( builder, ( nargs / 4 ) * 3 ) )
- goto Stack_Underflow;
-
- phase = ( op == cff_op_hvcurveto );
-
- while ( nargs >= 4 )
- {
- nargs -= 4;
- if ( phase )
- {
- x = ADD_LONG( x, args[0] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[1] );
- y = ADD_LONG( y, args[2] );
- cff_builder_add_point( builder, x, y, 0 );
-
- y = ADD_LONG( y, args[3] );
- if ( nargs == 1 )
- x = ADD_LONG( x, args[4] );
- cff_builder_add_point( builder, x, y, 1 );
- }
- else
- {
- y = ADD_LONG( y, args[0] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[1] );
- y = ADD_LONG( y, args[2] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[3] );
- if ( nargs == 1 )
- y = ADD_LONG( y, args[4] );
- cff_builder_add_point( builder, x, y, 1 );
- }
- args += 4;
- phase ^= 1;
- }
- args = stack;
- }
- break;
-
- case cff_op_rlinecurve:
- {
- FT_Int num_lines;
- FT_Int nargs;
-
-
- FT_TRACE4(( " rlinecurve\n" ));
-
- if ( num_args < 8 )
- goto Stack_Underflow;
-
- nargs = num_args & ~1;
- num_lines = ( nargs - 6 ) / 2;
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, num_lines + 3 ) )
- goto Fail;
-
- args -= nargs;
-
- /* first, add the line segments */
- while ( num_lines > 0 )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args += 2;
- num_lines--;
- }
-
- /* then the curve */
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[2] );
- y = ADD_LONG( y, args[3] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[4] );
- y = ADD_LONG( y, args[5] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args = stack;
- }
- break;
-
- case cff_op_rcurveline:
- {
- FT_Int num_curves;
- FT_Int nargs;
-
-
- FT_TRACE4(( " rcurveline\n" ));
-
- if ( num_args < 8 )
- goto Stack_Underflow;
-
- nargs = num_args - 2;
- nargs = nargs - nargs % 6 + 2;
- num_curves = ( nargs - 2 ) / 6;
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, num_curves * 3 + 2 ) )
- goto Fail;
-
- args -= nargs;
-
- /* first, add the curves */
- while ( num_curves > 0 )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[2] );
- y = ADD_LONG( y, args[3] );
- cff_builder_add_point( builder, x, y, 0 );
-
- x = ADD_LONG( x, args[4] );
- y = ADD_LONG( y, args[5] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args += 6;
- num_curves--;
- }
-
- /* then the final line */
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args = stack;
- }
- break;
-
- case cff_op_hflex1:
- {
- FT_Pos start_y;
-
-
- FT_TRACE4(( " hflex1\n" ));
-
- /* adding five more points: 4 control points, 1 on-curve point */
- /* -- make sure we have enough space for the start point if it */
- /* needs to be added */
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, 6 ) )
- goto Fail;
-
- /* record the starting point's y position for later use */
- start_y = y;
-
- /* first control point */
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* second control point */
- x = ADD_LONG( x, args[2] );
- y = ADD_LONG( y, args[3] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* join point; on curve, with y-value the same as the last */
- /* control point's y-value */
- x = ADD_LONG( x, args[4] );
- cff_builder_add_point( builder, x, y, 1 );
-
- /* third control point, with y-value the same as the join */
- /* point's y-value */
- x = ADD_LONG( x, args[5] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* fourth control point */
- x = ADD_LONG( x, args[6] );
- y = ADD_LONG( y, args[7] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* ending point, with y-value the same as the start */
- x = ADD_LONG( x, args[8] );
- y = start_y;
- cff_builder_add_point( builder, x, y, 1 );
-
- args = stack;
- break;
- }
-
- case cff_op_hflex:
- {
- FT_Pos start_y;
-
-
- FT_TRACE4(( " hflex\n" ));
-
- /* adding six more points; 4 control points, 2 on-curve points */
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, 6 ) )
- goto Fail;
-
- /* record the starting point's y-position for later use */
- start_y = y;
-
- /* first control point */
- x = ADD_LONG( x, args[0] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* second control point */
- x = ADD_LONG( x, args[1] );
- y = ADD_LONG( y, args[2] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* join point; on curve, with y-value the same as the last */
- /* control point's y-value */
- x = ADD_LONG( x, args[3] );
- cff_builder_add_point( builder, x, y, 1 );
-
- /* third control point, with y-value the same as the join */
- /* point's y-value */
- x = ADD_LONG( x, args[4] );
- cff_builder_add_point( builder, x, y, 0 );
-
- /* fourth control point */
- x = ADD_LONG( x, args[5] );
- y = start_y;
- cff_builder_add_point( builder, x, y, 0 );
-
- /* ending point, with y-value the same as the start point's */
- /* y-value -- we don't add this point, though */
- x = ADD_LONG( x, args[6] );
- cff_builder_add_point( builder, x, y, 1 );
-
- args = stack;
- break;
- }
-
- case cff_op_flex1:
- {
- FT_Pos start_x, start_y; /* record start x, y values for */
- /* alter use */
- FT_Fixed dx = 0, dy = 0; /* used in horizontal/vertical */
- /* algorithm below */
- FT_Int horizontal, count;
- FT_Fixed* temp;
-
-
- FT_TRACE4(( " flex1\n" ));
-
- /* adding six more points; 4 control points, 2 on-curve points */
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, 6 ) )
- goto Fail;
-
- /* record the starting point's x, y position for later use */
- start_x = x;
- start_y = y;
-
- /* XXX: figure out whether this is supposed to be a horizontal */
- /* or vertical flex; the Type 2 specification is vague... */
-
- temp = args;
-
- /* grab up to the last argument */
- for ( count = 5; count > 0; count-- )
- {
- dx = ADD_LONG( dx, temp[0] );
- dy = ADD_LONG( dy, temp[1] );
- temp += 2;
- }
-
- if ( dx < 0 )
- dx = -dx;
- if ( dy < 0 )
- dy = -dy;
-
- /* strange test, but here it is... */
- horizontal = ( dx > dy );
-
- for ( count = 5; count > 0; count-- )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y,
- (FT_Bool)( count == 3 ) );
- args += 2;
- }
-
- /* is last operand an x- or y-delta? */
- if ( horizontal )
- {
- x = ADD_LONG( x, args[0] );
- y = start_y;
- }
- else
- {
- x = start_x;
- y = ADD_LONG( y, args[0] );
- }
-
- cff_builder_add_point( builder, x, y, 1 );
-
- args = stack;
- break;
- }
-
- case cff_op_flex:
- {
- FT_UInt count;
-
-
- FT_TRACE4(( " flex\n" ));
-
- if ( cff_builder_start_point( builder, x, y ) ||
- cff_check_points( builder, 6 ) )
- goto Fail;
-
- for ( count = 6; count > 0; count-- )
- {
- x = ADD_LONG( x, args[0] );
- y = ADD_LONG( y, args[1] );
- cff_builder_add_point( builder, x, y,
- (FT_Bool)( count == 4 || count == 1 ) );
- args += 2;
- }
-
- args = stack;
- }
- break;
-
- case cff_op_seac:
- FT_TRACE4(( " seac\n" ));
-
- error = cff_operator_seac( decoder,
- args[0], args[1], args[2],
- (FT_Int)( args[3] >> 16 ),
- (FT_Int)( args[4] >> 16 ) );
-
- /* add current outline to the glyph slot */
- FT_GlyphLoader_Add( builder->loader );
-
- /* return now! */
- FT_TRACE4(( "\n" ));
- return error;
-
- case cff_op_endchar:
- /* in dictionaries, `endchar' simply indicates end of data */
- if ( in_dict )
- return error;
-
- FT_TRACE4(( " endchar\n" ));
-
- /* We are going to emulate the seac operator. */
- if ( num_args >= 4 )
- {
- /* Save glyph width so that the subglyphs don't overwrite it. */
- FT_Pos glyph_width = decoder->glyph_width;
-
-
- error = cff_operator_seac( decoder,
- 0L, args[-4], args[-3],
- (FT_Int)( args[-2] >> 16 ),
- (FT_Int)( args[-1] >> 16 ) );
-
- decoder->glyph_width = glyph_width;
- }
- else
- {
- cff_builder_close_contour( builder );
-
- /* close hints recording session */
- if ( hinter )
- {
- if ( hinter->close( hinter->hints,
- (FT_UInt)builder->current->n_points ) )
- goto Syntax_Error;
-
- /* apply hints to the loaded glyph outline now */
- error = hinter->apply( hinter->hints,
- builder->current,
- (PSH_Globals)builder->hints_globals,
- decoder->hint_mode );
- if ( error )
- goto Fail;
- }
-
- /* add current outline to the glyph slot */
- FT_GlyphLoader_Add( builder->loader );
- }
-
- /* return now! */
- FT_TRACE4(( "\n" ));
- return error;
-
- case cff_op_abs:
- FT_TRACE4(( " abs\n" ));
-
- if ( args[0] < 0 )
- {
- if ( args[0] == FT_LONG_MIN )
- args[0] = FT_LONG_MAX;
- else
- args[0] = -args[0];
- }
- args++;
- break;
-
- case cff_op_add:
- FT_TRACE4(( " add\n" ));
-
- args[0] = ADD_LONG( args[0], args[1] );
- args++;
- break;
-
- case cff_op_sub:
- FT_TRACE4(( " sub\n" ));
-
- args[0] = SUB_LONG( args[0], args[1] );
- args++;
- break;
-
- case cff_op_div:
- FT_TRACE4(( " div\n" ));
-
- args[0] = FT_DivFix( args[0], args[1] );
- args++;
- break;
-
- case cff_op_neg:
- FT_TRACE4(( " neg\n" ));
-
- if ( args[0] == FT_LONG_MIN )
- args[0] = FT_LONG_MAX;
- args[0] = -args[0];
- args++;
- break;
-
- case cff_op_random:
- FT_TRACE4(( " random\n" ));
-
- /* only use the lower 16 bits of `random' */
- /* to generate a number in the range (0;1] */
- args[0] = (FT_Fixed)
- ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
- args++;
-
- decoder->current_subfont->random =
- cff_random( decoder->current_subfont->random );
- break;
-
- case cff_op_mul:
- FT_TRACE4(( " mul\n" ));
-
- args[0] = FT_MulFix( args[0], args[1] );
- args++;
- break;
-
- case cff_op_sqrt:
- FT_TRACE4(( " sqrt\n" ));
-
- if ( args[0] > 0 )
- {
- FT_Fixed root = args[0];
- FT_Fixed new_root;
-
-
- for (;;)
- {
- new_root = ( root + FT_DivFix( args[0], root ) + 1 ) >> 1;
- if ( new_root == root )
- break;
- root = new_root;
- }
- args[0] = new_root;
- }
- else
- args[0] = 0;
- args++;
- break;
-
- case cff_op_drop:
- /* nothing */
- FT_TRACE4(( " drop\n" ));
-
- break;
-
- case cff_op_exch:
- {
- FT_Fixed tmp;
-
-
- FT_TRACE4(( " exch\n" ));
-
- tmp = args[0];
- args[0] = args[1];
- args[1] = tmp;
- args += 2;
- }
- break;
-
- case cff_op_index:
- {
- FT_Int idx = (FT_Int)( args[0] >> 16 );
-
-
- FT_TRACE4(( " index\n" ));
-
- if ( idx < 0 )
- idx = 0;
- else if ( idx > num_args - 2 )
- idx = num_args - 2;
- args[0] = args[-( idx + 1 )];
- args++;
- }
- break;
-
- case cff_op_roll:
- {
- FT_Int count = (FT_Int)( args[0] >> 16 );
- FT_Int idx = (FT_Int)( args[1] >> 16 );
-
-
- FT_TRACE4(( " roll\n" ));
-
- if ( count <= 0 )
- count = 1;
-
- args -= count;
- if ( args < stack )
- goto Stack_Underflow;
-
- if ( idx >= 0 )
- {
- while ( idx > 0 )
- {
- FT_Fixed tmp = args[count - 1];
- FT_Int i;
-
-
- for ( i = count - 2; i >= 0; i-- )
- args[i + 1] = args[i];
- args[0] = tmp;
- idx--;
- }
- }
- else
- {
- while ( idx < 0 )
- {
- FT_Fixed tmp = args[0];
- FT_Int i;
-
-
- for ( i = 0; i < count - 1; i++ )
- args[i] = args[i + 1];
- args[count - 1] = tmp;
- idx++;
- }
- }
- args += count;
- }
- break;
-
- case cff_op_dup:
- FT_TRACE4(( " dup\n" ));
-
- args[1] = args[0];
- args += 2;
- break;
-
- case cff_op_put:
- {
- FT_Fixed val = args[0];
- FT_Int idx = (FT_Int)( args[1] >> 16 );
-
-
- FT_TRACE4(( " put\n" ));
-
- /* the Type2 specification before version 16-March-2000 */
- /* didn't give a hard-coded size limit of the temporary */
- /* storage array; instead, an argument of the */
- /* `MultipleMaster' operator set the size */
- if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
- decoder->buildchar[idx] = val;
- }
- break;
-
- case cff_op_get:
- {
- FT_Int idx = (FT_Int)( args[0] >> 16 );
- FT_Fixed val = 0;
-
-
- FT_TRACE4(( " get\n" ));
-
- if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
- val = decoder->buildchar[idx];
-
- args[0] = val;
- args++;
- }
- break;
-
- case cff_op_store:
- /* this operator was removed from the Type2 specification */
- /* in version 16-March-2000 */
-
- /* since we currently don't handle interpolation of multiple */
- /* master fonts, this is a no-op */
- FT_TRACE4(( " store\n"));
- break;
-
- case cff_op_load:
- /* this operator was removed from the Type2 specification */
- /* in version 16-March-2000 */
- {
- FT_Int reg_idx = (FT_Int)args[0];
- FT_Int idx = (FT_Int)args[1];
- FT_Int count = (FT_Int)args[2];
-
-
- FT_TRACE4(( " load\n" ));
-
- /* since we currently don't handle interpolation of multiple */
- /* master fonts, we store a vector [1 0 0 ...] in the */
- /* temporary storage array regardless of the Registry index */
- if ( reg_idx >= 0 && reg_idx <= 2 &&
- idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS &&
- count >= 0 && count <= num_axes )
- {
- FT_Int end, i;
-
-
- end = FT_MIN( idx + count, CFF_MAX_TRANS_ELEMENTS );
-
- if ( idx < end )
- decoder->buildchar[idx] = 1 << 16;
-
- for ( i = idx + 1; i < end; i++ )
- decoder->buildchar[i] = 0;
- }
- }
- break;
-
- case cff_op_blend:
- /* this operator was removed from the Type2 specification */
- /* in version 16-March-2000 */
- {
- FT_Int num_results = (FT_Int)( args[0] >> 16 );
-
-
- FT_TRACE4(( " blend\n" ));
-
- if ( num_results < 0 )
- goto Syntax_Error;
-
- if ( num_results * (FT_Int)num_designs > num_args )
- goto Stack_Underflow;
-
- /* since we currently don't handle interpolation of multiple */
- /* master fonts, return the `num_results' values of the */
- /* first master */
- args -= num_results * ( num_designs - 1 );
- num_args -= num_results * ( num_designs - 1 );
- }
- break;
-
- case cff_op_dotsection:
- /* this operator is deprecated and ignored by the parser */
- FT_TRACE4(( " dotsection\n" ));
- break;
-
- case cff_op_closepath:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " closepath (invalid op)\n" ));
-
- args = stack;
- break;
-
- case cff_op_hsbw:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " hsbw (invalid op)\n" ));
-
- decoder->glyph_width =
- ADD_LONG( decoder->nominal_width, ( args[1] >> 16 ) );
-
- decoder->builder.left_bearing.x = args[0];
- decoder->builder.left_bearing.y = 0;
-
- x = ADD_LONG( decoder->builder.pos_x, args[0] );
- y = decoder->builder.pos_y;
- args = stack;
- break;
-
- case cff_op_sbw:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " sbw (invalid op)\n" ));
-
- decoder->glyph_width =
- ADD_LONG( decoder->nominal_width, ( args[2] >> 16 ) );
-
- decoder->builder.left_bearing.x = args[0];
- decoder->builder.left_bearing.y = args[1];
-
- x = ADD_LONG( decoder->builder.pos_x, args[0] );
- y = ADD_LONG( decoder->builder.pos_y, args[1] );
- args = stack;
- break;
-
- case cff_op_setcurrentpoint:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " setcurrentpoint (invalid op)\n" ));
-
- x = ADD_LONG( decoder->builder.pos_x, args[0] );
- y = ADD_LONG( decoder->builder.pos_y, args[1] );
- args = stack;
- break;
-
- case cff_op_callothersubr:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " callothersubr (invalid op)\n" ));
-
- /* subsequent `pop' operands should add the arguments, */
- /* this is the implementation described for `unknown' other */
- /* subroutines in the Type1 spec. */
- /* */
- /* XXX Fix return arguments (see discussion below). */
- args -= 2 + ( args[-2] >> 16 );
- if ( args < stack )
- goto Stack_Underflow;
- break;
-
- case cff_op_pop:
- /* this is an invalid Type 2 operator; however, there */
- /* exist fonts which are incorrectly converted from probably */
- /* Type 1 to CFF, and some parsers seem to accept it */
-
- FT_TRACE4(( " pop (invalid op)\n" ));
-
- /* XXX Increasing `args' is wrong: After a certain number of */
- /* `pop's we get a stack overflow. Reason for doing it is */
- /* code like this (actually found in a CFF font): */
- /* */
- /* 17 1 3 callothersubr */
- /* pop */
- /* callsubr */
- /* */
- /* Since we handle `callothersubr' as a no-op, and */
- /* `callsubr' needs at least one argument, `pop' can't be a */
- /* no-op too as it basically should be. */
- /* */
- /* The right solution would be to provide real support for */
- /* `callothersubr' as done in `t1decode.c', however, given */
- /* the fact that CFF fonts with `pop' are invalid, it is */
- /* questionable whether it is worth the time. */
- args++;
- break;
-
- case cff_op_and:
- {
- FT_Fixed cond = ( args[0] && args[1] );
-
-
- FT_TRACE4(( " and\n" ));
-
- args[0] = cond ? 0x10000L : 0;
- args++;
- }
- break;
-
- case cff_op_or:
- {
- FT_Fixed cond = ( args[0] || args[1] );
-
-
- FT_TRACE4(( " or\n" ));
-
- args[0] = cond ? 0x10000L : 0;
- args++;
- }
- break;
-
- case cff_op_not:
- {
- FT_Fixed cond = !args[0];
-
-
- FT_TRACE4(( " not\n" ));
-
- args[0] = cond ? 0x10000L : 0;
- args++;
- }
- break;
-
- case cff_op_eq:
- {
- FT_Fixed cond = ( args[0] == args[1] );
-
-
- FT_TRACE4(( " eq\n" ));
-
- args[0] = cond ? 0x10000L : 0;
- args++;
- }
- break;
-
- case cff_op_ifelse:
- {
- FT_Fixed cond = ( args[2] <= args[3] );
-
-
- FT_TRACE4(( " ifelse\n" ));
-
- if ( !cond )
- args[0] = args[1];
- args++;
- }
- break;
-
- case cff_op_callsubr:
- {
- FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
- decoder->locals_bias );
-
-
- FT_TRACE4(( " callsubr (idx %d, entering level %d)\n",
- idx,
- zone - decoder->zones + 1 ));
-
- if ( idx >= decoder->num_locals )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " invalid local subr index\n" ));
- goto Syntax_Error;
- }
-
- if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " too many nested subrs\n" ));
- goto Syntax_Error;
- }
-
- zone->cursor = ip; /* save current instruction pointer */
-
- zone++;
- zone->base = decoder->locals[idx];
- zone->limit = decoder->locals[idx + 1];
- zone->cursor = zone->base;
-
- if ( !zone->base || zone->limit == zone->base )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " invoking empty subrs\n" ));
- goto Syntax_Error;
- }
-
- decoder->zone = zone;
- ip = zone->base;
- limit = zone->limit;
- }
- break;
-
- case cff_op_callgsubr:
- {
- FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
- decoder->globals_bias );
-
-
- FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n",
- idx,
- zone - decoder->zones + 1 ));
-
- if ( idx >= decoder->num_globals )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " invalid global subr index\n" ));
- goto Syntax_Error;
- }
-
- if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " too many nested subrs\n" ));
- goto Syntax_Error;
- }
-
- zone->cursor = ip; /* save current instruction pointer */
-
- zone++;
- zone->base = decoder->globals[idx];
- zone->limit = decoder->globals[idx + 1];
- zone->cursor = zone->base;
-
- if ( !zone->base || zone->limit == zone->base )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " invoking empty subrs\n" ));
- goto Syntax_Error;
- }
-
- decoder->zone = zone;
- ip = zone->base;
- limit = zone->limit;
- }
- break;
-
- case cff_op_return:
- FT_TRACE4(( " return (leaving level %d)\n",
- decoder->zone - decoder->zones ));
-
- if ( decoder->zone <= decoder->zones )
- {
- FT_ERROR(( "cff_decoder_parse_charstrings:"
- " unexpected return\n" ));
- goto Syntax_Error;
- }
-
- decoder->zone--;
- zone = decoder->zone;
- ip = zone->cursor;
- limit = zone->limit;
- break;
-
- default:
- FT_ERROR(( "Unimplemented opcode: %d", ip[-1] ));
-
- if ( ip[-1] == 12 )
- FT_ERROR(( " %d", ip[0] ));
- FT_ERROR(( "\n" ));
-
- return FT_THROW( Unimplemented_Feature );
- }
-
- decoder->top = args;
-
- if ( decoder->top - stack >= CFF_MAX_OPERANDS )
- goto Stack_Overflow;
-
- } /* general operator processing */
-
- } /* while ip < limit */
-
- FT_TRACE4(( "..end..\n\n" ));
-
- Fail:
- return error;
-
- MM_Error:
- FT_TRACE4(( "cff_decoder_parse_charstrings:"
- " invalid opcode found in top DICT charstring\n"));
- return FT_THROW( Invalid_File_Format );
-
- Syntax_Error:
- FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error\n" ));
- return FT_THROW( Invalid_File_Format );
-
- Stack_Underflow:
- FT_TRACE4(( "cff_decoder_parse_charstrings: stack underflow\n" ));
- return FT_THROW( Too_Few_Arguments );
-
- Stack_Overflow:
- FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow\n" ));
- return FT_THROW( Stack_Overflow );
- }
-
-#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
-
-
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -2704,11 +142,14 @@
FT_Int glyph_index;
CFF_Font cff = (CFF_Font)face->other;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+ const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs;
+
*max_advance = 0;
/* Initialize load decoder */
- cff_decoder_init( &decoder, face, 0, 0, 0, 0 );
+ decoder_funcs->init( &decoder, face, 0, 0, 0, 0, 0, 0 );
decoder.builder.metrics_only = 1;
decoder.builder.load_points = 0;
@@ -2727,12 +168,12 @@
&charstring, &charstring_len );
if ( !error )
{
- error = cff_decoder_prepare( &decoder, size, glyph_index );
+ error = decoder_funcs->prepare( &decoder, size, glyph_index );
if ( !error )
- error = cff_decoder_parse_charstrings( &decoder,
- charstring,
- charstring_len,
- 0 );
+ error = decoder_funcs->parse_charstrings_old( &decoder,
+ charstring,
+ charstring_len,
+ 0 );
cff_free_glyph_data( face, &charstring, &charstring_len );
}
@@ -2758,10 +199,14 @@
{
FT_Error error;
CFF_Decoder decoder;
+ PS_Decoder psdecoder;
TT_Face face = (TT_Face)glyph->root.face;
FT_Bool hinting, scaled, force_scaling;
CFF_Font cff = (CFF_Font)face->extra.data;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+ const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs;
+
FT_Matrix font_matrix;
FT_Vector font_offset;
@@ -2951,7 +396,7 @@
{
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- CFF_Driver driver = (CFF_Driver)FT_FACE_DRIVER( face );
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
#endif
@@ -2959,8 +404,10 @@
FT_ULong charstring_len;
- cff_decoder_init( &decoder, face, size, glyph, hinting,
- FT_LOAD_TARGET_MODE( load_flags ) );
+ decoder_funcs->init( &decoder, face, size, glyph, hinting,
+ FT_LOAD_TARGET_MODE( load_flags ),
+ cff_get_glyph_data,
+ cff_free_glyph_data );
/* this is for pure CFFs */
if ( load_flags & FT_LOAD_ADVANCE_ONLY )
@@ -2975,23 +422,25 @@
if ( error )
goto Glyph_Build_Finished;
- error = cff_decoder_prepare( &decoder, size, glyph_index );
+ error = decoder_funcs->prepare( &decoder, size, glyph_index );
if ( error )
goto Glyph_Build_Finished;
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
/* choose which CFF renderer to use */
- if ( driver->hinting_engine == FT_CFF_HINTING_FREETYPE )
- error = cff_decoder_parse_charstrings( &decoder,
- charstring,
- charstring_len,
- 0 );
+ if ( driver->hinting_engine == FT_HINTING_FREETYPE )
+ error = decoder_funcs->parse_charstrings_old( &decoder,
+ charstring,
+ charstring_len,
+ 0 );
else
#endif
{
- error = cf2_decoder_parse_charstrings( &decoder,
- charstring,
- charstring_len );
+ psaux->ps_decoder_init( &psdecoder, &decoder, FALSE );
+
+ error = decoder_funcs->parse_charstrings( &psdecoder,
+ charstring,
+ charstring_len );
/* Adobe's engine uses 16.16 numbers everywhere; */
/* as a consequence, glyphs larger than 2000ppem get rejected */
@@ -3004,9 +453,9 @@
force_scaling = TRUE;
glyph->hint = hinting;
- error = cf2_decoder_parse_charstrings( &decoder,
- charstring,
- charstring_len );
+ error = decoder_funcs->parse_charstrings( &psdecoder,
+ charstring,
+ charstring_len );
}
}
@@ -3044,7 +493,7 @@
Glyph_Build_Finished:
/* save new glyph tables, if no error */
if ( !error )
- cff_builder_done( &decoder.builder );
+ decoder.builder.funcs.done( &decoder.builder );
/* XXX: anything to do for broken glyph entry? */
}
diff --git a/thirdparty/freetype/src/cff/cffgload.h b/thirdparty/freetype/src/cff/cffgload.h
index 0fa93b4398..803f3974fc 100644
--- a/thirdparty/freetype/src/cff/cffgload.h
+++ b/thirdparty/freetype/src/cff/cffgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,119 +22,11 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#include "cffobjs.h"
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
FT_BEGIN_HEADER
-
-#define CFF_MAX_OPERANDS 48
-#define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */
- /* only 10 are allowed but there exist */
- /* fonts like `HiraKakuProN-W3.ttf' */
- /* (Hiragino Kaku Gothic ProN W3; */
- /* 8.2d6e1; 2014-12-19) that exceed */
- /* this limit */
-#define CFF_MAX_TRANS_ELEMENTS 32
-
-
- /*************************************************************************/
- /* */
- /* <Structure> */
- /* CFF_Builder */
- /* */
- /* <Description> */
- /* A structure used during glyph loading to store its outline. */
- /* */
- /* <Fields> */
- /* memory :: The current memory object. */
- /* */
- /* face :: The current face object. */
- /* */
- /* glyph :: The current glyph slot. */
- /* */
- /* loader :: The current glyph loader. */
- /* */
- /* base :: The base glyph outline. */
- /* */
- /* current :: The current glyph outline. */
- /* */
- /* pos_x :: The horizontal translation (if composite glyph). */
- /* */
- /* pos_y :: The vertical translation (if composite glyph). */
- /* */
- /* left_bearing :: The left side bearing point. */
- /* */
- /* advance :: The horizontal advance vector. */
- /* */
- /* bbox :: Unused. */
- /* */
- /* path_begun :: A flag which indicates that a new path has begun. */
- /* */
- /* load_points :: If this flag is not set, no points are loaded. */
- /* */
- /* no_recurse :: Set but not used. */
- /* */
- /* metrics_only :: A boolean indicating that we only want to compute */
- /* the metrics of a given glyph, not load all of its */
- /* points. */
- /* */
- /* hints_funcs :: Auxiliary pointer for hinting. */
- /* */
- /* hints_globals :: Auxiliary pointer for hinting. */
- /* */
- typedef struct CFF_Builder_
- {
- FT_Memory memory;
- TT_Face face;
- CFF_GlyphSlot glyph;
- FT_GlyphLoader loader;
- FT_Outline* base;
- FT_Outline* current;
-
- FT_Pos pos_x;
- FT_Pos pos_y;
-
- FT_Vector left_bearing;
- FT_Vector advance;
-
- FT_BBox bbox; /* bounding box */
- FT_Bool path_begun;
- FT_Bool load_points;
- FT_Bool no_recurse;
-
- FT_Bool metrics_only;
-
- void* hints_funcs; /* hinter-specific */
- void* hints_globals; /* hinter-specific */
-
- } CFF_Builder;
-
-
- FT_LOCAL( FT_Error )
- cff_check_points( CFF_Builder* builder,
- FT_Int count );
-
- FT_LOCAL( void )
- cff_builder_add_point( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y,
- FT_Byte flag );
- FT_LOCAL( FT_Error )
- cff_builder_add_point1( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y );
- FT_LOCAL( FT_Error )
- cff_builder_start_point( CFF_Builder* builder,
- FT_Pos x,
- FT_Pos y );
- FT_LOCAL( void )
- cff_builder_close_contour( CFF_Builder* builder );
-
-
- FT_LOCAL( FT_Int )
- cff_lookup_glyph_by_stdcharcode( CFF_Font cff,
- FT_Int charcode );
FT_LOCAL( FT_Error )
cff_get_glyph_data( TT_Face face,
FT_UInt glyph_index,
@@ -146,74 +38,6 @@ FT_BEGIN_HEADER
FT_ULong length );
- /* execution context charstring zone */
-
- typedef struct CFF_Decoder_Zone_
- {
- FT_Byte* base;
- FT_Byte* limit;
- FT_Byte* cursor;
-
- } CFF_Decoder_Zone;
-
-
- typedef struct CFF_Decoder_
- {
- CFF_Builder builder;
- CFF_Font cff;
-
- FT_Fixed stack[CFF_MAX_OPERANDS + 1];
- FT_Fixed* top;
-
- CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1];
- CFF_Decoder_Zone* zone;
-
- FT_Int flex_state;
- FT_Int num_flex_vectors;
- FT_Vector flex_vectors[7];
-
- FT_Pos glyph_width;
- FT_Pos nominal_width;
-
- FT_Bool read_width;
- FT_Bool width_only;
- FT_Int num_hints;
- FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS];
-
- FT_UInt num_locals;
- FT_UInt num_globals;
-
- FT_Int locals_bias;
- FT_Int globals_bias;
-
- FT_Byte** locals;
- FT_Byte** globals;
-
- FT_Byte** glyph_names; /* for pure CFF fonts only */
- FT_UInt num_glyphs; /* number of glyphs in font */
-
- FT_Render_Mode hint_mode;
-
- FT_Bool seac;
-
- CFF_SubFont current_subfont; /* for current glyph_index */
-
- } CFF_Decoder;
-
-
- FT_LOCAL( void )
- cff_decoder_init( CFF_Decoder* decoder,
- TT_Face face,
- CFF_Size size,
- CFF_GlyphSlot slot,
- FT_Bool hinting,
- FT_Render_Mode hint_mode );
-
- FT_LOCAL( FT_Error )
- cff_decoder_prepare( CFF_Decoder* decoder,
- CFF_Size size,
- FT_UInt glyph_index );
-
#if 0 /* unused until we support pure CFF fonts */
/* Compute the maximum advance width of a font through quick parsing */
@@ -223,13 +47,6 @@ FT_BEGIN_HEADER
#endif /* 0 */
-#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- FT_LOCAL( FT_Error )
- cff_decoder_parse_charstrings( CFF_Decoder* decoder,
- FT_Byte* charstring_base,
- FT_ULong charstring_len,
- FT_Bool in_dict );
-#endif
FT_LOCAL( FT_Error )
cff_slot_load( CFF_GlyphSlot glyph,
diff --git a/thirdparty/freetype/src/cff/cffload.c b/thirdparty/freetype/src/cff/cffload.c
index 12420384af..1c6fe51566 100644
--- a/thirdparty/freetype/src/cff/cffload.c
+++ b/thirdparty/freetype/src/cff/cffload.c
@@ -4,7 +4,7 @@
/* */
/* OpenType and CFF data/program tables loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
#include FT_TYPE1_TABLES_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
@@ -1297,7 +1298,9 @@
if ( numOperands > count )
{
- FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d args\n", count ));
+ FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d argument%s\n",
+ count,
+ count == 1 ? "" : "s" ));
error = FT_THROW( Stack_Underflow );
goto Exit;
@@ -1345,19 +1348,14 @@
for ( i = 0; i < numBlends; i++ )
{
const FT_Int32* weight = &blend->BV[1];
- FT_Int32 sum;
+ FT_UInt32 sum;
/* convert inputs to 16.16 fixed point */
- sum = cff_parse_num( parser, &parser->stack[i + base] ) * 65536;
+ sum = cff_parse_num( parser, &parser->stack[i + base] ) * 0x10000;
for ( j = 1; j < blend->lenBV; j++ )
- sum = ADD_INT32(
- sum,
- FT_MulFix(
- *weight++,
- cff_parse_num( parser,
- &parser->stack[delta++] ) * 65536 ) );
+ sum += cff_parse_num( parser, &parser->stack[delta++] ) * *weight++;
/* point parser stack to new value on blend_stack */
parser->stack[i + base] = subFont->blend_top;
@@ -1367,10 +1365,10 @@
/* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */
/* decode of this, which rounds to an integer. */
*subFont->blend_top++ = 255;
- *subFont->blend_top++ = ( (FT_UInt32)sum & 0xFF000000U ) >> 24;
- *subFont->blend_top++ = ( (FT_UInt32)sum & 0x00FF0000U ) >> 16;
- *subFont->blend_top++ = ( (FT_UInt32)sum & 0x0000FF00U ) >> 8;
- *subFont->blend_top++ = (FT_UInt32)sum & 0x000000FFU;
+ *subFont->blend_top++ = (FT_Byte)( sum >> 24 );
+ *subFont->blend_top++ = (FT_Byte)( sum >> 16 );
+ *subFont->blend_top++ = (FT_Byte)( sum >> 8 );
+ *subFont->blend_top++ = (FT_Byte)sum;
}
/* leave only numBlends results on parser stack */
@@ -1558,13 +1556,13 @@
FT_UInt lenNDV,
FT_Fixed* NDV )
{
- if ( !blend->builtBV ||
- blend->lastVsindex != vsindex ||
- blend->lenNDV != lenNDV ||
- ( lenNDV &&
- memcmp( NDV,
- blend->lastNDV,
- lenNDV * sizeof ( *NDV ) ) != 0 ) )
+ if ( !blend->builtBV ||
+ blend->lastVsindex != vsindex ||
+ blend->lenNDV != lenNDV ||
+ ( lenNDV &&
+ ft_memcmp( NDV,
+ blend->lastNDV,
+ lenNDV * sizeof ( *NDV ) ) != 0 ) )
{
/* need to build blend vector */
return TRUE;
@@ -1600,7 +1598,8 @@
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
- mm->done_blend( FT_FACE( face ) );
+ if (mm)
+ mm->done_blend( FT_FACE( face ) );
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -1934,6 +1933,24 @@
else if ( priv->initial_random_seed == 0 )
priv->initial_random_seed = 987654321;
+ /* some sanitizing to avoid overflows later on; */
+ /* the upper limits are ad-hoc values */
+ if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
+ {
+ FT_TRACE2(( "cff_load_private_dict:"
+ " setting unlikely BlueShift value %d to default (7)\n",
+ priv->blue_shift ));
+ priv->blue_shift = 7;
+ }
+
+ if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
+ {
+ FT_TRACE2(( "cff_load_private_dict:"
+ " setting unlikely BlueFuzz value %d to default (1)\n",
+ priv->blue_fuzz ));
+ priv->blue_fuzz = 1;
+ }
+
Exit:
/* clean up */
cff_blend_clear( subfont ); /* clear blend stack */
@@ -1945,18 +1962,6 @@
}
- FT_LOCAL_DEF( FT_UInt32 )
- cff_random( FT_UInt32 r )
- {
- /* a 32bit version of the `xorshift' algorithm */
- r ^= r << 13;
- r ^= r >> 17;
- r ^= r << 5;
-
- return r;
- }
-
-
/* There are 3 ways to call this function, distinguished by code. */
/* */
/* . CFF_CODE_TOPDICT for either a CFF Top DICT or a CFF Font DICT */
@@ -1980,6 +1985,8 @@
CFF_FontRecDict top = &subfont->font_dict;
CFF_Private priv = &subfont->private_dict;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+
FT_Bool cff2 = FT_BOOL( code == CFF2_CODE_TOPDICT ||
code == CFF2_CODE_FONTDICT );
FT_UInt stackSize = cff2 ? CFF2_DEFAULT_STACK
@@ -2085,7 +2092,7 @@
*/
if ( face->root.internal->random_seed == -1 )
{
- CFF_Driver driver = (CFF_Driver)FT_FACE_DRIVER( face );
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
subfont->random = (FT_UInt32)driver->random_seed;
@@ -2094,7 +2101,7 @@
do
{
driver->random_seed =
- (FT_Int32)cff_random( (FT_UInt32)driver->random_seed );
+ (FT_Int32)psaux->cff_random( (FT_UInt32)driver->random_seed );
} while ( driver->random_seed < 0 );
}
@@ -2107,7 +2114,8 @@
do
{
face->root.internal->random_seed =
- (FT_Int32)cff_random( (FT_UInt32)face->root.internal->random_seed );
+ (FT_Int32)psaux->cff_random(
+ (FT_UInt32)face->root.internal->random_seed );
} while ( face->root.internal->random_seed < 0 );
}
@@ -2548,6 +2556,8 @@
font->cf2_instance.finalizer( font->cf2_instance.data );
FT_FREE( font->cf2_instance.data );
}
+
+ FT_FREE( font->font_extra );
}
diff --git a/thirdparty/freetype/src/cff/cffload.h b/thirdparty/freetype/src/cff/cffload.h
index c745e8127b..14d14e2112 100644
--- a/thirdparty/freetype/src/cff/cffload.h
+++ b/thirdparty/freetype/src/cff/cffload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType & CFF data/program tables loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,9 +21,9 @@
#include <ft2build.h>
-#include "cfftypes.h"
+#include FT_INTERNAL_CFF_TYPES_H
#include "cffparse.h"
-#include "cffobjs.h" /* for CFF_Face */
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H /* for CFF_Face */
FT_BEGIN_HEADER
@@ -61,9 +61,6 @@ FT_BEGIN_HEADER
FT_UInt cid );
- FT_LOCAL( FT_UInt32 )
- cff_random( FT_UInt32 r );
-
FT_LOCAL( FT_Error )
cff_font_load( FT_Library library,
FT_Stream stream,
diff --git a/thirdparty/freetype/src/cff/cffobjs.c b/thirdparty/freetype/src/cff/cffobjs.c
index 61613933ff..a2d7aec65e 100644
--- a/thirdparty/freetype/src/cff/cffobjs.c
+++ b/thirdparty/freetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,13 +25,15 @@
#include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TAGS_H
#include FT_INTERNAL_SFNT_H
-#include FT_CFF_DRIVER_H
+#include FT_DRIVER_H
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include FT_MULTIPLE_MASTERS_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
+#include FT_SERVICE_METRICS_VARIATIONS_H
#endif
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
#include "cffobjs.h"
#include "cffload.h"
#include "cffcmap.h"
@@ -39,6 +41,9 @@
#include "cfferrs.h"
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_SERVICE_CFF_TABLE_LOAD_H
+
/*************************************************************************/
/* */
@@ -408,7 +413,7 @@
remove_subset_prefix( FT_String* name )
{
FT_Int32 idx = 0;
- FT_Int32 length = (FT_Int32)strlen( name ) + 1;
+ FT_Int32 length = (FT_Int32)ft_strlen( name ) + 1;
FT_Bool continue_search = 1;
@@ -445,8 +450,8 @@
FT_Int32 family_name_length, style_name_length;
- family_name_length = (FT_Int32)strlen( family_name );
- style_name_length = (FT_Int32)strlen( style_name );
+ family_name_length = (FT_Int32)ft_strlen( family_name );
+ style_name_length = (FT_Int32)ft_strlen( style_name );
if ( family_name_length > style_name_length )
{
@@ -493,14 +498,16 @@
SFNT_Service sfnt;
FT_Service_PsCMaps psnames;
PSHinter_Service pshinter;
+ PSAux_Service psaux;
+ FT_Service_CFFLoad cffload;
FT_Bool pure_cff = 1;
FT_Bool cff2 = 0;
FT_Bool sfnt_format = 0;
FT_Library library = cffface->driver->root.library;
- sfnt = (SFNT_Service)FT_Get_Module_Interface(
- library, "sfnt" );
+ sfnt = (SFNT_Service)FT_Get_Module_Interface( library,
+ "sfnt" );
if ( !sfnt )
{
FT_ERROR(( "cff_face_init: cannot access `sfnt' module\n" ));
@@ -510,8 +517,20 @@
FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
- pshinter = (PSHinter_Service)FT_Get_Module_Interface(
- library, "pshinter" );
+ pshinter = (PSHinter_Service)FT_Get_Module_Interface( library,
+ "pshinter" );
+
+ psaux = (PSAux_Service)FT_Get_Module_Interface( library,
+ "psaux" );
+ if ( !psaux )
+ {
+ FT_ERROR(( "cff_face_init: cannot access `psaux' module\n" ));
+ error = FT_THROW( Missing_Module );
+ goto Exit;
+ }
+ face->psaux = psaux;
+
+ FT_FACE_FIND_GLOBAL_SERVICE( face, cffload, CFF_LOAD );
FT_TRACE2(( "CFF driver\n" ));
@@ -614,6 +633,7 @@
cff->pshinter = pshinter;
cff->psnames = psnames;
+ cff->cffload = cffload;
cffface->face_index = face_index & 0xFFFF;
@@ -690,50 +710,22 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
{
- FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+ FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
+ FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
- FT_Int instance_index = face_index >> 16;
+ FT_UInt instance_index = (FT_UInt)face_index >> 16;
if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
mm &&
instance_index > 0 )
{
- FT_MM_Var* mm_var;
-
-
- error = mm->get_mm_var( cffface, NULL );
+ error = mm->set_instance( cffface, instance_index );
if ( error )
goto Exit;
- mm->get_var_blend( cffface, NULL, NULL, NULL, &mm_var );
-
- if ( mm_var->namedstyle )
- {
- FT_Var_Named_Style* named_style;
- FT_String* style_name;
-
-
- /* in `face_index', the instance index starts with value 1 */
- named_style = mm_var->namedstyle + instance_index - 1;
- error = sfnt->get_name( face,
- (FT_UShort)named_style->strid,
- &style_name );
- if ( error )
- goto Exit;
-
- /* set style name; if already set, replace it */
- if ( face->root.style_name )
- FT_FREE( face->root.style_name );
- face->root.style_name = style_name;
-
- /* finally, select the named instance */
- error = mm->set_var_design( cffface,
- mm_var->num_axis,
- named_style->coords );
- if ( error )
- goto Exit;
- }
+ if ( var )
+ var->metrics_adjust( cffface );
}
}
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
@@ -876,7 +868,8 @@
cffface->height = (FT_Short)( ( cffface->units_per_EM * 12 ) / 10 );
if ( cffface->height < cffface->ascender - cffface->descender )
- cffface->height = (FT_Short)( cffface->ascender - cffface->descender );
+ cffface->height = (FT_Short)( cffface->ascender -
+ cffface->descender );
cffface->underline_position =
(FT_Short)( dict->underline_position >> 16 );
@@ -884,27 +877,32 @@
(FT_Short)( dict->underline_thickness >> 16 );
/* retrieve font family & style name */
- cffface->family_name = cff_index_get_name(
- cff,
- (FT_UInt)( face_index & 0xFFFF ) );
+ if ( dict->family_name )
+ {
+ char* family_name;
+
+
+ family_name = cff_index_get_sid_string( cff, dict->family_name );
+ if ( family_name )
+ cffface->family_name = cff_strcpy( memory, family_name );
+ }
+
+ if ( !cffface->family_name )
+ {
+ cffface->family_name = cff_index_get_name(
+ cff,
+ (FT_UInt)( face_index & 0xFFFF ) );
+ if ( cffface->family_name )
+ remove_subset_prefix( cffface->family_name );
+ }
+
if ( cffface->family_name )
{
char* full = cff_index_get_sid_string( cff,
dict->full_name );
char* fullp = full;
char* family = cffface->family_name;
- char* family_name = NULL;
-
- remove_subset_prefix( cffface->family_name );
-
- if ( dict->family_name )
- {
- family_name = cff_index_get_sid_string( cff,
- dict->family_name );
- if ( family_name )
- family = family_name;
- }
/* We try to extract the style name from the full name. */
/* We need to ignore spaces and dashes during the search. */
@@ -1159,16 +1157,16 @@
FT_LOCAL_DEF( FT_Error )
cff_driver_init( FT_Module module ) /* CFF_Driver */
{
- CFF_Driver driver = (CFF_Driver)module;
+ PS_Driver driver = (PS_Driver)module;
FT_UInt32 seed;
/* set default property values, cf. `ftcffdrv.h' */
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
- driver->hinting_engine = FT_CFF_HINTING_FREETYPE;
+ driver->hinting_engine = FT_HINTING_FREETYPE;
#else
- driver->hinting_engine = FT_CFF_HINTING_ADOBE;
+ driver->hinting_engine = FT_HINTING_ADOBE;
#endif
driver->no_stem_darkening = TRUE;
diff --git a/thirdparty/freetype/src/cff/cffobjs.h b/thirdparty/freetype/src/cff/cffobjs.h
index 1dba694c53..616a25b3b5 100644
--- a/thirdparty/freetype/src/cff/cffobjs.h
+++ b/thirdparty/freetype/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
/* */
/* OpenType objects manager (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,111 +21,11 @@
#include <ft2build.h>
-#include FT_INTERNAL_OBJECTS_H
-#include "cfftypes.h"
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-#include FT_SERVICE_POSTSCRIPT_CMAPS_H
-#include FT_INTERNAL_POSTSCRIPT_HINTS_H
FT_BEGIN_HEADER
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CFF_Driver */
- /* */
- /* <Description> */
- /* A handle to an OpenType driver object. */
- /* */
- typedef struct CFF_DriverRec_* CFF_Driver;
-
- typedef TT_Face CFF_Face;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CFF_Size */
- /* */
- /* <Description> */
- /* A handle to an OpenType size object. */
- /* */
- typedef struct CFF_SizeRec_
- {
- FT_SizeRec root;
- FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
-
- } CFF_SizeRec, *CFF_Size;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CFF_GlyphSlot */
- /* */
- /* <Description> */
- /* A handle to an OpenType glyph slot object. */
- /* */
- typedef struct CFF_GlyphSlotRec_
- {
- FT_GlyphSlotRec root;
-
- FT_Bool hint;
- FT_Bool scaled;
-
- FT_Fixed x_scale;
- FT_Fixed y_scale;
-
- } CFF_GlyphSlotRec, *CFF_GlyphSlot;
-
-
- /*************************************************************************/
- /* */
- /* <Type> */
- /* CFF_Internal */
- /* */
- /* <Description> */
- /* The interface to the `internal' field of `FT_Size'. */
- /* */
- typedef struct CFF_InternalRec_
- {
- PSH_Globals topfont;
- PSH_Globals subfonts[CFF_MAX_CID_FONTS];
-
- } CFF_InternalRec, *CFF_Internal;
-
-
- /*************************************************************************/
- /* */
- /* Subglyph transformation record. */
- /* */
- typedef struct CFF_Transform_
- {
- FT_Fixed xx, xy; /* transformation matrix coefficients */
- FT_Fixed yx, yy;
- FT_F26Dot6 ox, oy; /* offsets */
-
- } CFF_Transform;
-
-
- /***********************************************************************/
- /* */
- /* CFF driver class. */
- /* */
- typedef struct CFF_DriverRec_
- {
- FT_DriverRec root;
-
- FT_UInt hinting_engine;
- FT_Bool no_stem_darkening;
- FT_Int darken_params[8];
- FT_Int32 random_seed;
-
- } CFF_DriverRec;
-
-
FT_LOCAL( FT_Error )
cff_size_init( FT_Size size ); /* CFF_Size */
@@ -171,10 +71,10 @@ FT_BEGIN_HEADER
/* Driver functions */
/* */
FT_LOCAL( FT_Error )
- cff_driver_init( FT_Module module ); /* CFF_Driver */
+ cff_driver_init( FT_Module module ); /* PS_Driver */
FT_LOCAL( void )
- cff_driver_done( FT_Module module ); /* CFF_Driver */
+ cff_driver_done( FT_Module module ); /* PS_Driver */
FT_END_HEADER
diff --git a/thirdparty/freetype/src/cff/cffparse.c b/thirdparty/freetype/src/cff/cffparse.c
index 9d7bf6d22c..b9611cf548 100644
--- a/thirdparty/freetype/src/cff/cffparse.c
+++ b/thirdparty/freetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (body) */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,10 +21,10 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include "cfferrs.h"
#include "cffpic.h"
-#include "cffgload.h"
#include "cffload.h"
@@ -949,7 +949,9 @@
goto Exit;
}
- FT_TRACE4(( " %d values blended\n", numBlends ));
+ FT_TRACE4(( " %d value%s blended\n",
+ numBlends,
+ numBlends == 1 ? "" : "s" ));
error = cff_blend_doBlend( subFont, parser, numBlends );
@@ -1299,9 +1301,14 @@
FT_Byte* start,
FT_Byte* limit )
{
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ PSAux_Service psaux;
+#endif
+
FT_Byte* p = start;
FT_Error error = FT_Err_Ok;
FT_Library library = parser->library;
+
FT_UNUSED( library );
@@ -1388,10 +1395,16 @@
cff_rec.top_font.font_dict.num_axes = parser->num_axes;
decoder.cff = &cff_rec;
- error = cff_decoder_parse_charstrings( &decoder,
- charstring_base,
- charstring_len,
- 1 );
+ psaux = (PSAux_Service)FT_Get_Module_Interface( library, "psaux" );
+ if ( !psaux )
+ {
+ FT_ERROR(( "cff_parser_run: cannot access `psaux' module\n" ));
+ error = FT_THROW( Missing_Module );
+ goto Exit;
+ }
+
+ error = psaux->cff_decoder_funcs->parse_charstrings_old(
+ &decoder, charstring_base, charstring_len, 1 );
/* Now copy the stack data in the temporary decoder object, */
/* converting it back to charstring number representations */
diff --git a/thirdparty/freetype/src/cff/cffparse.h b/thirdparty/freetype/src/cff/cffparse.h
index 83d1bba45f..8a8caeca44 100644
--- a/thirdparty/freetype/src/cff/cffparse.h
+++ b/thirdparty/freetype/src/cff/cffparse.h
@@ -4,7 +4,7 @@
/* */
/* CFF token stream parser (specification) */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,7 +21,7 @@
#include <ft2build.h>
-#include "cfftypes.h"
+#include FT_INTERNAL_CFF_TYPES_H
#include FT_INTERNAL_OBJECTS_H
diff --git a/thirdparty/freetype/src/cff/cffpic.c b/thirdparty/freetype/src/cff/cffpic.c
index 4e9ba12b3f..08b74c7cf2 100644
--- a/thirdparty/freetype/src/cff/cffpic.c
+++ b/thirdparty/freetype/src/cff/cffpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/cffpic.h b/thirdparty/freetype/src/cff/cffpic.h
index 5db39cd627..8ba4203a8d 100644
--- a/thirdparty/freetype/src/cff/cffpic.h
+++ b/thirdparty/freetype/src/cff/cffpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for cff module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,7 +22,6 @@
#include FT_INTERNAL_PIC_H
-
#ifndef FT_CONFIG_OPTION_PIC
#define CFF_SERVICE_PS_INFO_GET cff_service_ps_info
@@ -34,6 +33,7 @@
#define CFF_SERVICES_GET cff_services
#define CFF_SERVICE_MULTI_MASTERS_GET cff_service_multi_masters
#define CFF_SERVICE_METRICS_VAR_GET cff_service_metrics_variations
+#define CFF_SERVICE_CFF_LOAD_GET cff_service_cff_load
#define CFF_CMAP_ENCODING_CLASS_REC_GET cff_cmap_encoding_class_rec
#define CFF_CMAP_UNICODE_CLASS_REC_GET cff_cmap_unicode_class_rec
#define CFF_FIELD_HANDLERS_GET cff_field_handlers
@@ -65,6 +65,7 @@ FT_BEGIN_HEADER
FT_Service_PropertiesRec cff_service_properties;
FT_Service_MultiMastersRec cff_service_multi_masters;
FT_Service_MetricsVariationsRec cff_service_metrics_variations;
+ FT_Service_CFFLoadRec cff_service_cff_load;
FT_CMap_ClassRec cff_cmap_encoding_class_rec;
FT_CMap_ClassRec cff_cmap_unicode_class_rec;
@@ -92,6 +93,8 @@ FT_BEGIN_HEADER
( GET_PIC( library )->cff_service_multi_masters )
#define CFF_SERVICE_METRICS_VAR_GET \
( GET_PIC( library )->cff_service_metrics_variations )
+#define CFF_SERVICE_CFF_LOAD_GET \
+ ( GET_PIC( library )->cff_service_cff_load )
#define CFF_CMAP_ENCODING_CLASS_REC_GET \
( GET_PIC( library )->cff_cmap_encoding_class_rec )
#define CFF_CMAP_UNICODE_CLASS_REC_GET \
diff --git a/thirdparty/freetype/src/cff/cfftoken.h b/thirdparty/freetype/src/cff/cfftoken.h
index 3222e933f1..fec1ca20bd 100644
--- a/thirdparty/freetype/src/cff/cfftoken.h
+++ b/thirdparty/freetype/src/cff/cfftoken.h
@@ -4,7 +4,7 @@
/* */
/* CFF token definitions (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cff/module.mk b/thirdparty/freetype/src/cff/module.mk
index 2975aeed8c..8013d5dcab 100644
--- a/thirdparty/freetype/src/cff/module.mk
+++ b/thirdparty/freetype/src/cff/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cff/rules.mk b/thirdparty/freetype/src/cff/rules.mk
index 86840bfe3c..bce672927e 100644
--- a/thirdparty/freetype/src/cff/rules.mk
+++ b/thirdparty/freetype/src/cff/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -32,27 +32,14 @@ CFF_DRV_SRC := $(CFF_DIR)/cffcmap.c \
$(CFF_DIR)/cffload.c \
$(CFF_DIR)/cffobjs.c \
$(CFF_DIR)/cffparse.c \
- $(CFF_DIR)/cffpic.c \
- $(CFF_DIR)/cf2arrst.c \
- $(CFF_DIR)/cf2blues.c \
- $(CFF_DIR)/cf2error.c \
- $(CFF_DIR)/cf2font.c \
- $(CFF_DIR)/cf2ft.c \
- $(CFF_DIR)/cf2hints.c \
- $(CFF_DIR)/cf2intrp.c \
- $(CFF_DIR)/cf2read.c \
- $(CFF_DIR)/cf2stack.c
+ $(CFF_DIR)/cffpic.c
# CFF driver headers
#
CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \
$(CFF_DIR)/cfferrs.h \
- $(CFF_DIR)/cfftoken.h \
- $(CFF_DIR)/cfftypes.h \
- $(CFF_DIR)/cf2fixed.h \
- $(CFF_DIR)/cf2glue.h \
- $(CFF_DIR)/cf2types.h
+ $(CFF_DIR)/cfftoken.h
# CFF driver object(s)
diff --git a/thirdparty/freetype/src/cid/ciderrs.h b/thirdparty/freetype/src/cid/ciderrs.h
index 709dc8cd1e..a5a86e3fc6 100644
--- a/thirdparty/freetype/src/cid/ciderrs.h
+++ b/thirdparty/freetype/src/cid/ciderrs.h
@@ -4,7 +4,7 @@
/* */
/* CID error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidgload.c b/thirdparty/freetype/src/cid/cidgload.c
index b96c33334d..d14f9a2cc9 100644
--- a/thirdparty/freetype/src/cid/cidgload.c
+++ b/thirdparty/freetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,6 +24,10 @@
#include FT_OUTLINE_H
#include FT_INTERNAL_CALC_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_CFF_TYPES_H
+#include FT_DRIVER_H
+
#include "ciderrs.h"
@@ -52,9 +56,11 @@
FT_ULong glyph_length = 0;
PSAux_Service psaux = (PSAux_Service)face->psaux;
+ FT_Bool force_scaling = FALSE;
+
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- FT_Incremental_InterfaceRec *inc =
- face->root.internal->incremental_interface;
+ FT_Incremental_InterfaceRec *inc =
+ face->root.internal->incremental_interface;
#endif
@@ -169,9 +175,57 @@
if ( decoder->lenIV >= 0 )
psaux->t1_decrypt( charstring, glyph_length, 4330 );
- error = decoder->funcs.parse_charstrings(
- decoder, charstring + cs_offset,
- glyph_length - cs_offset );
+ /* choose which renderer to use */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ if ( ( (PS_Driver)FT_FACE_DRIVER( face ) )->hinting_engine ==
+ FT_HINTING_FREETYPE ||
+ decoder->builder.metrics_only )
+ error = psaux->t1_decoder_funcs->parse_charstrings_old(
+ decoder,
+ charstring + cs_offset,
+ glyph_length - cs_offset );
+#else
+ if ( decoder->builder.metrics_only )
+ error = psaux->t1_decoder_funcs->parse_metrics(
+ decoder,
+ charstring + cs_offset,
+ glyph_length - cs_offset );
+#endif
+ else
+ {
+ PS_Decoder psdecoder;
+ CFF_SubFontRec subfont;
+
+
+ psaux->ps_decoder_init( &psdecoder, decoder, TRUE );
+
+ psaux->t1_make_subfont( FT_FACE( face ),
+ &dict->private_dict,
+ &subfont );
+ psdecoder.current_subfont = &subfont;
+
+ error = psaux->t1_decoder_funcs->parse_charstrings(
+ &psdecoder,
+ charstring + cs_offset,
+ glyph_length - cs_offset );
+
+ /* Adobe's engine uses 16.16 numbers everywhere; */
+ /* as a consequence, glyphs larger than 2000ppem get rejected */
+ if ( FT_ERR_EQ( error, Glyph_Too_Big ) )
+ {
+ /* this time, we retry unhinted and scale up the glyph later on */
+ /* (the engine uses and sets the hardcoded value 0x10000 / 64 = */
+ /* 0x400 for both `x_scale' and `y_scale' in this case) */
+ ((CID_GlyphSlot)decoder->builder.glyph)->hint = FALSE;
+
+ force_scaling = TRUE;
+
+ error = psaux->t1_decoder_funcs->parse_charstrings(
+ &psdecoder,
+ charstring + cs_offset,
+ glyph_length - cs_offset );
+ }
+ }
}
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -200,6 +254,8 @@
Exit:
FT_FREE( charstring );
+ ((CID_GlyphSlot)decoder->builder.glyph)->scaled = force_scaling;
+
return error;
}
@@ -288,10 +344,12 @@
T1_DecoderRec decoder;
CID_Face face = (CID_Face)cidglyph->face;
FT_Bool hinting;
+ FT_Bool scaled;
PSAux_Service psaux = (PSAux_Service)face->psaux;
FT_Matrix font_matrix;
FT_Vector font_offset;
+ FT_Bool must_finish_decoder = FALSE;
if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
@@ -311,7 +369,10 @@
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
( load_flags & FT_LOAD_NO_HINTING ) == 0 );
+ scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
+ glyph->hint = hinting;
+ glyph->scaled = scaled;
cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;
error = psaux->t1_decoder_funcs->init( &decoder,
@@ -329,6 +390,8 @@
/* TODO: initialize decoder.len_buildchar and decoder.buildchar */
/* if we ever support CID-keyed multiple master fonts */
+ must_finish_decoder = TRUE;
+
/* set up the decoder */
decoder.builder.no_recurse = FT_BOOL(
( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ) );
@@ -337,12 +400,18 @@
if ( error )
goto Exit;
+ /* copy flags back for forced scaling */
+ hinting = glyph->hint;
+ scaled = glyph->scaled;
+
font_matrix = decoder.font_matrix;
font_offset = decoder.font_offset;
/* save new glyph tables */
psaux->t1_decoder_funcs->done( &decoder );
+ must_finish_decoder = FALSE;
+
/* now set the metrics -- this is rather simple, as */
/* the left side bearing is the xMin, and the top side */
/* bearing the yMax */
@@ -410,7 +479,7 @@
metrics->vertAdvance += font_offset.y;
}
- if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
+ if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || scaled )
{
/* scale the outline and the metrics */
FT_Int n;
@@ -451,6 +520,10 @@
}
Exit:
+
+ if ( must_finish_decoder )
+ psaux->t1_decoder_funcs->done( &decoder );
+
return error;
}
diff --git a/thirdparty/freetype/src/cid/cidgload.h b/thirdparty/freetype/src/cid/cidgload.h
index 7f816b5bc7..4811852ae4 100644
--- a/thirdparty/freetype/src/cid/cidgload.h
+++ b/thirdparty/freetype/src/cid/cidgload.h
@@ -4,7 +4,7 @@
/* */
/* OpenType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidload.c b/thirdparty/freetype/src/cid/cidload.c
index ff0722110d..27cd09b3c3 100644
--- a/thirdparty/freetype/src/cid/cidload.c
+++ b/thirdparty/freetype/src/cid/cidload.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidload.h b/thirdparty/freetype/src/cid/cidload.h
index 45a0e6df25..3f8bd08620 100644
--- a/thirdparty/freetype/src/cid/cidload.h
+++ b/thirdparty/freetype/src/cid/cidload.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 font loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidobjs.c b/thirdparty/freetype/src/cid/cidobjs.c
index ceda8ff97f..77afe1c875 100644
--- a/thirdparty/freetype/src/cid/cidobjs.c
+++ b/thirdparty/freetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,6 +26,7 @@
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+#include FT_DRIVER_H
#include "ciderrs.h"
@@ -463,9 +464,42 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- cid_driver_init( FT_Module driver )
+ cid_driver_init( FT_Module module )
{
- FT_UNUSED( driver );
+ PS_Driver driver = (PS_Driver)module;
+
+ FT_UInt32 seed;
+
+
+ /* set default property values, cf. `ftt1drv.h' */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ driver->hinting_engine = FT_HINTING_FREETYPE;
+#else
+ driver->hinting_engine = FT_HINTING_ADOBE;
+#endif
+
+ driver->no_stem_darkening = TRUE;
+
+ driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;
+ driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;
+ driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;
+ driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;
+ driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;
+ driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;
+ driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
+ driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
+
+ /* compute random seed from some memory addresses */
+ seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&module ^
+ (FT_Offset)(char*)module->memory );
+ seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
+
+ driver->random_seed = (FT_Int32)seed;
+ if ( driver->random_seed < 0 )
+ driver->random_seed = -driver->random_seed;
+ else if ( driver->random_seed == 0 )
+ driver->random_seed = 123456789;
return FT_Err_Ok;
}
diff --git a/thirdparty/freetype/src/cid/cidobjs.h b/thirdparty/freetype/src/cid/cidobjs.h
index 8bcf886e10..0221f017dd 100644
--- a/thirdparty/freetype/src/cid/cidobjs.h
+++ b/thirdparty/freetype/src/cid/cidobjs.h
@@ -4,7 +4,7 @@
/* */
/* CID objects manager (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidparse.c b/thirdparty/freetype/src/cid/cidparse.c
index 007609bbdf..b1c7f3cb2c 100644
--- a/thirdparty/freetype/src/cid/cidparse.c
+++ b/thirdparty/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidparse.h b/thirdparty/freetype/src/cid/cidparse.h
index 20bebb942b..61602f7674 100644
--- a/thirdparty/freetype/src/cid/cidparse.h
+++ b/thirdparty/freetype/src/cid/cidparse.h
@@ -4,7 +4,7 @@
/* */
/* CID-keyed Type1 parser (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidriver.c b/thirdparty/freetype/src/cid/cidriver.c
index bb611a961e..d9faf353ea 100644
--- a/thirdparty/freetype/src/cid/cidriver.c
+++ b/thirdparty/freetype/src/cid/cidriver.c
@@ -4,7 +4,7 @@
/* */
/* CID driver interface (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,6 +20,7 @@
#include "cidriver.h"
#include "cidgload.h"
#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_POSTSCRIPT_PROPS_H
#include "ciderrs.h"
@@ -27,6 +28,10 @@
#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
#include FT_SERVICE_CID_H
+#include FT_SERVICE_PROPERTIES_H
+#include FT_DRIVER_H
+
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
/*************************************************************************/
@@ -168,6 +173,18 @@
/*
+ * PROPERTY SERVICE
+ *
+ */
+
+ FT_DEFINE_SERVICE_PROPERTIESREC(
+ cid_service_properties,
+
+ (FT_Properties_SetFunc)ps_property_set, /* set_property */
+ (FT_Properties_GetFunc)ps_property_get ) /* get_property */
+
+
+ /*
* SERVICE LIST
*
*/
@@ -178,6 +195,7 @@
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info },
{ FT_SERVICE_ID_CID, &cid_service_cid_info },
+ { FT_SERVICE_ID_PROPERTIES, &cid_service_properties },
{ NULL, NULL }
};
@@ -200,7 +218,7 @@
FT_MODULE_FONT_DRIVER |
FT_MODULE_DRIVER_SCALABLE |
FT_MODULE_DRIVER_HAS_HINTER,
- sizeof ( FT_DriverRec ),
+ sizeof ( PS_DriverRec ),
"t1cid", /* module name */
0x10000L, /* version 1.0 of driver */
diff --git a/thirdparty/freetype/src/cid/cidriver.h b/thirdparty/freetype/src/cid/cidriver.h
index 76640c57ba..59d9ded901 100644
--- a/thirdparty/freetype/src/cid/cidriver.h
+++ b/thirdparty/freetype/src/cid/cidriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level CID driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/cidtoken.h b/thirdparty/freetype/src/cid/cidtoken.h
index 653cc5586e..b0e2dac6aa 100644
--- a/thirdparty/freetype/src/cid/cidtoken.h
+++ b/thirdparty/freetype/src/cid/cidtoken.h
@@ -4,7 +4,7 @@
/* */
/* CID token definitions (specification only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/cid/module.mk b/thirdparty/freetype/src/cid/module.mk
index b30b8679b9..9010e339a4 100644
--- a/thirdparty/freetype/src/cid/module.mk
+++ b/thirdparty/freetype/src/cid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cid/rules.mk b/thirdparty/freetype/src/cid/rules.mk
index fcddd92eca..94333bda06 100644
--- a/thirdparty/freetype/src/cid/rules.mk
+++ b/thirdparty/freetype/src/cid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/cid/type1cid.c b/thirdparty/freetype/src/cid/type1cid.c
index 93e6f810db..61770e3f1e 100644
--- a/thirdparty/freetype/src/cid/type1cid.c
+++ b/thirdparty/freetype/src/cid/type1cid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType OpenType driver component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/gxvalid/README b/thirdparty/freetype/src/gxvalid/README
index 200f66cb12..af8128e0e7 100644
--- a/thirdparty/freetype/src/gxvalid/README
+++ b/thirdparty/freetype/src/gxvalid/README
@@ -287,11 +287,11 @@ gxvalid: TrueType GX validator
4-5. invalid feature number (117/183)
-------------------------------------
- The GX/AAT extension can include 255 different layout features, but
- popular layout features are predefined (see
- http://developer.apple.com/fonts/Registry/index.html). Some fonts
- include feature numbers which are incompatible with the predefined
- feature registry.
+ The GX/AAT extension can include 255 different layout features,
+ but popular layout features are predefined (see
+ https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html).
+ Some fonts include feature numbers which are incompatible with the
+ predefined feature registry.
In our survey, there are 140 fonts including `feat' table.
@@ -518,7 +518,7 @@ gxvalid: TrueType GX validator
------------------------------------------------------------------------
-Copyright 2004-2017 by
+Copyright 2004-2018 by
suzuki toshiya, Masatake YAMATO, Red hat K.K.,
David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.c b/thirdparty/freetype/src/gxvalid/gxvalid.c
index da485141d3..d0577a247e 100644
--- a/thirdparty/freetype/src/gxvalid/gxvalid.c
+++ b/thirdparty/freetype/src/gxvalid/gxvalid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType validator for TrueTypeGX/AAT tables (body only). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvalid.h b/thirdparty/freetype/src/gxvalid/gxvalid.h
index 78116ef85a..19f0379982 100644
--- a/thirdparty/freetype/src/gxvalid/gxvalid.h
+++ b/thirdparty/freetype/src/gxvalid/gxvalid.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT table validation (specification only). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvbsln.c b/thirdparty/freetype/src/gxvalid/gxvbsln.c
index 81dff7304d..c367d38483 100644
--- a/thirdparty/freetype/src/gxvalid/gxvbsln.c
+++ b/thirdparty/freetype/src/gxvalid/gxvbsln.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT bsln table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.c b/thirdparty/freetype/src/gxvalid/gxvcommn.c
index db0a91ea74..b96601108b 100644
--- a/thirdparty/freetype/src/gxvalid/gxvcommn.c
+++ b/thirdparty/freetype/src/gxvalid/gxvcommn.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common tables validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvcommn.h b/thirdparty/freetype/src/gxvalid/gxvcommn.h
index 10b1c800f0..8e4ff9cafc 100644
--- a/thirdparty/freetype/src/gxvalid/gxvcommn.h
+++ b/thirdparty/freetype/src/gxvalid/gxvcommn.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common tables validation (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxverror.h b/thirdparty/freetype/src/gxvalid/gxverror.h
index 80a2b8a262..d1151258a9 100644
--- a/thirdparty/freetype/src/gxvalid/gxverror.h
+++ b/thirdparty/freetype/src/gxvalid/gxverror.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT validation module error codes (specification only). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.c b/thirdparty/freetype/src/gxvalid/gxvfeat.c
index 2e3ec6f9be..2c805d1d11 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfeat.c
+++ b/thirdparty/freetype/src/gxvalid/gxvfeat.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT feat table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfeat.h b/thirdparty/freetype/src/gxvalid/gxvfeat.h
index 8c0e847eb7..2d943806c1 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfeat.h
+++ b/thirdparty/freetype/src/gxvalid/gxvfeat.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT feat table validation (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvfgen.c b/thirdparty/freetype/src/gxvalid/gxvfgen.c
index 8cc08cd9c3..840c0f3524 100644
--- a/thirdparty/freetype/src/gxvalid/gxvfgen.c
+++ b/thirdparty/freetype/src/gxvalid/gxvfgen.c
@@ -5,7 +5,7 @@
/* Generate feature registry data for gxv `feat' validator. */
/* This program is derived from gxfeatreg.c in gxlayout. */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* This file may only be used, */
@@ -21,7 +21,7 @@
/* gxfeatreg.c */
/* */
/* Database of font features pre-defined by Apple Computer, Inc. */
-/* http://developer.apple.com/fonts/Registry/ */
+/* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html */
/* (body). */
/* */
/* Copyright 2003 by */
diff --git a/thirdparty/freetype/src/gxvalid/gxvjust.c b/thirdparty/freetype/src/gxvalid/gxvjust.c
index c8cfd83eac..00c4293195 100644
--- a/thirdparty/freetype/src/gxvalid/gxvjust.c
+++ b/thirdparty/freetype/src/gxvalid/gxvjust.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT just table validation (body). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvkern.c b/thirdparty/freetype/src/gxvalid/gxvkern.c
index 9f9037387d..9c0efd7a4f 100644
--- a/thirdparty/freetype/src/gxvalid/gxvkern.c
+++ b/thirdparty/freetype/src/gxvalid/gxvkern.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT kern table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvlcar.c b/thirdparty/freetype/src/gxvalid/gxvlcar.c
index 775d5229f2..0f261a9ace 100644
--- a/thirdparty/freetype/src/gxvalid/gxvlcar.c
+++ b/thirdparty/freetype/src/gxvalid/gxvlcar.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT lcar table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.c b/thirdparty/freetype/src/gxvalid/gxvmod.c
index 84e9275baf..1a3c862927 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmod.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType's TrueTypeGX/AAT validation module implementation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmod.h b/thirdparty/freetype/src/gxvalid/gxvmod.h
index df25e60cb2..745c62e105 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmod.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmod.h
@@ -5,7 +5,7 @@
/* FreeType's TrueTypeGX/AAT validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.c b/thirdparty/freetype/src/gxvalid/gxvmort.c
index 184a6317c0..b361cb2b9d 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT mort table validation (body). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort.h b/thirdparty/freetype/src/gxvalid/gxvmort.h
index d0543adcc5..d8030645e9 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmort.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common definition for mort table (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort0.c b/thirdparty/freetype/src/gxvalid/gxvmort0.c
index a75fad7768..95cf53d5eb 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort0.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort0.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort1.c b/thirdparty/freetype/src/gxvalid/gxvmort1.c
index 361ef2262d..a7683a17b0 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort1.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort1.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort2.c b/thirdparty/freetype/src/gxvalid/gxvmort2.c
index c17e51e323..c23c2775a1 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort2.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort2.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort4.c b/thirdparty/freetype/src/gxvalid/gxvmort4.c
index 041bab369f..9d21a5fc29 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort4.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort4.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmort5.c b/thirdparty/freetype/src/gxvalid/gxvmort5.c
index 4751eceaa0..42cb428aa8 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmort5.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmort5.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT mort table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.c b/thirdparty/freetype/src/gxvalid/gxvmorx.c
index 2bb4f3b8b1..9fd6e6b971 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT morx table validation (body). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx.h b/thirdparty/freetype/src/gxvalid/gxvmorx.h
index 20cec58672..6d9925e92b 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx.h
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx.h
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT common definition for morx table (specification). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx0.c b/thirdparty/freetype/src/gxvalid/gxvmorx0.c
index e0a0a92438..302261b7fa 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx0.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx0.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type0 (Indic Script Rearrangement) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx1.c b/thirdparty/freetype/src/gxvalid/gxvmorx1.c
index 9afebdbfa8..890ca74b1d 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx1.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx1.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type1 (Contextual Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx2.c b/thirdparty/freetype/src/gxvalid/gxvmorx2.c
index 3a60cf68a4..3135031d45 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx2.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx2.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type2 (Ligature Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx4.c b/thirdparty/freetype/src/gxvalid/gxvmorx4.c
index 29555685af..1e2397b0c5 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx4.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx4.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvmorx5.c b/thirdparty/freetype/src/gxvalid/gxvmorx5.c
index 05c11417ef..db4f9290c8 100644
--- a/thirdparty/freetype/src/gxvalid/gxvmorx5.c
+++ b/thirdparty/freetype/src/gxvalid/gxvmorx5.c
@@ -5,7 +5,7 @@
/* TrueTypeGX/AAT morx table validation */
/* body for type5 (Contextual Glyph Insertion) subtable. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvopbd.c b/thirdparty/freetype/src/gxvalid/gxvopbd.c
index 11580d8b2a..e2c167ea59 100644
--- a/thirdparty/freetype/src/gxvalid/gxvopbd.c
+++ b/thirdparty/freetype/src/gxvalid/gxvopbd.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT opbd table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvprop.c b/thirdparty/freetype/src/gxvalid/gxvprop.c
index 7d398b7e66..a67b6bdd00 100644
--- a/thirdparty/freetype/src/gxvalid/gxvprop.c
+++ b/thirdparty/freetype/src/gxvalid/gxvprop.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT prop table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/gxvtrak.c b/thirdparty/freetype/src/gxvalid/gxvtrak.c
index dd49825565..d501b5014b 100644
--- a/thirdparty/freetype/src/gxvalid/gxvtrak.c
+++ b/thirdparty/freetype/src/gxvalid/gxvtrak.c
@@ -4,7 +4,7 @@
/* */
/* TrueTypeGX/AAT trak table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
diff --git a/thirdparty/freetype/src/gxvalid/module.mk b/thirdparty/freetype/src/gxvalid/module.mk
index 7f87e10812..b64879dcee 100644
--- a/thirdparty/freetype/src/gxvalid/module.mk
+++ b/thirdparty/freetype/src/gxvalid/module.mk
@@ -2,7 +2,7 @@
# FreeType 2 gxvalid module definition
#
-# Copyright 2004-2017 by
+# Copyright 2004-2018 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/thirdparty/freetype/src/gxvalid/rules.mk b/thirdparty/freetype/src/gxvalid/rules.mk
index 10ec08c5b0..3a17c030a6 100644
--- a/thirdparty/freetype/src/gxvalid/rules.mk
+++ b/thirdparty/freetype/src/gxvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2017 by
+# Copyright 2004-2018 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/thirdparty/freetype/src/gzip/ftgzip.c b/thirdparty/freetype/src/gzip/ftgzip.c
index c487786d99..f8011c2dd8 100644
--- a/thirdparty/freetype/src/gzip/ftgzip.c
+++ b/thirdparty/freetype/src/gzip/ftgzip.c
@@ -8,7 +8,7 @@
/* parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/gzip/rules.mk b/thirdparty/freetype/src/gzip/rules.mk
index bc7d5fa631..1a2e48bebd 100644
--- a/thirdparty/freetype/src/gzip/rules.mk
+++ b/thirdparty/freetype/src/gzip/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2017 by
+# Copyright 2002-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/lzw/ftlzw.c b/thirdparty/freetype/src/lzw/ftlzw.c
index 941f6cef4c..cb46f93c68 100644
--- a/thirdparty/freetype/src/lzw/ftlzw.c
+++ b/thirdparty/freetype/src/lzw/ftlzw.c
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* Albert Chin-A-Young. */
/* */
/* based on code in `src/gzip/ftgzip.c' */
diff --git a/thirdparty/freetype/src/lzw/ftzopen.c b/thirdparty/freetype/src/lzw/ftzopen.c
index 486c546c14..2b868ba9f2 100644
--- a/thirdparty/freetype/src/lzw/ftzopen.c
+++ b/thirdparty/freetype/src/lzw/ftzopen.c
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/lzw/ftzopen.h b/thirdparty/freetype/src/lzw/ftzopen.h
index a108862c0a..4fd267eb90 100644
--- a/thirdparty/freetype/src/lzw/ftzopen.h
+++ b/thirdparty/freetype/src/lzw/ftzopen.h
@@ -8,7 +8,7 @@
/* be used to parse compressed PCF fonts, as found with many X11 server */
/* distributions. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/lzw/rules.mk b/thirdparty/freetype/src/lzw/rules.mk
index e7bf68a065..18933c41c2 100644
--- a/thirdparty/freetype/src/lzw/rules.mk
+++ b/thirdparty/freetype/src/lzw/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2017 by
+# Copyright 2004-2018 by
# Albert Chin-A-Young.
#
# based on `src/lzw/rules.mk'
diff --git a/thirdparty/freetype/src/otvalid/module.mk b/thirdparty/freetype/src/otvalid/module.mk
index 5ee1265db8..34f3dab32f 100644
--- a/thirdparty/freetype/src/otvalid/module.mk
+++ b/thirdparty/freetype/src/otvalid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2017 by
+# Copyright 2004-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/otvalid/otvalid.c b/thirdparty/freetype/src/otvalid/otvalid.c
index 312751a1f4..4423ca1012 100644
--- a/thirdparty/freetype/src/otvalid/otvalid.c
+++ b/thirdparty/freetype/src/otvalid/otvalid.c
@@ -4,7 +4,7 @@
/* */
/* FreeType validator for OpenType tables (body only). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvalid.h b/thirdparty/freetype/src/otvalid/otvalid.h
index f2969ccccc..d7801abae5 100644
--- a/thirdparty/freetype/src/otvalid/otvalid.h
+++ b/thirdparty/freetype/src/otvalid/otvalid.h
@@ -4,7 +4,7 @@
/* */
/* OpenType table validation (specification only). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvbase.c b/thirdparty/freetype/src/otvalid/otvbase.c
index 3adad8439c..a01d45c707 100644
--- a/thirdparty/freetype/src/otvalid/otvbase.c
+++ b/thirdparty/freetype/src/otvalid/otvbase.c
@@ -4,7 +4,7 @@
/* */
/* OpenType BASE table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -284,22 +284,41 @@
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
FT_UInt table_size;
+ FT_UShort version;
OTV_OPTIONAL_TABLE( HorizAxis );
OTV_OPTIONAL_TABLE( VertAxis );
+ OTV_OPTIONAL_TABLE32( itemVarStore );
+
otvalid->root = ftvalid;
FT_TRACE3(( "validating BASE table\n" ));
OTV_INIT;
- OTV_LIMIT_CHECK( 6 );
+ OTV_LIMIT_CHECK( 4 );
- if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
+ if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
FT_INVALID_FORMAT;
- table_size = 6;
+ version = FT_NEXT_USHORT( p ); /* minorVersion */
+
+ table_size = 8;
+ switch ( version )
+ {
+ case 0:
+ OTV_LIMIT_CHECK( 4 );
+ break;
+
+ case 1:
+ OTV_LIMIT_CHECK( 8 );
+ table_size += 4;
+ break;
+
+ default:
+ FT_INVALID_FORMAT;
+ }
OTV_OPTIONAL_OFFSET( HorizAxis );
OTV_SIZE_CHECK( HorizAxis );
@@ -311,6 +330,14 @@
if ( VertAxis )
otv_Axis_validate( table + VertAxis, otvalid );
+ if ( version > 0 )
+ {
+ OTV_OPTIONAL_OFFSET32( itemVarStore );
+ OTV_SIZE_CHECK32( itemVarStore );
+ if ( itemVarStore )
+ OTV_TRACE(( " [omitting itemVarStore validation]\n" )); /* XXX */
+ }
+
FT_TRACE4(( "\n" ));
}
diff --git a/thirdparty/freetype/src/otvalid/otvcommn.c b/thirdparty/freetype/src/otvalid/otvcommn.c
index 3407d2ad4a..0ccfb03c08 100644
--- a/thirdparty/freetype/src/otvalid/otvcommn.c
+++ b/thirdparty/freetype/src/otvalid/otvcommn.c
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -313,19 +313,26 @@
OTV_NAME_ENTER( "Device" );
- OTV_LIMIT_CHECK( 8 );
+ OTV_LIMIT_CHECK( 6 );
StartSize = FT_NEXT_USHORT( p );
EndSize = FT_NEXT_USHORT( p );
DeltaFormat = FT_NEXT_USHORT( p );
- if ( DeltaFormat < 1 || DeltaFormat > 3 )
- FT_INVALID_FORMAT;
+ if ( DeltaFormat == 0x8000U )
+ {
+ /* VariationIndex, nothing to do */
+ }
+ else
+ {
+ if ( DeltaFormat < 1 || DeltaFormat > 3 )
+ FT_INVALID_FORMAT;
- if ( EndSize < StartSize )
- FT_INVALID_DATA;
+ if ( EndSize < StartSize )
+ FT_INVALID_DATA;
- count = EndSize - StartSize + 1;
- OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
+ count = EndSize - StartSize + 1;
+ OTV_LIMIT_CHECK( ( 1 << DeltaFormat ) * count / 8 ); /* DeltaValue */
+ }
OTV_EXIT;
}
@@ -347,7 +354,7 @@
OTV_Validator otvalid )
{
FT_Bytes p = table;
- FT_UInt LookupType, SubTableCount;
+ FT_UInt LookupType, LookupFlag, SubTableCount;
OTV_Validate_Func validate;
@@ -355,7 +362,7 @@
OTV_LIMIT_CHECK( 6 );
LookupType = FT_NEXT_USHORT( p );
- p += 2; /* skip LookupFlag */
+ LookupFlag = FT_NEXT_USHORT( p );
SubTableCount = FT_NEXT_USHORT( p );
OTV_TRACE(( " (type %d)\n", LookupType ));
@@ -373,6 +380,9 @@
for ( ; SubTableCount > 0; SubTableCount-- )
validate( table + FT_NEXT_USHORT( p ), otvalid );
+ if ( LookupFlag & 0x10 )
+ OTV_LIMIT_CHECK( 2 ); /* MarkFilteringSet */
+
OTV_EXIT;
}
diff --git a/thirdparty/freetype/src/otvalid/otvcommn.h b/thirdparty/freetype/src/otvalid/otvcommn.h
index 10a603ebb9..a392784cf1 100644
--- a/thirdparty/freetype/src/otvalid/otvcommn.h
+++ b/thirdparty/freetype/src/otvalid/otvcommn.h
@@ -4,7 +4,7 @@
/* */
/* OpenType common tables validation (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -67,29 +67,38 @@ FT_BEGIN_HEADER
#undef FT_INVALID_
-#define FT_INVALID_( _error ) \
+#define FT_INVALID_( _error ) \
ft_validator_error( otvalid->root, FT_THROW( _error ) )
#define OTV_OPTIONAL_TABLE( _table ) FT_UShort _table; \
FT_Bytes _table ## _p
+#define OTV_OPTIONAL_TABLE32( _table ) FT_ULong _table; \
+ FT_Bytes _table ## _p
+
#define OTV_OPTIONAL_OFFSET( _offset ) \
FT_BEGIN_STMNT \
_offset ## _p = p; \
_offset = FT_NEXT_USHORT( p ); \
FT_END_STMNT
-#define OTV_LIMIT_CHECK( _count ) \
- FT_BEGIN_STMNT \
+#define OTV_OPTIONAL_OFFSET32( _offset ) \
+ FT_BEGIN_STMNT \
+ _offset ## _p = p; \
+ _offset = FT_NEXT_ULONG( p ); \
+ FT_END_STMNT
+
+#define OTV_LIMIT_CHECK( _count ) \
+ FT_BEGIN_STMNT \
if ( p + (_count) > otvalid->root->limit ) \
- FT_INVALID_TOO_SHORT; \
+ FT_INVALID_TOO_SHORT; \
FT_END_STMNT
#define OTV_SIZE_CHECK( _size ) \
FT_BEGIN_STMNT \
if ( _size > 0 && _size < table_size ) \
{ \
- if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \
+ if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \
FT_INVALID_OFFSET; \
else \
{ \
@@ -102,12 +111,33 @@ FT_BEGIN_HEADER
" set to zero.\n" \
"\n", #_size )); \
\
- /* always assume 16bit entities */ \
_size = pp[0] = pp[1] = 0; \
} \
} \
FT_END_STMNT
+#define OTV_SIZE_CHECK32( _size ) \
+ FT_BEGIN_STMNT \
+ if ( _size > 0 && _size < table_size ) \
+ { \
+ if ( otvalid->root->level == FT_VALIDATE_PARANOID ) \
+ FT_INVALID_OFFSET; \
+ else \
+ { \
+ /* strip off `const' */ \
+ FT_Byte* pp = (FT_Byte*)_size ## _p; \
+ \
+ \
+ FT_TRACE3(( "\n" \
+ "Invalid offset to optional table `%s'" \
+ " set to zero.\n" \
+ "\n", #_size )); \
+ \
+ _size = pp[0] = pp[1] = pp[2] = pp[3] = 0; \
+ } \
+ } \
+ FT_END_STMNT
+
#define OTV_NAME_(x) #x
#define OTV_NAME(x) OTV_NAME_(x)
@@ -146,11 +176,11 @@ FT_BEGIN_HEADER
#define OTV_INIT otvalid->debug_indent = 0
-#define OTV_ENTER \
- FT_BEGIN_STMNT \
- otvalid->debug_indent += 2; \
- FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \
- FT_TRACE4(( "%s table\n", \
+#define OTV_ENTER \
+ FT_BEGIN_STMNT \
+ otvalid->debug_indent += 2; \
+ FT_TRACE4(( "%*.s", otvalid->debug_indent, 0 )); \
+ FT_TRACE4(( "%s table\n", \
otvalid->debug_function_name[otvalid->nesting_level] )); \
FT_END_STMNT
diff --git a/thirdparty/freetype/src/otvalid/otverror.h b/thirdparty/freetype/src/otvalid/otverror.h
index 699903987c..2fcf42e387 100644
--- a/thirdparty/freetype/src/otvalid/otverror.h
+++ b/thirdparty/freetype/src/otvalid/otverror.h
@@ -4,7 +4,7 @@
/* */
/* OpenType validation module error codes (specification only). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgdef.c b/thirdparty/freetype/src/otvalid/otvgdef.c
index 27b9a69ca8..08f3171541 100644
--- a/thirdparty/freetype/src/otvalid/otvgdef.c
+++ b/thirdparty/freetype/src/otvalid/otvgdef.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GDEF table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -68,7 +68,7 @@
OTV_LIMIT_CHECK( GlyphCount * 2 );
otvalid->nesting_level++;
- func = otvalid->func[otvalid->nesting_level];
+ func = otvalid->func[otvalid->nesting_level];
otvalid->extra1 = 0;
for ( ; GlyphCount > 0; GlyphCount-- )
@@ -136,6 +136,40 @@
/*************************************************************************/
/*************************************************************************/
/***** *****/
+ /***** MARK GLYPH SETS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ static void
+ otv_MarkGlyphSets_validate( FT_Bytes table,
+ OTV_Validator otvalid )
+ {
+ FT_Bytes p = table;
+ FT_UInt MarkGlyphSetCount;
+
+
+ OTV_NAME_ENTER( "MarkGlyphSets" );
+
+ p += 2; /* skip Format */
+
+ OTV_LIMIT_CHECK( 2 );
+ MarkGlyphSetCount = FT_NEXT_USHORT( p );
+
+ OTV_TRACE(( " (MarkGlyphSetCount = %d)\n", MarkGlyphSetCount ));
+
+ OTV_LIMIT_CHECK( MarkGlyphSetCount * 4 ); /* CoverageOffsets */
+
+ for ( ; MarkGlyphSetCount > 0; MarkGlyphSetCount-- )
+ otv_Coverage_validate( table + FT_NEXT_ULONG( p ), otvalid, -1 );
+
+ OTV_EXIT;
+ }
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
/***** GDEF TABLE *****/
/***** *****/
/*************************************************************************/
@@ -152,14 +186,18 @@
{
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
- FT_Bytes p = table;
+ FT_Bytes p = table;
FT_UInt table_size;
- FT_Bool need_MarkAttachClassDef;
+ FT_UShort version;
+ FT_Bool need_MarkAttachClassDef = 1;
OTV_OPTIONAL_TABLE( GlyphClassDef );
OTV_OPTIONAL_TABLE( AttachListOffset );
OTV_OPTIONAL_TABLE( LigCaretListOffset );
OTV_OPTIONAL_TABLE( MarkAttachClassDef );
+ OTV_OPTIONAL_TABLE( MarkGlyphSetsDef );
+
+ OTV_OPTIONAL_TABLE32( itemVarStore );
otvalid->root = ftvalid;
@@ -167,24 +205,49 @@
FT_TRACE3(( "validating GDEF table\n" ));
OTV_INIT;
- OTV_LIMIT_CHECK( 12 );
+ OTV_LIMIT_CHECK( 4 );
- if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
+ if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
FT_INVALID_FORMAT;
- /* MarkAttachClassDef has been added to the OpenType */
- /* specification without increasing GDEF's version, */
- /* so we use this ugly hack to find out whether the */
- /* table is needed actually. */
+ version = FT_NEXT_USHORT( p ); /* minorVersion */
- need_MarkAttachClassDef = FT_BOOL(
- otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) ||
- otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) );
+ table_size = 10;
+ switch ( version )
+ {
+ case 0:
+ /* MarkAttachClassDef has been added to the OpenType */
+ /* specification without increasing GDEF's version, */
+ /* so we use this ugly hack to find out whether the */
+ /* table is needed actually. */
+
+ need_MarkAttachClassDef = FT_BOOL(
+ otv_GSUBGPOS_have_MarkAttachmentType_flag( gsub ) ||
+ otv_GSUBGPOS_have_MarkAttachmentType_flag( gpos ) );
+
+ if ( need_MarkAttachClassDef )
+ {
+ OTV_LIMIT_CHECK( 8 );
+ table_size += 2;
+ }
+ else
+ OTV_LIMIT_CHECK( 6 ); /* OpenType < 1.2 */
- if ( need_MarkAttachClassDef )
- table_size = 12; /* OpenType >= 1.2 */
- else
- table_size = 10; /* OpenType < 1.2 */
+ break;
+
+ case 2:
+ OTV_LIMIT_CHECK( 10 );
+ table_size += 4;
+ break;
+
+ case 3:
+ OTV_LIMIT_CHECK( 14 );
+ table_size += 8;
+ break;
+
+ default:
+ FT_INVALID_FORMAT;
+ }
otvalid->glyph_count = glyph_count;
@@ -217,6 +280,22 @@
otv_ClassDef_validate( table + MarkAttachClassDef, otvalid );
}
+ if ( version > 0 )
+ {
+ OTV_OPTIONAL_OFFSET( MarkGlyphSetsDef );
+ OTV_SIZE_CHECK( MarkGlyphSetsDef );
+ if ( MarkGlyphSetsDef )
+ otv_MarkGlyphSets_validate( table + MarkGlyphSetsDef, otvalid );
+ }
+
+ if ( version > 2 )
+ {
+ OTV_OPTIONAL_OFFSET32( itemVarStore );
+ OTV_SIZE_CHECK32( itemVarStore );
+ if ( itemVarStore )
+ OTV_TRACE(( " [omitting itemVarStore validation]\n" )); /* XXX */
+ }
+
FT_TRACE4(( "\n" ));
}
diff --git a/thirdparty/freetype/src/otvalid/otvgpos.c b/thirdparty/freetype/src/otvalid/otvgpos.c
index 0fbcc2077c..696b35cae6 100644
--- a/thirdparty/freetype/src/otvalid/otvgpos.c
+++ b/thirdparty/freetype/src/otvalid/otvgpos.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validation (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -130,7 +130,7 @@
otv_MarkArray_validate( table + Array1, otvalid );
otvalid->nesting_level++;
- func = otvalid->func[otvalid->nesting_level];
+ func = otvalid->func[otvalid->nesting_level];
otvalid->extra1 = ClassCount;
func( table + Array2, otvalid );
@@ -218,10 +218,6 @@
OTV_LIMIT_CHECK( 2 );
OTV_OPTIONAL_OFFSET( device );
- /* XXX: this value is usually too small, especially if the current */
- /* ValueRecord is part of an array -- getting the correct table */
- /* size is probably not worth the trouble */
-
table_size = p - otvalid->extra3;
OTV_SIZE_CHECK( device );
@@ -271,7 +267,7 @@
case 3:
{
- FT_UInt table_size;
+ FT_UInt table_size;
OTV_OPTIONAL_TABLE( XDeviceTable );
OTV_OPTIONAL_TABLE( YDeviceTable );
@@ -426,6 +422,8 @@
/*************************************************************************/
/*************************************************************************/
+ /* sets otvalid->extra3 (pointer to base table) */
+
static void
otv_PairSet_validate( FT_Bytes table,
FT_UInt format1,
@@ -438,6 +436,8 @@
OTV_NAME_ENTER( "PairSet" );
+ otvalid->extra3 = table;
+
OTV_LIMIT_CHECK( 2 );
PairValueCount = FT_NEXT_USHORT( p );
@@ -483,8 +483,6 @@
OTV_TRACE(( " (format %d)\n", PosFormat ));
- otvalid->extra3 = table;
-
switch ( PosFormat )
{
case 1: /* PairPosFormat1 */
@@ -537,7 +535,9 @@
otv_ClassDef_validate( table + ClassDef2, otvalid );
OTV_LIMIT_CHECK( ClassCount1 * ClassCount2 *
- ( len_value1 + len_value2 ) );
+ ( len_value1 + len_value2 ) );
+
+ otvalid->extra3 = table;
/* Class1Record */
for ( ; ClassCount1 > 0; ClassCount1-- )
@@ -985,20 +985,42 @@
{
OTV_ValidatorRec validrec;
OTV_Validator otvalid = &validrec;
- FT_Bytes p = table;
+ FT_Bytes p = table;
+ FT_UInt table_size;
+ FT_UShort version;
FT_UInt ScriptList, FeatureList, LookupList;
+ OTV_OPTIONAL_TABLE32( featureVariations );
+
otvalid->root = ftvalid;
FT_TRACE3(( "validating GPOS table\n" ));
OTV_INIT;
- OTV_LIMIT_CHECK( 10 );
+ OTV_LIMIT_CHECK( 4 );
- if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
+ if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
FT_INVALID_FORMAT;
+ version = FT_NEXT_USHORT( p ); /* minorVersion */
+
+ table_size = 10;
+ switch ( version )
+ {
+ case 0:
+ OTV_LIMIT_CHECK( 6 );
+ break;
+
+ case 1:
+ OTV_LIMIT_CHECK( 10 );
+ table_size += 4;
+ break;
+
+ default:
+ FT_INVALID_FORMAT;
+ }
+
ScriptList = FT_NEXT_USHORT( p );
FeatureList = FT_NEXT_USHORT( p );
LookupList = FT_NEXT_USHORT( p );
@@ -1014,6 +1036,14 @@
otv_ScriptList_validate( table + ScriptList, table + FeatureList,
otvalid );
+ if ( version > 0 )
+ {
+ OTV_OPTIONAL_OFFSET32( featureVariations );
+ OTV_SIZE_CHECK32( featureVariations );
+ if ( featureVariations )
+ OTV_TRACE(( " [omitting featureVariations validation]\n" )); /* XXX */
+ }
+
FT_TRACE4(( "\n" ));
}
diff --git a/thirdparty/freetype/src/otvalid/otvgpos.h b/thirdparty/freetype/src/otvalid/otvgpos.h
index 99b0ad3915..95f9ac3ee8 100644
--- a/thirdparty/freetype/src/otvalid/otvgpos.h
+++ b/thirdparty/freetype/src/otvalid/otvgpos.h
@@ -4,7 +4,7 @@
/* */
/* OpenType GPOS table validator (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvgsub.c b/thirdparty/freetype/src/otvalid/otvgsub.c
index f9bd8dc5d8..d35ea67f30 100644
--- a/thirdparty/freetype/src/otvalid/otvgsub.c
+++ b/thirdparty/freetype/src/otvalid/otvgsub.c
@@ -4,7 +4,7 @@
/* */
/* OpenType GSUB table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -552,18 +552,40 @@
OTV_ValidatorRec otvalidrec;
OTV_Validator otvalid = &otvalidrec;
FT_Bytes p = table;
+ FT_UInt table_size;
+ FT_UShort version;
FT_UInt ScriptList, FeatureList, LookupList;
+ OTV_OPTIONAL_TABLE32( featureVariations );
+
otvalid->root = ftvalid;
FT_TRACE3(( "validating GSUB table\n" ));
OTV_INIT;
- OTV_LIMIT_CHECK( 10 );
+ OTV_LIMIT_CHECK( 4 );
+
+ if ( FT_NEXT_USHORT( p ) != 1 ) /* majorVersion */
+ FT_INVALID_FORMAT;
+
+ version = FT_NEXT_USHORT( p ); /* minorVersion */
+
+ table_size = 10;
+ switch ( version )
+ {
+ case 0:
+ OTV_LIMIT_CHECK( 6 );
+ break;
+
+ case 1:
+ OTV_LIMIT_CHECK( 10 );
+ table_size += 4;
+ break;
- if ( FT_NEXT_ULONG( p ) != 0x10000UL ) /* Version */
+ default:
FT_INVALID_FORMAT;
+ }
ScriptList = FT_NEXT_USHORT( p );
FeatureList = FT_NEXT_USHORT( p );
@@ -580,6 +602,14 @@
otv_ScriptList_validate( table + ScriptList, table + FeatureList,
otvalid );
+ if ( version > 0 )
+ {
+ OTV_OPTIONAL_OFFSET32( featureVariations );
+ OTV_SIZE_CHECK32( featureVariations );
+ if ( featureVariations )
+ OTV_TRACE(( " [omitting featureVariations validation]\n" )); /* XXX */
+ }
+
FT_TRACE4(( "\n" ));
}
diff --git a/thirdparty/freetype/src/otvalid/otvjstf.c b/thirdparty/freetype/src/otvalid/otvjstf.c
index 57a38f95c9..94d4af90f6 100644
--- a/thirdparty/freetype/src/otvalid/otvjstf.c
+++ b/thirdparty/freetype/src/otvalid/otvjstf.c
@@ -4,7 +4,7 @@
/* */
/* OpenType JSTF table validation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvmath.c b/thirdparty/freetype/src/otvalid/otvmath.c
index a14d369700..b9800f60a2 100644
--- a/thirdparty/freetype/src/otvalid/otvmath.c
+++ b/thirdparty/freetype/src/otvalid/otvmath.c
@@ -4,7 +4,7 @@
/* */
/* OpenType MATH table validation (body). */
/* */
-/* Copyright 2007-2017 by */
+/* Copyright 2007-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Written by George Williams. */
diff --git a/thirdparty/freetype/src/otvalid/otvmod.c b/thirdparty/freetype/src/otvalid/otvmod.c
index 35ffc43d3a..89ee449d16 100644
--- a/thirdparty/freetype/src/otvalid/otvmod.c
+++ b/thirdparty/freetype/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType's OpenType validation module implementation (body). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/otvmod.h b/thirdparty/freetype/src/otvalid/otvmod.h
index 30d401ddca..6917bccee5 100644
--- a/thirdparty/freetype/src/otvalid/otvmod.h
+++ b/thirdparty/freetype/src/otvalid/otvmod.h
@@ -5,7 +5,7 @@
/* FreeType's OpenType validation module implementation */
/* (specification). */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/otvalid/rules.mk b/thirdparty/freetype/src/otvalid/rules.mk
index 10329a96ea..d4fc723740 100644
--- a/thirdparty/freetype/src/otvalid/rules.mk
+++ b/thirdparty/freetype/src/otvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2004-2017 by
+# Copyright 2004-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pcf/pcfdrivr.c b/thirdparty/freetype/src/pcf/pcfdrivr.c
index 169f75e950..0119d94853 100644
--- a/thirdparty/freetype/src/pcf/pcfdrivr.c
+++ b/thirdparty/freetype/src/pcf/pcfdrivr.c
@@ -50,7 +50,7 @@ THE SOFTWARE.
#include FT_SERVICE_BDF_H
#include FT_SERVICE_FONT_FORMAT_H
#include FT_SERVICE_PROPERTIES_H
-#include FT_PCF_DRIVER_H
+#include FT_DRIVER_H
/*************************************************************************/
diff --git a/thirdparty/freetype/src/pcf/pcfread.c b/thirdparty/freetype/src/pcf/pcfread.c
index da216b05f4..537da0dc79 100644
--- a/thirdparty/freetype/src/pcf/pcfread.c
+++ b/thirdparty/freetype/src/pcf/pcfread.c
@@ -840,7 +840,7 @@ THE SOFTWARE.
FT_TRACE4(( "pcf_get_bitmaps:\n"
" format: 0x%lX\n"
" (%s, %s,\n"
- " padding=%d bits, scanning=%d bits)\n",
+ " padding=%d bit%s, scanning=%d bit%s)\n",
format,
PCF_BYTE_ORDER( format ) == MSBFirst
? "most significant byte first"
@@ -849,7 +849,9 @@ THE SOFTWARE.
? "most significant bit first"
: "least significant bit first",
8 << PCF_GLYPH_PAD_INDEX( format ),
- 8 << PCF_SCAN_UNIT_INDEX( format ) ));
+ ( 8 << PCF_GLYPH_PAD_INDEX( format ) ) == 1 ? "" : "s",
+ 8 << PCF_SCAN_UNIT_INDEX( format ),
+ ( 8 << PCF_SCAN_UNIT_INDEX( format ) ) == 1 ? "" : "s" ));
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return FT_THROW( Invalid_File_Format );
diff --git a/thirdparty/freetype/src/pfr/module.mk b/thirdparty/freetype/src/pfr/module.mk
index 7b84da9708..27fec8e5f6 100644
--- a/thirdparty/freetype/src/pfr/module.mk
+++ b/thirdparty/freetype/src/pfr/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2017 by
+# Copyright 2002-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pfr/pfr.c b/thirdparty/freetype/src/pfr/pfr.c
index 4f31f5d9bc..1760882fcd 100644
--- a/thirdparty/freetype/src/pfr/pfr.c
+++ b/thirdparty/freetype/src/pfr/pfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver component. */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrcmap.c b/thirdparty/freetype/src/pfr/pfrcmap.c
index 1d6b15be48..60643780a1 100644
--- a/thirdparty/freetype/src/pfr/pfrcmap.c
+++ b/thirdparty/freetype/src/pfr/pfrcmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrcmap.h b/thirdparty/freetype/src/pfr/pfrcmap.h
index 957bf65b4c..c70a0c83c5 100644
--- a/thirdparty/freetype/src/pfr/pfrcmap.h
+++ b/thirdparty/freetype/src/pfr/pfrcmap.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR cmap handling (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.c b/thirdparty/freetype/src/pfr/pfrdrivr.c
index 195cdb76ac..6c7e50128a 100644
--- a/thirdparty/freetype/src/pfr/pfrdrivr.c
+++ b/thirdparty/freetype/src/pfr/pfrdrivr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR driver interface (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrdrivr.h b/thirdparty/freetype/src/pfr/pfrdrivr.h
index b81d56017e..cab852789b 100644
--- a/thirdparty/freetype/src/pfr/pfrdrivr.h
+++ b/thirdparty/freetype/src/pfr/pfrdrivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type PFR driver interface (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrerror.h b/thirdparty/freetype/src/pfr/pfrerror.h
index ef044e32c9..7027c818e8 100644
--- a/thirdparty/freetype/src/pfr/pfrerror.h
+++ b/thirdparty/freetype/src/pfr/pfrerror.h
@@ -4,7 +4,7 @@
/* */
/* PFR error codes (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrgload.c b/thirdparty/freetype/src/pfr/pfrgload.c
index 93f5fc7090..b7990196b6 100644
--- a/thirdparty/freetype/src/pfr/pfrgload.c
+++ b/thirdparty/freetype/src/pfr/pfrgload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -756,8 +756,10 @@
count = glyph->num_subs - old_count;
- FT_TRACE4(( "compound glyph with %d elements (offset %lu):\n",
- count, offset ));
+ FT_TRACE4(( "compound glyph with %d element%s (offset %lu):\n",
+ count,
+ count == 1 ? "" : "s",
+ offset ));
/* now, load each individual glyph */
for ( n = 0; n < count; n++ )
@@ -810,7 +812,9 @@
/* proceed to next sub-glyph */
}
- FT_TRACE4(( "end compound glyph with %d elements\n", count ));
+ FT_TRACE4(( "end compound glyph with %d element%s\n",
+ count,
+ count == 1 ? "" : "s" ));
}
else
{
diff --git a/thirdparty/freetype/src/pfr/pfrgload.h b/thirdparty/freetype/src/pfr/pfrgload.h
index 6612323871..01f48d7706 100644
--- a/thirdparty/freetype/src/pfr/pfrgload.h
+++ b/thirdparty/freetype/src/pfr/pfrgload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR glyph loader (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrload.c b/thirdparty/freetype/src/pfr/pfrload.c
index 4f84165828..2776da462a 100644
--- a/thirdparty/freetype/src/pfr/pfrload.c
+++ b/thirdparty/freetype/src/pfr/pfrload.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrload.h b/thirdparty/freetype/src/pfr/pfrload.h
index f9475ae062..36e809a762 100644
--- a/thirdparty/freetype/src/pfr/pfrload.h
+++ b/thirdparty/freetype/src/pfr/pfrload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrobjs.c b/thirdparty/freetype/src/pfr/pfrobjs.c
index 514af8050d..737b97b5ff 100644
--- a/thirdparty/freetype/src/pfr/pfrobjs.c
+++ b/thirdparty/freetype/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrobjs.h b/thirdparty/freetype/src/pfr/pfrobjs.h
index d6ad6562df..59c709f58d 100644
--- a/thirdparty/freetype/src/pfr/pfrobjs.h
+++ b/thirdparty/freetype/src/pfr/pfrobjs.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrsbit.c b/thirdparty/freetype/src/pfr/pfrsbit.c
index 54e7d0e6cc..ba909ddca7 100644
--- a/thirdparty/freetype/src/pfr/pfrsbit.c
+++ b/thirdparty/freetype/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrsbit.h b/thirdparty/freetype/src/pfr/pfrsbit.h
index fc270f50a8..07b27bc06c 100644
--- a/thirdparty/freetype/src/pfr/pfrsbit.h
+++ b/thirdparty/freetype/src/pfr/pfrsbit.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR bitmap loader (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/pfrtypes.h b/thirdparty/freetype/src/pfr/pfrtypes.h
index c3d542c209..058d6aadc9 100644
--- a/thirdparty/freetype/src/pfr/pfrtypes.h
+++ b/thirdparty/freetype/src/pfr/pfrtypes.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR data structures (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pfr/rules.mk b/thirdparty/freetype/src/pfr/rules.mk
index 9940f62286..3acb795696 100644
--- a/thirdparty/freetype/src/pfr/rules.mk
+++ b/thirdparty/freetype/src/pfr/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2017 by
+# Copyright 2002-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psaux/afmparse.c b/thirdparty/freetype/src/psaux/afmparse.c
index ff2cc8cf08..0c33d5949b 100644
--- a/thirdparty/freetype/src/psaux/afmparse.c
+++ b/thirdparty/freetype/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/afmparse.h b/thirdparty/freetype/src/psaux/afmparse.h
index cd2beb7804..86f852a247 100644
--- a/thirdparty/freetype/src/psaux/afmparse.h
+++ b/thirdparty/freetype/src/psaux/afmparse.h
@@ -4,7 +4,7 @@
/* */
/* AFM parser (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/cffdecode.c b/thirdparty/freetype/src/psaux/cffdecode.c
new file mode 100644
index 0000000000..80d622c0e1
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/cffdecode.c
@@ -0,0 +1,2370 @@
+/***************************************************************************/
+/* */
+/* cffdecode.c */
+/* */
+/* PostScript CFF (Type 2) decoding routines (body). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_SERVICE_H
+#include FT_SERVICE_CFF_TABLE_LOAD_H
+
+#include "cffdecode.h"
+#include "psobjs.h"
+
+#include "psauxerr.h"
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_cffdecode
+
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
+ typedef enum CFF_Operator_
+ {
+ cff_op_unknown = 0,
+
+ cff_op_rmoveto,
+ cff_op_hmoveto,
+ cff_op_vmoveto,
+
+ cff_op_rlineto,
+ cff_op_hlineto,
+ cff_op_vlineto,
+
+ cff_op_rrcurveto,
+ cff_op_hhcurveto,
+ cff_op_hvcurveto,
+ cff_op_rcurveline,
+ cff_op_rlinecurve,
+ cff_op_vhcurveto,
+ cff_op_vvcurveto,
+
+ cff_op_flex,
+ cff_op_hflex,
+ cff_op_hflex1,
+ cff_op_flex1,
+
+ cff_op_endchar,
+
+ cff_op_hstem,
+ cff_op_vstem,
+ cff_op_hstemhm,
+ cff_op_vstemhm,
+
+ cff_op_hintmask,
+ cff_op_cntrmask,
+ cff_op_dotsection, /* deprecated, acts as no-op */
+
+ cff_op_abs,
+ cff_op_add,
+ cff_op_sub,
+ cff_op_div,
+ cff_op_neg,
+ cff_op_random,
+ cff_op_mul,
+ cff_op_sqrt,
+
+ cff_op_blend,
+
+ cff_op_drop,
+ cff_op_exch,
+ cff_op_index,
+ cff_op_roll,
+ cff_op_dup,
+
+ cff_op_put,
+ cff_op_get,
+ cff_op_store,
+ cff_op_load,
+
+ cff_op_and,
+ cff_op_or,
+ cff_op_not,
+ cff_op_eq,
+ cff_op_ifelse,
+
+ cff_op_callsubr,
+ cff_op_callgsubr,
+ cff_op_return,
+
+ /* Type 1 opcodes: invalid but seen in real life */
+ cff_op_hsbw,
+ cff_op_closepath,
+ cff_op_callothersubr,
+ cff_op_pop,
+ cff_op_seac,
+ cff_op_sbw,
+ cff_op_setcurrentpoint,
+
+ /* do not remove */
+ cff_op_max
+
+ } CFF_Operator;
+
+
+#define CFF_COUNT_CHECK_WIDTH 0x80
+#define CFF_COUNT_EXACT 0x40
+#define CFF_COUNT_CLEAR_STACK 0x20
+
+ /* count values which have the `CFF_COUNT_CHECK_WIDTH' flag set are */
+ /* used for checking the width and requested numbers of arguments */
+ /* only; they are set to zero afterwards */
+
+ /* the other two flags are informative only and unused currently */
+
+ static const FT_Byte cff_argument_counts[] =
+ {
+ 0, /* unknown */
+
+ 2 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, /* rmoveto */
+ 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,
+ 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT,
+
+ 0 | CFF_COUNT_CLEAR_STACK, /* rlineto */
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+
+ 0 | CFF_COUNT_CLEAR_STACK, /* rrcurveto */
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+ 0 | CFF_COUNT_CLEAR_STACK,
+
+ 13, /* flex */
+ 7,
+ 9,
+ 11,
+
+ 0 | CFF_COUNT_CHECK_WIDTH, /* endchar */
+
+ 2 | CFF_COUNT_CHECK_WIDTH, /* hstem */
+ 2 | CFF_COUNT_CHECK_WIDTH,
+ 2 | CFF_COUNT_CHECK_WIDTH,
+ 2 | CFF_COUNT_CHECK_WIDTH,
+
+ 0 | CFF_COUNT_CHECK_WIDTH, /* hintmask */
+ 0 | CFF_COUNT_CHECK_WIDTH, /* cntrmask */
+ 0, /* dotsection */
+
+ 1, /* abs */
+ 2,
+ 2,
+ 2,
+ 1,
+ 0,
+ 2,
+ 1,
+
+ 1, /* blend */
+
+ 1, /* drop */
+ 2,
+ 1,
+ 2,
+ 1,
+
+ 2, /* put */
+ 1,
+ 4,
+ 3,
+
+ 2, /* and */
+ 2,
+ 1,
+ 2,
+ 4,
+
+ 1, /* callsubr */
+ 1,
+ 0,
+
+ 2, /* hsbw */
+ 0,
+ 0,
+ 0,
+ 5, /* seac */
+ 4, /* sbw */
+ 2 /* setcurrentpoint */
+ };
+
+
+ static FT_Error
+ cff_operator_seac( CFF_Decoder* decoder,
+ FT_Pos asb,
+ FT_Pos adx,
+ FT_Pos ady,
+ FT_Int bchar,
+ FT_Int achar )
+ {
+ FT_Error error;
+ CFF_Builder* builder = &decoder->builder;
+ FT_Int bchar_index, achar_index;
+ TT_Face face = decoder->builder.face;
+ FT_Vector left_bearing, advance;
+ FT_Byte* charstring;
+ FT_ULong charstring_len;
+ FT_Pos glyph_width;
+
+
+ if ( decoder->seac )
+ {
+ FT_ERROR(( "cff_operator_seac: invalid nested seac\n" ));
+ return FT_THROW( Syntax_Error );
+ }
+
+ adx += decoder->builder.left_bearing.x;
+ ady += decoder->builder.left_bearing.y;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ /* Incremental fonts don't necessarily have valid charsets. */
+ /* They use the character code, not the glyph index, in this case. */
+ if ( face->root.internal->incremental_interface )
+ {
+ bchar_index = bchar;
+ achar_index = achar;
+ }
+ else
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ CFF_Font cff = (CFF_Font)(face->extra.data);
+
+
+ bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );
+ achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar );
+ }
+
+ if ( bchar_index < 0 || achar_index < 0 )
+ {
+ FT_ERROR(( "cff_operator_seac:"
+ " invalid seac character code arguments\n" ));
+ return FT_THROW( Syntax_Error );
+ }
+
+ /* If we are trying to load a composite glyph, do not load the */
+ /* accent character and return the array of subglyphs. */
+ if ( builder->no_recurse )
+ {
+ FT_GlyphSlot glyph = (FT_GlyphSlot)builder->glyph;
+ FT_GlyphLoader loader = glyph->internal->loader;
+ FT_SubGlyph subg;
+
+
+ /* reallocate subglyph array if necessary */
+ error = FT_GlyphLoader_CheckSubGlyphs( loader, 2 );
+ if ( error )
+ goto Exit;
+
+ subg = loader->current.subglyphs;
+
+ /* subglyph 0 = base character */
+ subg->index = bchar_index;
+ subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES |
+ FT_SUBGLYPH_FLAG_USE_MY_METRICS;
+ subg->arg1 = 0;
+ subg->arg2 = 0;
+ subg++;
+
+ /* subglyph 1 = accent character */
+ subg->index = achar_index;
+ subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;
+ subg->arg1 = (FT_Int)( adx >> 16 );
+ subg->arg2 = (FT_Int)( ady >> 16 );
+
+ /* set up remaining glyph fields */
+ glyph->num_subglyphs = 2;
+ glyph->subglyphs = loader->base.subglyphs;
+ glyph->format = FT_GLYPH_FORMAT_COMPOSITE;
+
+ loader->current.num_subglyphs = 2;
+ }
+
+ FT_GlyphLoader_Prepare( builder->loader );
+
+ /* First load `bchar' in builder */
+ error = decoder->get_glyph_callback( face, (FT_UInt)bchar_index,
+ &charstring, &charstring_len );
+ if ( !error )
+ {
+ /* the seac operator must not be nested */
+ decoder->seac = TRUE;
+ error = cff_decoder_parse_charstrings( decoder, charstring,
+ charstring_len, 0 );
+ decoder->seac = FALSE;
+
+ decoder->free_glyph_callback( face, &charstring, charstring_len );
+
+ if ( error )
+ goto Exit;
+ }
+
+ /* Save the left bearing, advance and glyph width of the base */
+ /* character as they will be erased by the next load. */
+
+ left_bearing = builder->left_bearing;
+ advance = builder->advance;
+ glyph_width = decoder->glyph_width;
+
+ builder->left_bearing.x = 0;
+ builder->left_bearing.y = 0;
+
+ builder->pos_x = adx - asb;
+ builder->pos_y = ady;
+
+ /* Now load `achar' on top of the base outline. */
+ error = decoder->get_glyph_callback( face, (FT_UInt)achar_index,
+ &charstring, &charstring_len );
+ if ( !error )
+ {
+ /* the seac operator must not be nested */
+ decoder->seac = TRUE;
+ error = cff_decoder_parse_charstrings( decoder, charstring,
+ charstring_len, 0 );
+ decoder->seac = FALSE;
+
+ decoder->free_glyph_callback( face, &charstring, charstring_len );
+
+ if ( error )
+ goto Exit;
+ }
+
+ /* Restore the left side bearing, advance and glyph width */
+ /* of the base character. */
+ builder->left_bearing = left_bearing;
+ builder->advance = advance;
+ decoder->glyph_width = glyph_width;
+
+ builder->pos_x = 0;
+ builder->pos_y = 0;
+
+ Exit:
+ return error;
+ }
+
+#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********** *********/
+ /********** *********/
+ /********** GENERIC CHARSTRING PARSING *********/
+ /********** *********/
+ /********** *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* cff_compute_bias */
+ /* */
+ /* <Description> */
+ /* Computes the bias value in dependence of the number of glyph */
+ /* subroutines. */
+ /* */
+ /* <Input> */
+ /* in_charstring_type :: The `CharstringType' value of the top DICT */
+ /* dictionary. */
+ /* */
+ /* num_subrs :: The number of glyph subroutines. */
+ /* */
+ /* <Return> */
+ /* The bias value. */
+ static FT_Int
+ cff_compute_bias( FT_Int in_charstring_type,
+ FT_UInt num_subrs )
+ {
+ FT_Int result;
+
+
+ if ( in_charstring_type == 1 )
+ result = 0;
+ else if ( num_subrs < 1240 )
+ result = 107;
+ else if ( num_subrs < 33900U )
+ result = 1131;
+ else
+ result = 32768U;
+
+ return result;
+ }
+
+
+ FT_LOCAL_DEF( FT_Int )
+ cff_lookup_glyph_by_stdcharcode( CFF_Font cff,
+ FT_Int charcode )
+ {
+ FT_UInt n;
+ FT_UShort glyph_sid;
+
+ FT_Service_CFFLoad cffload;
+
+
+ /* CID-keyed fonts don't have glyph names */
+ if ( !cff->charset.sids )
+ return -1;
+
+ /* check range of standard char code */
+ if ( charcode < 0 || charcode > 255 )
+ return -1;
+
+#if 0
+ /* retrieve cffload from list of current modules */
+ FT_Service_CFFLoad cffload;
+
+
+ FT_FACE_FIND_GLOBAL_SERVICE( face, cffload, CFF_LOAD );
+ if ( !cffload )
+ {
+ FT_ERROR(( "cff_lookup_glyph_by_stdcharcode:"
+ " the `cffload' module is not available\n" ));
+ return FT_THROW( Unimplemented_Feature );
+ }
+#endif
+
+ cffload = (FT_Service_CFFLoad)cff->cffload;
+
+ /* Get code to SID mapping from `cff_standard_encoding'. */
+ glyph_sid = cffload->get_standard_encoding( (FT_UInt)charcode );
+
+ for ( n = 0; n < cff->num_glyphs; n++ )
+ {
+ if ( cff->charset.sids[n] == glyph_sid )
+ return (FT_Int)n;
+ }
+
+ return -1;
+ }
+
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* cff_decoder_parse_charstrings */
+ /* */
+ /* <Description> */
+ /* Parses a given Type 2 charstrings program. */
+ /* */
+ /* <InOut> */
+ /* decoder :: The current Type 1 decoder. */
+ /* */
+ /* <Input> */
+ /* charstring_base :: The base of the charstring stream. */
+ /* */
+ /* charstring_len :: The length in bytes of the charstring stream. */
+ /* */
+ /* in_dict :: Set to 1 if function is called from top or */
+ /* private DICT (needed for Multiple Master CFFs). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ cff_decoder_parse_charstrings( CFF_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len,
+ FT_Bool in_dict )
+ {
+ FT_Error error;
+ CFF_Decoder_Zone* zone;
+ FT_Byte* ip;
+ FT_Byte* limit;
+ CFF_Builder* builder = &decoder->builder;
+ FT_Pos x, y;
+ FT_Fixed* stack;
+ FT_Int charstring_type =
+ decoder->cff->top_font.font_dict.charstring_type;
+ FT_UShort num_designs =
+ decoder->cff->top_font.font_dict.num_designs;
+ FT_UShort num_axes =
+ decoder->cff->top_font.font_dict.num_axes;
+
+ T2_Hints_Funcs hinter;
+
+
+ /* set default width */
+ decoder->num_hints = 0;
+ decoder->read_width = 1;
+
+ /* initialize the decoder */
+ decoder->top = decoder->stack;
+ decoder->zone = decoder->zones;
+ zone = decoder->zones;
+ stack = decoder->top;
+
+ hinter = (T2_Hints_Funcs)builder->hints_funcs;
+
+ builder->path_begun = 0;
+
+ zone->base = charstring_base;
+ limit = zone->limit = charstring_base + charstring_len;
+ ip = zone->cursor = zone->base;
+
+ error = FT_Err_Ok;
+
+ x = builder->pos_x;
+ y = builder->pos_y;
+
+ /* begin hints recording session, if any */
+ if ( hinter )
+ hinter->open( hinter->hints );
+
+ /* now execute loop */
+ while ( ip < limit )
+ {
+ CFF_Operator op;
+ FT_Byte v;
+
+
+ /********************************************************************/
+ /* */
+ /* Decode operator or operand */
+ /* */
+ v = *ip++;
+ if ( v >= 32 || v == 28 )
+ {
+ FT_Int shift = 16;
+ FT_Int32 val;
+
+
+ /* this is an operand, push it on the stack */
+
+ /* if we use shifts, all computations are done with unsigned */
+ /* values; the conversion to a signed value is the last step */
+ if ( v == 28 )
+ {
+ if ( ip + 1 >= limit )
+ goto Syntax_Error;
+ val = (FT_Short)( ( (FT_UShort)ip[0] << 8 ) | ip[1] );
+ ip += 2;
+ }
+ else if ( v < 247 )
+ val = (FT_Int32)v - 139;
+ else if ( v < 251 )
+ {
+ if ( ip >= limit )
+ goto Syntax_Error;
+ val = ( (FT_Int32)v - 247 ) * 256 + *ip++ + 108;
+ }
+ else if ( v < 255 )
+ {
+ if ( ip >= limit )
+ goto Syntax_Error;
+ val = -( (FT_Int32)v - 251 ) * 256 - *ip++ - 108;
+ }
+ else
+ {
+ if ( ip + 3 >= limit )
+ goto Syntax_Error;
+ val = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
+ ( (FT_UInt32)ip[1] << 16 ) |
+ ( (FT_UInt32)ip[2] << 8 ) |
+ (FT_UInt32)ip[3] );
+ ip += 4;
+ if ( charstring_type == 2 )
+ shift = 0;
+ }
+ if ( decoder->top - stack >= CFF_MAX_OPERANDS )
+ goto Stack_Overflow;
+
+ val = (FT_Int32)( (FT_UInt32)val << shift );
+ *decoder->top++ = val;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( !( val & 0xFFFFL ) )
+ FT_TRACE4(( " %hd", (FT_Short)( (FT_UInt32)val >> 16 ) ));
+ else
+ FT_TRACE4(( " %.5f", val / 65536.0 ));
+#endif
+
+ }
+ else
+ {
+ /* The specification says that normally arguments are to be taken */
+ /* from the bottom of the stack. However, this seems not to be */
+ /* correct, at least for Acroread 7.0.8 on GNU/Linux: It pops the */
+ /* arguments similar to a PS interpreter. */
+
+ FT_Fixed* args = decoder->top;
+ FT_Int num_args = (FT_Int)( args - decoder->stack );
+ FT_Int req_args;
+
+
+ /* find operator */
+ op = cff_op_unknown;
+
+ switch ( v )
+ {
+ case 1:
+ op = cff_op_hstem;
+ break;
+ case 3:
+ op = cff_op_vstem;
+ break;
+ case 4:
+ op = cff_op_vmoveto;
+ break;
+ case 5:
+ op = cff_op_rlineto;
+ break;
+ case 6:
+ op = cff_op_hlineto;
+ break;
+ case 7:
+ op = cff_op_vlineto;
+ break;
+ case 8:
+ op = cff_op_rrcurveto;
+ break;
+ case 9:
+ op = cff_op_closepath;
+ break;
+ case 10:
+ op = cff_op_callsubr;
+ break;
+ case 11:
+ op = cff_op_return;
+ break;
+ case 12:
+ if ( ip >= limit )
+ goto Syntax_Error;
+ v = *ip++;
+
+ switch ( v )
+ {
+ case 0:
+ op = cff_op_dotsection;
+ break;
+ case 1: /* this is actually the Type1 vstem3 operator */
+ op = cff_op_vstem;
+ break;
+ case 2: /* this is actually the Type1 hstem3 operator */
+ op = cff_op_hstem;
+ break;
+ case 3:
+ op = cff_op_and;
+ break;
+ case 4:
+ op = cff_op_or;
+ break;
+ case 5:
+ op = cff_op_not;
+ break;
+ case 6:
+ op = cff_op_seac;
+ break;
+ case 7:
+ op = cff_op_sbw;
+ break;
+ case 8:
+ op = cff_op_store;
+ break;
+ case 9:
+ op = cff_op_abs;
+ break;
+ case 10:
+ op = cff_op_add;
+ break;
+ case 11:
+ op = cff_op_sub;
+ break;
+ case 12:
+ op = cff_op_div;
+ break;
+ case 13:
+ op = cff_op_load;
+ break;
+ case 14:
+ op = cff_op_neg;
+ break;
+ case 15:
+ op = cff_op_eq;
+ break;
+ case 16:
+ op = cff_op_callothersubr;
+ break;
+ case 17:
+ op = cff_op_pop;
+ break;
+ case 18:
+ op = cff_op_drop;
+ break;
+ case 20:
+ op = cff_op_put;
+ break;
+ case 21:
+ op = cff_op_get;
+ break;
+ case 22:
+ op = cff_op_ifelse;
+ break;
+ case 23:
+ op = cff_op_random;
+ break;
+ case 24:
+ op = cff_op_mul;
+ break;
+ case 26:
+ op = cff_op_sqrt;
+ break;
+ case 27:
+ op = cff_op_dup;
+ break;
+ case 28:
+ op = cff_op_exch;
+ break;
+ case 29:
+ op = cff_op_index;
+ break;
+ case 30:
+ op = cff_op_roll;
+ break;
+ case 33:
+ op = cff_op_setcurrentpoint;
+ break;
+ case 34:
+ op = cff_op_hflex;
+ break;
+ case 35:
+ op = cff_op_flex;
+ break;
+ case 36:
+ op = cff_op_hflex1;
+ break;
+ case 37:
+ op = cff_op_flex1;
+ break;
+ default:
+ FT_TRACE4(( " unknown op (12, %d)\n", v ));
+ break;
+ }
+ break;
+ case 13:
+ op = cff_op_hsbw;
+ break;
+ case 14:
+ op = cff_op_endchar;
+ break;
+ case 16:
+ op = cff_op_blend;
+ break;
+ case 18:
+ op = cff_op_hstemhm;
+ break;
+ case 19:
+ op = cff_op_hintmask;
+ break;
+ case 20:
+ op = cff_op_cntrmask;
+ break;
+ case 21:
+ op = cff_op_rmoveto;
+ break;
+ case 22:
+ op = cff_op_hmoveto;
+ break;
+ case 23:
+ op = cff_op_vstemhm;
+ break;
+ case 24:
+ op = cff_op_rcurveline;
+ break;
+ case 25:
+ op = cff_op_rlinecurve;
+ break;
+ case 26:
+ op = cff_op_vvcurveto;
+ break;
+ case 27:
+ op = cff_op_hhcurveto;
+ break;
+ case 29:
+ op = cff_op_callgsubr;
+ break;
+ case 30:
+ op = cff_op_vhcurveto;
+ break;
+ case 31:
+ op = cff_op_hvcurveto;
+ break;
+ default:
+ FT_TRACE4(( " unknown op (%d)\n", v ));
+ break;
+ }
+
+ if ( op == cff_op_unknown )
+ continue;
+
+ /* in Multiple Master CFFs, T2 charstrings can appear in */
+ /* dictionaries, but some operators are prohibited */
+ if ( in_dict )
+ {
+ switch ( op )
+ {
+ case cff_op_hstem:
+ case cff_op_vstem:
+ case cff_op_vmoveto:
+ case cff_op_rlineto:
+ case cff_op_hlineto:
+ case cff_op_vlineto:
+ case cff_op_rrcurveto:
+ case cff_op_hstemhm:
+ case cff_op_hintmask:
+ case cff_op_cntrmask:
+ case cff_op_rmoveto:
+ case cff_op_hmoveto:
+ case cff_op_vstemhm:
+ case cff_op_rcurveline:
+ case cff_op_rlinecurve:
+ case cff_op_vvcurveto:
+ case cff_op_hhcurveto:
+ case cff_op_vhcurveto:
+ case cff_op_hvcurveto:
+ case cff_op_hflex:
+ case cff_op_flex:
+ case cff_op_hflex1:
+ case cff_op_flex1:
+ case cff_op_callsubr:
+ case cff_op_callgsubr:
+ goto MM_Error;
+
+ default:
+ break;
+ }
+ }
+
+ /* check arguments */
+ req_args = cff_argument_counts[op];
+ if ( req_args & CFF_COUNT_CHECK_WIDTH )
+ {
+ if ( num_args > 0 && decoder->read_width )
+ {
+ /* If `nominal_width' is non-zero, the number is really a */
+ /* difference against `nominal_width'. Else, the number here */
+ /* is truly a width, not a difference against `nominal_width'. */
+ /* If the font does not set `nominal_width', then */
+ /* `nominal_width' defaults to zero, and so we can set */
+ /* `glyph_width' to `nominal_width' plus number on the stack */
+ /* -- for either case. */
+
+ FT_Int set_width_ok;
+
+
+ switch ( op )
+ {
+ case cff_op_hmoveto:
+ case cff_op_vmoveto:
+ set_width_ok = num_args & 2;
+ break;
+
+ case cff_op_hstem:
+ case cff_op_vstem:
+ case cff_op_hstemhm:
+ case cff_op_vstemhm:
+ case cff_op_rmoveto:
+ case cff_op_hintmask:
+ case cff_op_cntrmask:
+ set_width_ok = num_args & 1;
+ break;
+
+ case cff_op_endchar:
+ /* If there is a width specified for endchar, we either have */
+ /* 1 argument or 5 arguments. We like to argue. */
+ set_width_ok = in_dict
+ ? 0
+ : ( ( num_args == 5 ) || ( num_args == 1 ) );
+ break;
+
+ default:
+ set_width_ok = 0;
+ break;
+ }
+
+ if ( set_width_ok )
+ {
+ decoder->glyph_width = decoder->nominal_width +
+ ( stack[0] >> 16 );
+
+ if ( decoder->width_only )
+ {
+ /* we only want the advance width; stop here */
+ break;
+ }
+
+ /* Consumed an argument. */
+ num_args--;
+ }
+ }
+
+ decoder->read_width = 0;
+ req_args = 0;
+ }
+
+ req_args &= 0x000F;
+ if ( num_args < req_args )
+ goto Stack_Underflow;
+ args -= req_args;
+ num_args -= req_args;
+
+ /* At this point, `args' points to the first argument of the */
+ /* operand in case `req_args' isn't zero. Otherwise, we have */
+ /* to adjust `args' manually. */
+
+ /* Note that we only pop arguments from the stack which we */
+ /* really need and can digest so that we can continue in case */
+ /* of superfluous stack elements. */
+
+ switch ( op )
+ {
+ case cff_op_hstem:
+ case cff_op_vstem:
+ case cff_op_hstemhm:
+ case cff_op_vstemhm:
+ /* the number of arguments is always even here */
+ FT_TRACE4((
+ op == cff_op_hstem ? " hstem\n" :
+ ( op == cff_op_vstem ? " vstem\n" :
+ ( op == cff_op_hstemhm ? " hstemhm\n" : " vstemhm\n" ) ) ));
+
+ if ( hinter )
+ hinter->stems( hinter->hints,
+ ( op == cff_op_hstem || op == cff_op_hstemhm ),
+ num_args / 2,
+ args - ( num_args & ~1 ) );
+
+ decoder->num_hints += num_args / 2;
+ args = stack;
+ break;
+
+ case cff_op_hintmask:
+ case cff_op_cntrmask:
+ FT_TRACE4(( op == cff_op_hintmask ? " hintmask" : " cntrmask" ));
+
+ /* implement vstem when needed -- */
+ /* the specification doesn't say it, but this also works */
+ /* with the 'cntrmask' operator */
+ /* */
+ if ( num_args > 0 )
+ {
+ if ( hinter )
+ hinter->stems( hinter->hints,
+ 0,
+ num_args / 2,
+ args - ( num_args & ~1 ) );
+
+ decoder->num_hints += num_args / 2;
+ }
+
+ /* In a valid charstring there must be at least one byte */
+ /* after `hintmask' or `cntrmask' (e.g., for a `return' */
+ /* instruction). Additionally, there must be space for */
+ /* `num_hints' bits. */
+
+ if ( ( ip + ( ( decoder->num_hints + 7 ) >> 3 ) ) >= limit )
+ goto Syntax_Error;
+
+ if ( hinter )
+ {
+ if ( op == cff_op_hintmask )
+ hinter->hintmask( hinter->hints,
+ (FT_UInt)builder->current->n_points,
+ (FT_UInt)decoder->num_hints,
+ ip );
+ else
+ hinter->counter( hinter->hints,
+ (FT_UInt)decoder->num_hints,
+ ip );
+ }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_UInt maskbyte;
+
+
+ FT_TRACE4(( " (maskbytes:" ));
+
+ for ( maskbyte = 0;
+ maskbyte < (FT_UInt)( ( decoder->num_hints + 7 ) >> 3 );
+ maskbyte++, ip++ )
+ FT_TRACE4(( " 0x%02X", *ip ));
+
+ FT_TRACE4(( ")\n" ));
+ }
+#else
+ ip += ( decoder->num_hints + 7 ) >> 3;
+#endif
+ args = stack;
+ break;
+
+ case cff_op_rmoveto:
+ FT_TRACE4(( " rmoveto\n" ));
+
+ cff_builder_close_contour( builder );
+ builder->path_begun = 0;
+ x = ADD_LONG( x, args[-2] );
+ y = ADD_LONG( y, args[-1] );
+ args = stack;
+ break;
+
+ case cff_op_vmoveto:
+ FT_TRACE4(( " vmoveto\n" ));
+
+ cff_builder_close_contour( builder );
+ builder->path_begun = 0;
+ y = ADD_LONG( y, args[-1] );
+ args = stack;
+ break;
+
+ case cff_op_hmoveto:
+ FT_TRACE4(( " hmoveto\n" ));
+
+ cff_builder_close_contour( builder );
+ builder->path_begun = 0;
+ x = ADD_LONG( x, args[-1] );
+ args = stack;
+ break;
+
+ case cff_op_rlineto:
+ FT_TRACE4(( " rlineto\n" ));
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, num_args / 2 ) )
+ goto Fail;
+
+ if ( num_args < 2 )
+ goto Stack_Underflow;
+
+ args -= num_args & ~1;
+ while ( args < decoder->top )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 1 );
+ args += 2;
+ }
+ args = stack;
+ break;
+
+ case cff_op_hlineto:
+ case cff_op_vlineto:
+ {
+ FT_Int phase = ( op == cff_op_hlineto );
+
+
+ FT_TRACE4(( op == cff_op_hlineto ? " hlineto\n"
+ : " vlineto\n" ));
+
+ if ( num_args < 0 )
+ goto Stack_Underflow;
+
+ /* there exist subsetted fonts (found in PDFs) */
+ /* which call `hlineto' without arguments */
+ if ( num_args == 0 )
+ break;
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, num_args ) )
+ goto Fail;
+
+ args = stack;
+ while ( args < decoder->top )
+ {
+ if ( phase )
+ x = ADD_LONG( x, args[0] );
+ else
+ y = ADD_LONG( y, args[0] );
+
+ if ( cff_builder_add_point1( builder, x, y ) )
+ goto Fail;
+
+ args++;
+ phase ^= 1;
+ }
+ args = stack;
+ }
+ break;
+
+ case cff_op_rrcurveto:
+ {
+ FT_Int nargs;
+
+
+ FT_TRACE4(( " rrcurveto\n" ));
+
+ if ( num_args < 6 )
+ goto Stack_Underflow;
+
+ nargs = num_args - num_args % 6;
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, nargs / 2 ) )
+ goto Fail;
+
+ args -= nargs;
+ while ( args < decoder->top )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[2] );
+ y = ADD_LONG( y, args[3] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[4] );
+ y = ADD_LONG( y, args[5] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args += 6;
+ }
+ args = stack;
+ }
+ break;
+
+ case cff_op_vvcurveto:
+ {
+ FT_Int nargs;
+
+
+ FT_TRACE4(( " vvcurveto\n" ));
+
+ if ( num_args < 4 )
+ goto Stack_Underflow;
+
+ /* if num_args isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+
+ nargs = num_args & ~2;
+
+ if ( cff_builder_start_point( builder, x, y ) )
+ goto Fail;
+
+ args -= nargs;
+
+ if ( nargs & 1 )
+ {
+ x = ADD_LONG( x, args[0] );
+ args++;
+ nargs--;
+ }
+
+ if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
+ goto Fail;
+
+ while ( args < decoder->top )
+ {
+ y = ADD_LONG( y, args[0] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[1] );
+ y = ADD_LONG( y, args[2] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ y = ADD_LONG( y, args[3] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args += 4;
+ }
+ args = stack;
+ }
+ break;
+
+ case cff_op_hhcurveto:
+ {
+ FT_Int nargs;
+
+
+ FT_TRACE4(( " hhcurveto\n" ));
+
+ if ( num_args < 4 )
+ goto Stack_Underflow;
+
+ /* if num_args isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+
+ nargs = num_args & ~2;
+
+ if ( cff_builder_start_point( builder, x, y ) )
+ goto Fail;
+
+ args -= nargs;
+ if ( nargs & 1 )
+ {
+ y = ADD_LONG( y, args[0] );
+ args++;
+ nargs--;
+ }
+
+ if ( cff_check_points( builder, 3 * ( nargs / 4 ) ) )
+ goto Fail;
+
+ while ( args < decoder->top )
+ {
+ x = ADD_LONG( x, args[0] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[1] );
+ y = ADD_LONG( y, args[2] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[3] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args += 4;
+ }
+ args = stack;
+ }
+ break;
+
+ case cff_op_vhcurveto:
+ case cff_op_hvcurveto:
+ {
+ FT_Int phase;
+ FT_Int nargs;
+
+
+ FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto\n"
+ : " hvcurveto\n" ));
+
+ if ( cff_builder_start_point( builder, x, y ) )
+ goto Fail;
+
+ if ( num_args < 4 )
+ goto Stack_Underflow;
+
+ /* if num_args isn't of the form 8n, 8n+1, 8n+4, or 8n+5, */
+ /* we enforce it by clearing the second bit */
+
+ nargs = num_args & ~2;
+
+ args -= nargs;
+ if ( cff_check_points( builder, ( nargs / 4 ) * 3 ) )
+ goto Stack_Underflow;
+
+ phase = ( op == cff_op_hvcurveto );
+
+ while ( nargs >= 4 )
+ {
+ nargs -= 4;
+ if ( phase )
+ {
+ x = ADD_LONG( x, args[0] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[1] );
+ y = ADD_LONG( y, args[2] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ y = ADD_LONG( y, args[3] );
+ if ( nargs == 1 )
+ x = ADD_LONG( x, args[4] );
+ cff_builder_add_point( builder, x, y, 1 );
+ }
+ else
+ {
+ y = ADD_LONG( y, args[0] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[1] );
+ y = ADD_LONG( y, args[2] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[3] );
+ if ( nargs == 1 )
+ y = ADD_LONG( y, args[4] );
+ cff_builder_add_point( builder, x, y, 1 );
+ }
+ args += 4;
+ phase ^= 1;
+ }
+ args = stack;
+ }
+ break;
+
+ case cff_op_rlinecurve:
+ {
+ FT_Int num_lines;
+ FT_Int nargs;
+
+
+ FT_TRACE4(( " rlinecurve\n" ));
+
+ if ( num_args < 8 )
+ goto Stack_Underflow;
+
+ nargs = num_args & ~1;
+ num_lines = ( nargs - 6 ) / 2;
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, num_lines + 3 ) )
+ goto Fail;
+
+ args -= nargs;
+
+ /* first, add the line segments */
+ while ( num_lines > 0 )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args += 2;
+ num_lines--;
+ }
+
+ /* then the curve */
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[2] );
+ y = ADD_LONG( y, args[3] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[4] );
+ y = ADD_LONG( y, args[5] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args = stack;
+ }
+ break;
+
+ case cff_op_rcurveline:
+ {
+ FT_Int num_curves;
+ FT_Int nargs;
+
+
+ FT_TRACE4(( " rcurveline\n" ));
+
+ if ( num_args < 8 )
+ goto Stack_Underflow;
+
+ nargs = num_args - 2;
+ nargs = nargs - nargs % 6 + 2;
+ num_curves = ( nargs - 2 ) / 6;
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, num_curves * 3 + 2 ) )
+ goto Fail;
+
+ args -= nargs;
+
+ /* first, add the curves */
+ while ( num_curves > 0 )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[2] );
+ y = ADD_LONG( y, args[3] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ x = ADD_LONG( x, args[4] );
+ y = ADD_LONG( y, args[5] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args += 6;
+ num_curves--;
+ }
+
+ /* then the final line */
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args = stack;
+ }
+ break;
+
+ case cff_op_hflex1:
+ {
+ FT_Pos start_y;
+
+
+ FT_TRACE4(( " hflex1\n" ));
+
+ /* adding five more points: 4 control points, 1 on-curve point */
+ /* -- make sure we have enough space for the start point if it */
+ /* needs to be added */
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, 6 ) )
+ goto Fail;
+
+ /* record the starting point's y position for later use */
+ start_y = y;
+
+ /* first control point */
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* second control point */
+ x = ADD_LONG( x, args[2] );
+ y = ADD_LONG( y, args[3] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* join point; on curve, with y-value the same as the last */
+ /* control point's y-value */
+ x = ADD_LONG( x, args[4] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ /* third control point, with y-value the same as the join */
+ /* point's y-value */
+ x = ADD_LONG( x, args[5] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* fourth control point */
+ x = ADD_LONG( x, args[6] );
+ y = ADD_LONG( y, args[7] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* ending point, with y-value the same as the start */
+ x = ADD_LONG( x, args[8] );
+ y = start_y;
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args = stack;
+ break;
+ }
+
+ case cff_op_hflex:
+ {
+ FT_Pos start_y;
+
+
+ FT_TRACE4(( " hflex\n" ));
+
+ /* adding six more points; 4 control points, 2 on-curve points */
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, 6 ) )
+ goto Fail;
+
+ /* record the starting point's y-position for later use */
+ start_y = y;
+
+ /* first control point */
+ x = ADD_LONG( x, args[0] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* second control point */
+ x = ADD_LONG( x, args[1] );
+ y = ADD_LONG( y, args[2] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* join point; on curve, with y-value the same as the last */
+ /* control point's y-value */
+ x = ADD_LONG( x, args[3] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ /* third control point, with y-value the same as the join */
+ /* point's y-value */
+ x = ADD_LONG( x, args[4] );
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* fourth control point */
+ x = ADD_LONG( x, args[5] );
+ y = start_y;
+ cff_builder_add_point( builder, x, y, 0 );
+
+ /* ending point, with y-value the same as the start point's */
+ /* y-value -- we don't add this point, though */
+ x = ADD_LONG( x, args[6] );
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args = stack;
+ break;
+ }
+
+ case cff_op_flex1:
+ {
+ FT_Pos start_x, start_y; /* record start x, y values for */
+ /* alter use */
+ FT_Fixed dx = 0, dy = 0; /* used in horizontal/vertical */
+ /* algorithm below */
+ FT_Int horizontal, count;
+ FT_Fixed* temp;
+
+
+ FT_TRACE4(( " flex1\n" ));
+
+ /* adding six more points; 4 control points, 2 on-curve points */
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, 6 ) )
+ goto Fail;
+
+ /* record the starting point's x, y position for later use */
+ start_x = x;
+ start_y = y;
+
+ /* XXX: figure out whether this is supposed to be a horizontal */
+ /* or vertical flex; the Type 2 specification is vague... */
+
+ temp = args;
+
+ /* grab up to the last argument */
+ for ( count = 5; count > 0; count-- )
+ {
+ dx = ADD_LONG( dx, temp[0] );
+ dy = ADD_LONG( dy, temp[1] );
+ temp += 2;
+ }
+
+ if ( dx < 0 )
+ dx = -dx;
+ if ( dy < 0 )
+ dy = -dy;
+
+ /* strange test, but here it is... */
+ horizontal = ( dx > dy );
+
+ for ( count = 5; count > 0; count-- )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y,
+ (FT_Bool)( count == 3 ) );
+ args += 2;
+ }
+
+ /* is last operand an x- or y-delta? */
+ if ( horizontal )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = start_y;
+ }
+ else
+ {
+ x = start_x;
+ y = ADD_LONG( y, args[0] );
+ }
+
+ cff_builder_add_point( builder, x, y, 1 );
+
+ args = stack;
+ break;
+ }
+
+ case cff_op_flex:
+ {
+ FT_UInt count;
+
+
+ FT_TRACE4(( " flex\n" ));
+
+ if ( cff_builder_start_point( builder, x, y ) ||
+ cff_check_points( builder, 6 ) )
+ goto Fail;
+
+ for ( count = 6; count > 0; count-- )
+ {
+ x = ADD_LONG( x, args[0] );
+ y = ADD_LONG( y, args[1] );
+ cff_builder_add_point( builder, x, y,
+ (FT_Bool)( count == 4 || count == 1 ) );
+ args += 2;
+ }
+
+ args = stack;
+ }
+ break;
+
+ case cff_op_seac:
+ FT_TRACE4(( " seac\n" ));
+
+ error = cff_operator_seac( decoder,
+ args[0], args[1], args[2],
+ (FT_Int)( args[3] >> 16 ),
+ (FT_Int)( args[4] >> 16 ) );
+
+ /* add current outline to the glyph slot */
+ FT_GlyphLoader_Add( builder->loader );
+
+ /* return now! */
+ FT_TRACE4(( "\n" ));
+ return error;
+
+ case cff_op_endchar:
+ /* in dictionaries, `endchar' simply indicates end of data */
+ if ( in_dict )
+ return error;
+
+ FT_TRACE4(( " endchar\n" ));
+
+ /* We are going to emulate the seac operator. */
+ if ( num_args >= 4 )
+ {
+ /* Save glyph width so that the subglyphs don't overwrite it. */
+ FT_Pos glyph_width = decoder->glyph_width;
+
+
+ error = cff_operator_seac( decoder,
+ 0L, args[-4], args[-3],
+ (FT_Int)( args[-2] >> 16 ),
+ (FT_Int)( args[-1] >> 16 ) );
+
+ decoder->glyph_width = glyph_width;
+ }
+ else
+ {
+ cff_builder_close_contour( builder );
+
+ /* close hints recording session */
+ if ( hinter )
+ {
+ if ( hinter->close( hinter->hints,
+ (FT_UInt)builder->current->n_points ) )
+ goto Syntax_Error;
+
+ /* apply hints to the loaded glyph outline now */
+ error = hinter->apply( hinter->hints,
+ builder->current,
+ (PSH_Globals)builder->hints_globals,
+ decoder->hint_mode );
+ if ( error )
+ goto Fail;
+ }
+
+ /* add current outline to the glyph slot */
+ FT_GlyphLoader_Add( builder->loader );
+ }
+
+ /* return now! */
+ FT_TRACE4(( "\n" ));
+ return error;
+
+ case cff_op_abs:
+ FT_TRACE4(( " abs\n" ));
+
+ if ( args[0] < 0 )
+ {
+ if ( args[0] == FT_LONG_MIN )
+ args[0] = FT_LONG_MAX;
+ else
+ args[0] = -args[0];
+ }
+ args++;
+ break;
+
+ case cff_op_add:
+ FT_TRACE4(( " add\n" ));
+
+ args[0] = ADD_LONG( args[0], args[1] );
+ args++;
+ break;
+
+ case cff_op_sub:
+ FT_TRACE4(( " sub\n" ));
+
+ args[0] = SUB_LONG( args[0], args[1] );
+ args++;
+ break;
+
+ case cff_op_div:
+ FT_TRACE4(( " div\n" ));
+
+ args[0] = FT_DivFix( args[0], args[1] );
+ args++;
+ break;
+
+ case cff_op_neg:
+ FT_TRACE4(( " neg\n" ));
+
+ if ( args[0] == FT_LONG_MIN )
+ args[0] = FT_LONG_MAX;
+ args[0] = -args[0];
+ args++;
+ break;
+
+ case cff_op_random:
+ FT_TRACE4(( " random\n" ));
+
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ args[0] = (FT_Fixed)
+ ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
+ args++;
+
+ decoder->current_subfont->random =
+ cff_random( decoder->current_subfont->random );
+ break;
+
+ case cff_op_mul:
+ FT_TRACE4(( " mul\n" ));
+
+ args[0] = FT_MulFix( args[0], args[1] );
+ args++;
+ break;
+
+ case cff_op_sqrt:
+ FT_TRACE4(( " sqrt\n" ));
+
+ if ( args[0] > 0 )
+ {
+ FT_Fixed root = args[0];
+ FT_Fixed new_root;
+
+
+ for (;;)
+ {
+ new_root = ( root + FT_DivFix( args[0], root ) + 1 ) >> 1;
+ if ( new_root == root )
+ break;
+ root = new_root;
+ }
+ args[0] = new_root;
+ }
+ else
+ args[0] = 0;
+ args++;
+ break;
+
+ case cff_op_drop:
+ /* nothing */
+ FT_TRACE4(( " drop\n" ));
+
+ break;
+
+ case cff_op_exch:
+ {
+ FT_Fixed tmp;
+
+
+ FT_TRACE4(( " exch\n" ));
+
+ tmp = args[0];
+ args[0] = args[1];
+ args[1] = tmp;
+ args += 2;
+ }
+ break;
+
+ case cff_op_index:
+ {
+ FT_Int idx = (FT_Int)( args[0] >> 16 );
+
+
+ FT_TRACE4(( " index\n" ));
+
+ if ( idx < 0 )
+ idx = 0;
+ else if ( idx > num_args - 2 )
+ idx = num_args - 2;
+ args[0] = args[-( idx + 1 )];
+ args++;
+ }
+ break;
+
+ case cff_op_roll:
+ {
+ FT_Int count = (FT_Int)( args[0] >> 16 );
+ FT_Int idx = (FT_Int)( args[1] >> 16 );
+
+
+ FT_TRACE4(( " roll\n" ));
+
+ if ( count <= 0 )
+ count = 1;
+
+ args -= count;
+ if ( args < stack )
+ goto Stack_Underflow;
+
+ if ( idx >= 0 )
+ {
+ while ( idx > 0 )
+ {
+ FT_Fixed tmp = args[count - 1];
+ FT_Int i;
+
+
+ for ( i = count - 2; i >= 0; i-- )
+ args[i + 1] = args[i];
+ args[0] = tmp;
+ idx--;
+ }
+ }
+ else
+ {
+ while ( idx < 0 )
+ {
+ FT_Fixed tmp = args[0];
+ FT_Int i;
+
+
+ for ( i = 0; i < count - 1; i++ )
+ args[i] = args[i + 1];
+ args[count - 1] = tmp;
+ idx++;
+ }
+ }
+ args += count;
+ }
+ break;
+
+ case cff_op_dup:
+ FT_TRACE4(( " dup\n" ));
+
+ args[1] = args[0];
+ args += 2;
+ break;
+
+ case cff_op_put:
+ {
+ FT_Fixed val = args[0];
+ FT_Int idx = (FT_Int)( args[1] >> 16 );
+
+
+ FT_TRACE4(( " put\n" ));
+
+ /* the Type2 specification before version 16-March-2000 */
+ /* didn't give a hard-coded size limit of the temporary */
+ /* storage array; instead, an argument of the */
+ /* `MultipleMaster' operator set the size */
+ if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
+ decoder->buildchar[idx] = val;
+ }
+ break;
+
+ case cff_op_get:
+ {
+ FT_Int idx = (FT_Int)( args[0] >> 16 );
+ FT_Fixed val = 0;
+
+
+ FT_TRACE4(( " get\n" ));
+
+ if ( idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS )
+ val = decoder->buildchar[idx];
+
+ args[0] = val;
+ args++;
+ }
+ break;
+
+ case cff_op_store:
+ /* this operator was removed from the Type2 specification */
+ /* in version 16-March-2000 */
+
+ /* since we currently don't handle interpolation of multiple */
+ /* master fonts, this is a no-op */
+ FT_TRACE4(( " store\n" ));
+ break;
+
+ case cff_op_load:
+ /* this operator was removed from the Type2 specification */
+ /* in version 16-March-2000 */
+ {
+ FT_Int reg_idx = (FT_Int)args[0];
+ FT_Int idx = (FT_Int)args[1];
+ FT_Int count = (FT_Int)args[2];
+
+
+ FT_TRACE4(( " load\n" ));
+
+ /* since we currently don't handle interpolation of multiple */
+ /* master fonts, we store a vector [1 0 0 ...] in the */
+ /* temporary storage array regardless of the Registry index */
+ if ( reg_idx >= 0 && reg_idx <= 2 &&
+ idx >= 0 && idx < CFF_MAX_TRANS_ELEMENTS &&
+ count >= 0 && count <= num_axes )
+ {
+ FT_Int end, i;
+
+
+ end = FT_MIN( idx + count, CFF_MAX_TRANS_ELEMENTS );
+
+ if ( idx < end )
+ decoder->buildchar[idx] = 1 << 16;
+
+ for ( i = idx + 1; i < end; i++ )
+ decoder->buildchar[i] = 0;
+ }
+ }
+ break;
+
+ case cff_op_blend:
+ /* this operator was removed from the Type2 specification */
+ /* in version 16-March-2000 */
+ {
+ FT_Int num_results = (FT_Int)( args[0] >> 16 );
+
+
+ FT_TRACE4(( " blend\n" ));
+
+ if ( num_results < 0 )
+ goto Syntax_Error;
+
+ if ( num_results * (FT_Int)num_designs > num_args )
+ goto Stack_Underflow;
+
+ /* since we currently don't handle interpolation of multiple */
+ /* master fonts, return the `num_results' values of the */
+ /* first master */
+ args -= num_results * ( num_designs - 1 );
+ num_args -= num_results * ( num_designs - 1 );
+ }
+ break;
+
+ case cff_op_dotsection:
+ /* this operator is deprecated and ignored by the parser */
+ FT_TRACE4(( " dotsection\n" ));
+ break;
+
+ case cff_op_closepath:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " closepath (invalid op)\n" ));
+
+ args = stack;
+ break;
+
+ case cff_op_hsbw:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " hsbw (invalid op)\n" ));
+
+ decoder->glyph_width =
+ ADD_LONG( decoder->nominal_width, ( args[1] >> 16 ) );
+
+ decoder->builder.left_bearing.x = args[0];
+ decoder->builder.left_bearing.y = 0;
+
+ x = ADD_LONG( decoder->builder.pos_x, args[0] );
+ y = decoder->builder.pos_y;
+ args = stack;
+ break;
+
+ case cff_op_sbw:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " sbw (invalid op)\n" ));
+
+ decoder->glyph_width =
+ ADD_LONG( decoder->nominal_width, ( args[2] >> 16 ) );
+
+ decoder->builder.left_bearing.x = args[0];
+ decoder->builder.left_bearing.y = args[1];
+
+ x = ADD_LONG( decoder->builder.pos_x, args[0] );
+ y = ADD_LONG( decoder->builder.pos_y, args[1] );
+ args = stack;
+ break;
+
+ case cff_op_setcurrentpoint:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " setcurrentpoint (invalid op)\n" ));
+
+ x = ADD_LONG( decoder->builder.pos_x, args[0] );
+ y = ADD_LONG( decoder->builder.pos_y, args[1] );
+ args = stack;
+ break;
+
+ case cff_op_callothersubr:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " callothersubr (invalid op)\n" ));
+
+ /* subsequent `pop' operands should add the arguments, */
+ /* this is the implementation described for `unknown' other */
+ /* subroutines in the Type1 spec. */
+ /* */
+ /* XXX Fix return arguments (see discussion below). */
+ args -= 2 + ( args[-2] >> 16 );
+ if ( args < stack )
+ goto Stack_Underflow;
+ break;
+
+ case cff_op_pop:
+ /* this is an invalid Type 2 operator; however, there */
+ /* exist fonts which are incorrectly converted from probably */
+ /* Type 1 to CFF, and some parsers seem to accept it */
+
+ FT_TRACE4(( " pop (invalid op)\n" ));
+
+ /* XXX Increasing `args' is wrong: After a certain number of */
+ /* `pop's we get a stack overflow. Reason for doing it is */
+ /* code like this (actually found in a CFF font): */
+ /* */
+ /* 17 1 3 callothersubr */
+ /* pop */
+ /* callsubr */
+ /* */
+ /* Since we handle `callothersubr' as a no-op, and */
+ /* `callsubr' needs at least one argument, `pop' can't be a */
+ /* no-op too as it basically should be. */
+ /* */
+ /* The right solution would be to provide real support for */
+ /* `callothersubr' as done in `t1decode.c', however, given */
+ /* the fact that CFF fonts with `pop' are invalid, it is */
+ /* questionable whether it is worth the time. */
+ args++;
+ break;
+
+ case cff_op_and:
+ {
+ FT_Fixed cond = ( args[0] && args[1] );
+
+
+ FT_TRACE4(( " and\n" ));
+
+ args[0] = cond ? 0x10000L : 0;
+ args++;
+ }
+ break;
+
+ case cff_op_or:
+ {
+ FT_Fixed cond = ( args[0] || args[1] );
+
+
+ FT_TRACE4(( " or\n" ));
+
+ args[0] = cond ? 0x10000L : 0;
+ args++;
+ }
+ break;
+
+ case cff_op_not:
+ {
+ FT_Fixed cond = !args[0];
+
+
+ FT_TRACE4(( " not\n" ));
+
+ args[0] = cond ? 0x10000L : 0;
+ args++;
+ }
+ break;
+
+ case cff_op_eq:
+ {
+ FT_Fixed cond = ( args[0] == args[1] );
+
+
+ FT_TRACE4(( " eq\n" ));
+
+ args[0] = cond ? 0x10000L : 0;
+ args++;
+ }
+ break;
+
+ case cff_op_ifelse:
+ {
+ FT_Fixed cond = ( args[2] <= args[3] );
+
+
+ FT_TRACE4(( " ifelse\n" ));
+
+ if ( !cond )
+ args[0] = args[1];
+ args++;
+ }
+ break;
+
+ case cff_op_callsubr:
+ {
+ FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ decoder->locals_bias );
+
+
+ FT_TRACE4(( " callsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
+
+ if ( idx >= decoder->num_locals )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " invalid local subr index\n" ));
+ goto Syntax_Error;
+ }
+
+ if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " too many nested subrs\n" ));
+ goto Syntax_Error;
+ }
+
+ zone->cursor = ip; /* save current instruction pointer */
+
+ zone++;
+ zone->base = decoder->locals[idx];
+ zone->limit = decoder->locals[idx + 1];
+ zone->cursor = zone->base;
+
+ if ( !zone->base || zone->limit == zone->base )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " invoking empty subrs\n" ));
+ goto Syntax_Error;
+ }
+
+ decoder->zone = zone;
+ ip = zone->base;
+ limit = zone->limit;
+ }
+ break;
+
+ case cff_op_callgsubr:
+ {
+ FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ decoder->globals_bias );
+
+
+ FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
+
+ if ( idx >= decoder->num_globals )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " invalid global subr index\n" ));
+ goto Syntax_Error;
+ }
+
+ if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " too many nested subrs\n" ));
+ goto Syntax_Error;
+ }
+
+ zone->cursor = ip; /* save current instruction pointer */
+
+ zone++;
+ zone->base = decoder->globals[idx];
+ zone->limit = decoder->globals[idx + 1];
+ zone->cursor = zone->base;
+
+ if ( !zone->base || zone->limit == zone->base )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " invoking empty subrs\n" ));
+ goto Syntax_Error;
+ }
+
+ decoder->zone = zone;
+ ip = zone->base;
+ limit = zone->limit;
+ }
+ break;
+
+ case cff_op_return:
+ FT_TRACE4(( " return (leaving level %d)\n",
+ decoder->zone - decoder->zones ));
+
+ if ( decoder->zone <= decoder->zones )
+ {
+ FT_ERROR(( "cff_decoder_parse_charstrings:"
+ " unexpected return\n" ));
+ goto Syntax_Error;
+ }
+
+ decoder->zone--;
+ zone = decoder->zone;
+ ip = zone->cursor;
+ limit = zone->limit;
+ break;
+
+ default:
+ FT_ERROR(( "Unimplemented opcode: %d", ip[-1] ));
+
+ if ( ip[-1] == 12 )
+ FT_ERROR(( " %d", ip[0] ));
+ FT_ERROR(( "\n" ));
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+ decoder->top = args;
+
+ if ( decoder->top - stack >= CFF_MAX_OPERANDS )
+ goto Stack_Overflow;
+
+ } /* general operator processing */
+
+ } /* while ip < limit */
+
+ FT_TRACE4(( "..end..\n\n" ));
+
+ Fail:
+ return error;
+
+ MM_Error:
+ FT_TRACE4(( "cff_decoder_parse_charstrings:"
+ " invalid opcode found in top DICT charstring\n"));
+ return FT_THROW( Invalid_File_Format );
+
+ Syntax_Error:
+ FT_TRACE4(( "cff_decoder_parse_charstrings: syntax error\n" ));
+ return FT_THROW( Invalid_File_Format );
+
+ Stack_Underflow:
+ FT_TRACE4(( "cff_decoder_parse_charstrings: stack underflow\n" ));
+ return FT_THROW( Too_Few_Arguments );
+
+ Stack_Overflow:
+ FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow\n" ));
+ return FT_THROW( Stack_Overflow );
+ }
+
+#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* cff_decoder_init */
+ /* */
+ /* <Description> */
+ /* Initializes a given glyph decoder. */
+ /* */
+ /* <InOut> */
+ /* decoder :: A pointer to the glyph builder to initialize. */
+ /* */
+ /* <Input> */
+ /* face :: The current face object. */
+ /* */
+ /* size :: The current size object. */
+ /* */
+ /* slot :: The current glyph object. */
+ /* */
+ /* hinting :: Whether hinting is active. */
+ /* */
+ /* hint_mode :: The hinting mode. */
+ /* */
+ FT_LOCAL_DEF( void )
+ cff_decoder_init( CFF_Decoder* decoder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot slot,
+ FT_Bool hinting,
+ FT_Render_Mode hint_mode,
+ CFF_Decoder_Get_Glyph_Callback get_callback,
+ CFF_Decoder_Free_Glyph_Callback free_callback )
+ {
+ CFF_Font cff = (CFF_Font)face->extra.data;
+
+
+ /* clear everything */
+ FT_ZERO( decoder );
+
+ /* initialize builder */
+ cff_builder_init( &decoder->builder, face, size, slot, hinting );
+
+ /* initialize Type2 decoder */
+ decoder->cff = cff;
+ decoder->num_globals = cff->global_subrs_index.count;
+ decoder->globals = cff->global_subrs;
+ decoder->globals_bias = cff_compute_bias(
+ cff->top_font.font_dict.charstring_type,
+ decoder->num_globals );
+
+ decoder->hint_mode = hint_mode;
+
+ decoder->get_glyph_callback = get_callback;
+ decoder->free_glyph_callback = free_callback;
+ }
+
+
+ /* this function is used to select the subfont */
+ /* and the locals subrs array */
+ FT_LOCAL_DEF( FT_Error )
+ cff_decoder_prepare( CFF_Decoder* decoder,
+ CFF_Size size,
+ FT_UInt glyph_index )
+ {
+ CFF_Builder *builder = &decoder->builder;
+ CFF_Font cff = (CFF_Font)builder->face->extra.data;
+ CFF_SubFont sub = &cff->top_font;
+ FT_Error error = FT_Err_Ok;
+
+ FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)cff->cffload;
+
+
+ /* manage CID fonts */
+ if ( cff->num_subfonts )
+ {
+ FT_Byte fd_index = cffload->fd_select_get( &cff->fd_select,
+ glyph_index );
+
+
+ if ( fd_index >= cff->num_subfonts )
+ {
+ FT_TRACE4(( "cff_decoder_prepare: invalid CID subfont index\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
+
+ FT_TRACE3(( " in subfont %d:\n", fd_index ));
+
+ sub = cff->subfonts[fd_index];
+
+ if ( builder->hints_funcs && size )
+ {
+ FT_Size ftsize = FT_SIZE( size );
+ CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
+
+
+ /* for CFFs without subfonts, this value has already been set */
+ builder->hints_globals = (void *)internal->subfonts[fd_index];
+ }
+ }
+
+ decoder->num_locals = sub->local_subrs_index.count;
+ decoder->locals = sub->local_subrs;
+ decoder->locals_bias = cff_compute_bias(
+ decoder->cff->top_font.font_dict.charstring_type,
+ decoder->num_locals );
+
+ decoder->glyph_width = sub->private_dict.default_width;
+ decoder->nominal_width = sub->private_dict.nominal_width;
+
+ decoder->current_subfont = sub;
+
+ Exit:
+ return error;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/cffdecode.h b/thirdparty/freetype/src/psaux/cffdecode.h
new file mode 100644
index 0000000000..0d4f5fef63
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/cffdecode.h
@@ -0,0 +1,64 @@
+/***************************************************************************/
+/* */
+/* cffdecode.h */
+/* */
+/* PostScript CFF (Type 2) decoding routines (specification). */
+/* */
+/* Copyright 2017-2018 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef CFFDECODE_H_
+#define CFFDECODE_H_
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+
+
+FT_BEGIN_HEADER
+
+ FT_LOCAL( void )
+ cff_decoder_init( CFF_Decoder* decoder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot slot,
+ FT_Bool hinting,
+ FT_Render_Mode hint_mode,
+ CFF_Decoder_Get_Glyph_Callback get_callback,
+ CFF_Decoder_Free_Glyph_Callback free_callback );
+
+ FT_LOCAL( FT_Error )
+ cff_decoder_prepare( CFF_Decoder* decoder,
+ CFF_Size size,
+ FT_UInt glyph_index );
+
+
+ FT_LOCAL( FT_Int )
+ cff_lookup_glyph_by_stdcharcode( CFF_Font cff,
+ FT_Int charcode );
+
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ FT_LOCAL( FT_Error )
+ cff_decoder_parse_charstrings( CFF_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len,
+ FT_Bool in_dict );
+#endif
+
+
+FT_END_HEADER
+
+#endif
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/module.mk b/thirdparty/freetype/src/psaux/module.mk
index c70a227166..6584d075a2 100644
--- a/thirdparty/freetype/src/psaux/module.mk
+++ b/thirdparty/freetype/src/psaux/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psaux/psarrst.c b/thirdparty/freetype/src/psaux/psarrst.c
new file mode 100644
index 0000000000..a8780947f9
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psarrst.c
@@ -0,0 +1,241 @@
+/***************************************************************************/
+/* */
+/* psarrst.c */
+/* */
+/* Adobe's code for Array Stacks (body). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psglue.h"
+#include "psarrst.h"
+
+#include "pserror.h"
+
+
+ /*
+ * CF2_ArrStack uses an error pointer, to enable shared errors.
+ * Shared errors are necessary when multiple objects allow the program
+ * to continue after detecting errors. Only the first error should be
+ * recorded.
+ */
+
+ FT_LOCAL_DEF( void )
+ cf2_arrstack_init( CF2_ArrStack arrstack,
+ FT_Memory memory,
+ FT_Error* error,
+ size_t sizeItem )
+ {
+ FT_ASSERT( arrstack );
+
+ /* initialize the structure */
+ arrstack->memory = memory;
+ arrstack->error = error;
+ arrstack->sizeItem = sizeItem;
+ arrstack->allocated = 0;
+ arrstack->chunk = 10; /* chunks of 10 items */
+ arrstack->count = 0;
+ arrstack->totalSize = 0;
+ arrstack->ptr = NULL;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_arrstack_finalize( CF2_ArrStack arrstack )
+ {
+ FT_Memory memory = arrstack->memory; /* for FT_FREE */
+
+
+ FT_ASSERT( arrstack );
+
+ arrstack->allocated = 0;
+ arrstack->count = 0;
+ arrstack->totalSize = 0;
+
+ /* free the data buffer */
+ FT_FREE( arrstack->ptr );
+ }
+
+
+ /* allocate or reallocate the buffer size; */
+ /* return false on memory error */
+ static FT_Bool
+ cf2_arrstack_setNumElements( CF2_ArrStack arrstack,
+ size_t numElements )
+ {
+ FT_ASSERT( arrstack );
+
+ {
+ FT_Error error = FT_Err_Ok; /* for FT_REALLOC */
+ FT_Memory memory = arrstack->memory; /* for FT_REALLOC */
+
+ size_t newSize = numElements * arrstack->sizeItem;
+
+
+ if ( numElements > FT_LONG_MAX / arrstack->sizeItem )
+ goto exit;
+
+
+ FT_ASSERT( newSize > 0 ); /* avoid realloc with zero size */
+
+ if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) )
+ {
+ arrstack->allocated = numElements;
+ arrstack->totalSize = newSize;
+
+ if ( arrstack->count > numElements )
+ {
+ /* we truncated the list! */
+ CF2_SET_ERROR( arrstack->error, Stack_Overflow );
+ arrstack->count = numElements;
+ return FALSE;
+ }
+
+ return TRUE; /* success */
+ }
+ }
+
+ exit:
+ /* if there's not already an error, store this one */
+ CF2_SET_ERROR( arrstack->error, Out_Of_Memory );
+
+ return FALSE;
+ }
+
+
+ /* set the count, ensuring allocation is sufficient */
+ FT_LOCAL_DEF( void )
+ cf2_arrstack_setCount( CF2_ArrStack arrstack,
+ size_t numElements )
+ {
+ FT_ASSERT( arrstack );
+
+ if ( numElements > arrstack->allocated )
+ {
+ /* expand the allocation first */
+ if ( !cf2_arrstack_setNumElements( arrstack, numElements ) )
+ return;
+ }
+
+ arrstack->count = numElements;
+ }
+
+
+ /* clear the count */
+ FT_LOCAL_DEF( void )
+ cf2_arrstack_clear( CF2_ArrStack arrstack )
+ {
+ FT_ASSERT( arrstack );
+
+ arrstack->count = 0;
+ }
+
+
+ /* current number of items */
+ FT_LOCAL_DEF( size_t )
+ cf2_arrstack_size( const CF2_ArrStack arrstack )
+ {
+ FT_ASSERT( arrstack );
+
+ return arrstack->count;
+ }
+
+
+ FT_LOCAL_DEF( void* )
+ cf2_arrstack_getBuffer( const CF2_ArrStack arrstack )
+ {
+ FT_ASSERT( arrstack );
+
+ return arrstack->ptr;
+ }
+
+
+ /* return pointer to the given element */
+ FT_LOCAL_DEF( void* )
+ cf2_arrstack_getPointer( const CF2_ArrStack arrstack,
+ size_t idx )
+ {
+ void* newPtr;
+
+
+ FT_ASSERT( arrstack );
+
+ if ( idx >= arrstack->count )
+ {
+ /* overflow */
+ CF2_SET_ERROR( arrstack->error, Stack_Overflow );
+ idx = 0; /* choose safe default */
+ }
+
+ newPtr = (FT_Byte*)arrstack->ptr + idx * arrstack->sizeItem;
+
+ return newPtr;
+ }
+
+
+ /* push (append) an element at the end of the list; */
+ /* return false on memory error */
+ /* TODO: should there be a length param for extra checking? */
+ FT_LOCAL_DEF( void )
+ cf2_arrstack_push( CF2_ArrStack arrstack,
+ const void* ptr )
+ {
+ FT_ASSERT( arrstack );
+
+ if ( arrstack->count == arrstack->allocated )
+ {
+ /* grow the buffer by one chunk */
+ if ( !cf2_arrstack_setNumElements(
+ arrstack, arrstack->allocated + arrstack->chunk ) )
+ {
+ /* on error, ignore the push */
+ return;
+ }
+ }
+
+ FT_ASSERT( ptr );
+
+ {
+ size_t offset = arrstack->count * arrstack->sizeItem;
+ void* newPtr = (FT_Byte*)arrstack->ptr + offset;
+
+
+ FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );
+ arrstack->count += 1;
+ }
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psarrst.h b/thirdparty/freetype/src/psaux/psarrst.h
new file mode 100644
index 0000000000..b3568eb61f
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psarrst.h
@@ -0,0 +1,100 @@
+/***************************************************************************/
+/* */
+/* psarrst.h */
+/* */
+/* Adobe's code for Array Stacks (specification). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSARRST_H_
+#define PSARRST_H_
+
+
+#include "pserror.h"
+
+
+FT_BEGIN_HEADER
+
+
+ /* need to define the struct here (not opaque) so it can be allocated by */
+ /* clients */
+ typedef struct CF2_ArrStackRec_
+ {
+ FT_Memory memory;
+ FT_Error* error;
+
+ size_t sizeItem; /* bytes per element */
+ size_t allocated; /* items allocated */
+ size_t chunk; /* allocation increment in items */
+ size_t count; /* number of elements allocated */
+ size_t totalSize; /* total bytes allocated */
+
+ void* ptr; /* ptr to data */
+
+ } CF2_ArrStackRec, *CF2_ArrStack;
+
+
+ FT_LOCAL( void )
+ cf2_arrstack_init( CF2_ArrStack arrstack,
+ FT_Memory memory,
+ FT_Error* error,
+ size_t sizeItem );
+ FT_LOCAL( void )
+ cf2_arrstack_finalize( CF2_ArrStack arrstack );
+
+ FT_LOCAL( void )
+ cf2_arrstack_setCount( CF2_ArrStack arrstack,
+ size_t numElements );
+ FT_LOCAL( void )
+ cf2_arrstack_clear( CF2_ArrStack arrstack );
+ FT_LOCAL( size_t )
+ cf2_arrstack_size( const CF2_ArrStack arrstack );
+
+ FT_LOCAL( void* )
+ cf2_arrstack_getBuffer( const CF2_ArrStack arrstack );
+ FT_LOCAL( void* )
+ cf2_arrstack_getPointer( const CF2_ArrStack arrstack,
+ size_t idx );
+
+ FT_LOCAL( void )
+ cf2_arrstack_push( CF2_ArrStack arrstack,
+ const void* ptr );
+
+
+FT_END_HEADER
+
+
+#endif /* PSARRST_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psaux.c b/thirdparty/freetype/src/psaux/psaux.c
index c373aa7d5b..fb447fcdbb 100644
--- a/thirdparty/freetype/src/psaux/psaux.c
+++ b/thirdparty/freetype/src/psaux/psaux.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript driver component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,6 +25,17 @@
#include "psobjs.c"
#include "t1cmap.c"
#include "t1decode.c"
+#include "cffdecode.c"
+
+#include "psarrst.c"
+#include "psblues.c"
+#include "pserror.c"
+#include "psfont.c"
+#include "psft.c"
+#include "pshints.c"
+#include "psintrp.c"
+#include "psread.c"
+#include "psstack.c"
/* END */
diff --git a/thirdparty/freetype/src/psaux/psauxerr.h b/thirdparty/freetype/src/psaux/psauxerr.h
index 1d7ac6001b..cc33fd2eea 100644
--- a/thirdparty/freetype/src/psaux/psauxerr.h
+++ b/thirdparty/freetype/src/psaux/psauxerr.h
@@ -4,7 +4,7 @@
/* */
/* PS auxiliary module error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psauxmod.c b/thirdparty/freetype/src/psaux/psauxmod.c
index 1f589cefc2..ee497085cc 100644
--- a/thirdparty/freetype/src/psaux/psauxmod.c
+++ b/thirdparty/freetype/src/psaux/psauxmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,6 +21,8 @@
#include "psobjs.h"
#include "t1decode.h"
#include "t1cmap.h"
+#include "psft.h"
+#include "cffdecode.h"
#ifndef T1_CONFIG_OPTION_NO_AFM
#include "afmparse.h"
@@ -60,6 +62,14 @@
FT_CALLBACK_TABLE_DEF
+ const PS_Builder_FuncsRec ps_builder_funcs =
+ {
+ ps_builder_init, /* init */
+ ps_builder_done /* done */
+ };
+
+
+ FT_CALLBACK_TABLE_DEF
const T1_Builder_FuncsRec t1_builder_funcs =
{
t1_builder_init, /* init */
@@ -77,9 +87,14 @@
FT_CALLBACK_TABLE_DEF
const T1_Decoder_FuncsRec t1_decoder_funcs =
{
- t1_decoder_init, /* init */
- t1_decoder_done, /* done */
- t1_decoder_parse_charstrings /* parse_charstrings */
+ t1_decoder_init, /* init */
+ t1_decoder_done, /* done */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ t1_decoder_parse_charstrings, /* parse_charstrings_old */
+#else
+ t1_decoder_parse_metrics, /* parse_metrics */
+#endif
+ cf2_decoder_parse_charstrings /* parse_charstrings */
};
@@ -104,6 +119,34 @@
};
+ FT_CALLBACK_TABLE_DEF
+ const CFF_Builder_FuncsRec cff_builder_funcs =
+ {
+ cff_builder_init, /* init */
+ cff_builder_done, /* done */
+
+ cff_check_points, /* check_points */
+ cff_builder_add_point, /* add_point */
+ cff_builder_add_point1, /* add_point1 */
+ cff_builder_add_contour, /* add_contour */
+ cff_builder_start_point, /* start_point */
+ cff_builder_close_contour /* close_contour */
+ };
+
+
+ FT_CALLBACK_TABLE_DEF
+ const CFF_Decoder_FuncsRec cff_decoder_funcs =
+ {
+ cff_decoder_init, /* init */
+ cff_decoder_prepare, /* prepare */
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ cff_decoder_parse_charstrings, /* parse_charstrings_old */
+#endif
+ cf2_decoder_parse_charstrings /* parse_charstrings */
+ };
+
+
static
const PSAux_Interface psaux_interface =
{
@@ -112,6 +155,9 @@
&t1_builder_funcs,
&t1_decoder_funcs,
t1_decrypt,
+ cff_random,
+ ps_decoder_init,
+ t1_make_subfont,
(const T1_CMap_ClassesRec*) &t1_cmap_classes,
@@ -120,6 +166,8 @@
#else
0,
#endif
+
+ &cff_decoder_funcs,
};
diff --git a/thirdparty/freetype/src/psaux/psauxmod.h b/thirdparty/freetype/src/psaux/psauxmod.h
index 926f37eba5..f30978f022 100644
--- a/thirdparty/freetype/src/psaux/psauxmod.h
+++ b/thirdparty/freetype/src/psaux/psauxmod.h
@@ -4,7 +4,7 @@
/* */
/* FreeType auxiliary PostScript module implementation (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,6 +23,8 @@
#include <ft2build.h>
#include FT_MODULE_H
+#include FT_INTERNAL_POSTSCRIPT_AUX_H
+
FT_BEGIN_HEADER
@@ -31,6 +33,13 @@ FT_BEGIN_HEADER
#endif
+ FT_CALLBACK_TABLE
+ const CFF_Builder_FuncsRec cff_builder_funcs;
+
+ FT_CALLBACK_TABLE
+ const PS_Builder_FuncsRec ps_builder_funcs;
+
+
FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class;
diff --git a/thirdparty/freetype/src/psaux/psblues.c b/thirdparty/freetype/src/psaux/psblues.c
new file mode 100644
index 0000000000..ae39d03c77
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psblues.c
@@ -0,0 +1,582 @@
+/***************************************************************************/
+/* */
+/* psblues.c */
+/* */
+/* Adobe's code for handling Blue Zones (body). */
+/* */
+/* Copyright 2009-2014 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psblues.h"
+#include "pshints.h"
+#include "psfont.h"
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_cf2blues
+
+
+ /*
+ * For blue values, the FreeType parser produces an array of integers,
+ * while the Adobe CFF engine produces an array of fixed.
+ * Define a macro to convert FreeType to fixed.
+ */
+#define cf2_blueToFixed( x ) cf2_intToFixed( x )
+
+
+ FT_LOCAL_DEF( void )
+ cf2_blues_init( CF2_Blues blues,
+ CF2_Font font )
+ {
+ /* pointer to parsed font object */
+ PS_Decoder* decoder = font->decoder;
+
+ CF2_Fixed zoneHeight;
+ CF2_Fixed maxZoneHeight = 0;
+ CF2_Fixed csUnitsPerPixel;
+
+ size_t numBlueValues;
+ size_t numOtherBlues;
+ size_t numFamilyBlues;
+ size_t numFamilyOtherBlues;
+
+ FT_Pos* blueValues;
+ FT_Pos* otherBlues;
+ FT_Pos* familyBlues;
+ FT_Pos* familyOtherBlues;
+
+ size_t i;
+ CF2_Fixed emBoxBottom, emBoxTop;
+
+#if 0
+ CF2_Int unitsPerEm = font->unitsPerEm;
+
+
+ if ( unitsPerEm == 0 )
+ unitsPerEm = 1000;
+#endif
+
+ FT_ZERO( blues );
+ blues->scale = font->innerTransform.d;
+
+ cf2_getBlueMetrics( decoder,
+ &blues->blueScale,
+ &blues->blueShift,
+ &blues->blueFuzz );
+
+ cf2_getBlueValues( decoder, &numBlueValues, &blueValues );
+ cf2_getOtherBlues( decoder, &numOtherBlues, &otherBlues );
+ cf2_getFamilyBlues( decoder, &numFamilyBlues, &familyBlues );
+ cf2_getFamilyOtherBlues( decoder, &numFamilyOtherBlues, &familyOtherBlues );
+
+ /*
+ * synthetic em box hint heuristic
+ *
+ * Apply this when ideographic dictionary (LanguageGroup 1) has no
+ * real alignment zones. Adobe tools generate dummy zones at -250 and
+ * 1100 for a 1000 unit em. Fonts with ICF-based alignment zones
+ * should not enable the heuristic. When the heuristic is enabled,
+ * the font's blue zones are ignored.
+ *
+ */
+
+ /* get em box from OS/2 typoAscender/Descender */
+ /* TODO: FreeType does not parse these metrics. Skip them for now. */
+#if 0
+ FCM_getHorizontalLineMetrics( &e,
+ font->font,
+ &ascender,
+ &descender,
+ &linegap );
+ if ( ascender - descender == unitsPerEm )
+ {
+ emBoxBottom = cf2_intToFixed( descender );
+ emBoxTop = cf2_intToFixed( ascender );
+ }
+ else
+#endif
+ {
+ emBoxBottom = CF2_ICF_Bottom;
+ emBoxTop = CF2_ICF_Top;
+ }
+
+ if ( cf2_getLanguageGroup( decoder ) == 1 &&
+ ( numBlueValues == 0 ||
+ ( numBlueValues == 4 &&
+ cf2_blueToFixed( blueValues[0] ) < emBoxBottom &&
+ cf2_blueToFixed( blueValues[1] ) < emBoxBottom &&
+ cf2_blueToFixed( blueValues[2] ) > emBoxTop &&
+ cf2_blueToFixed( blueValues[3] ) > emBoxTop ) ) )
+ {
+ /*
+ * Construct hint edges suitable for synthetic ghost hints at top
+ * and bottom of em box. +-CF2_MIN_COUNTER allows for unhinted
+ * features above or below the last hinted edge. This also gives a
+ * net 1 pixel boost to the height of ideographic glyphs.
+ *
+ * Note: Adjust synthetic hints outward by epsilon (0x.0001) to
+ * avoid interference. E.g., some fonts have real hints at
+ * 880 and -120.
+ */
+
+ blues->emBoxBottomEdge.csCoord = emBoxBottom - CF2_FIXED_EPSILON;
+ blues->emBoxBottomEdge.dsCoord = cf2_fixedRound(
+ FT_MulFix(
+ blues->emBoxBottomEdge.csCoord,
+ blues->scale ) ) -
+ CF2_MIN_COUNTER;
+ blues->emBoxBottomEdge.scale = blues->scale;
+ blues->emBoxBottomEdge.flags = CF2_GhostBottom |
+ CF2_Locked |
+ CF2_Synthetic;
+
+ blues->emBoxTopEdge.csCoord = emBoxTop + CF2_FIXED_EPSILON +
+ 2 * font->darkenY;
+ blues->emBoxTopEdge.dsCoord = cf2_fixedRound(
+ FT_MulFix(
+ blues->emBoxTopEdge.csCoord,
+ blues->scale ) ) +
+ CF2_MIN_COUNTER;
+ blues->emBoxTopEdge.scale = blues->scale;
+ blues->emBoxTopEdge.flags = CF2_GhostTop |
+ CF2_Locked |
+ CF2_Synthetic;
+
+ blues->doEmBoxHints = TRUE; /* enable the heuristic */
+
+ return;
+ }
+
+ /* copy `BlueValues' and `OtherBlues' to a combined array of top and */
+ /* bottom zones */
+ for ( i = 0; i < numBlueValues; i += 2 )
+ {
+ blues->zone[blues->count].csBottomEdge =
+ cf2_blueToFixed( blueValues[i] );
+ blues->zone[blues->count].csTopEdge =
+ cf2_blueToFixed( blueValues[i + 1] );
+
+ zoneHeight = SUB_INT32( blues->zone[blues->count].csTopEdge,
+ blues->zone[blues->count].csBottomEdge );
+
+ if ( zoneHeight < 0 )
+ {
+ FT_TRACE4(( "cf2_blues_init: ignoring negative zone height\n" ));
+ continue; /* reject this zone */
+ }
+
+ if ( zoneHeight > maxZoneHeight )
+ {
+ /* take maximum before darkening adjustment */
+ /* so overshoot suppression point doesn't change */
+ maxZoneHeight = zoneHeight;
+ }
+
+ /* adjust both edges of top zone upward by twice darkening amount */
+ if ( i != 0 )
+ {
+ blues->zone[blues->count].csTopEdge += 2 * font->darkenY;
+ blues->zone[blues->count].csBottomEdge += 2 * font->darkenY;
+ }
+
+ /* first `BlueValue' is bottom zone; others are top */
+ if ( i == 0 )
+ {
+ blues->zone[blues->count].bottomZone =
+ TRUE;
+ blues->zone[blues->count].csFlatEdge =
+ blues->zone[blues->count].csTopEdge;
+ }
+ else
+ {
+ blues->zone[blues->count].bottomZone =
+ FALSE;
+ blues->zone[blues->count].csFlatEdge =
+ blues->zone[blues->count].csBottomEdge;
+ }
+
+ blues->count += 1;
+ }
+
+ for ( i = 0; i < numOtherBlues; i += 2 )
+ {
+ blues->zone[blues->count].csBottomEdge =
+ cf2_blueToFixed( otherBlues[i] );
+ blues->zone[blues->count].csTopEdge =
+ cf2_blueToFixed( otherBlues[i + 1] );
+
+ zoneHeight = SUB_INT32( blues->zone[blues->count].csTopEdge,
+ blues->zone[blues->count].csBottomEdge );
+
+ if ( zoneHeight < 0 )
+ {
+ FT_TRACE4(( "cf2_blues_init: ignoring negative zone height\n" ));
+ continue; /* reject this zone */
+ }
+
+ if ( zoneHeight > maxZoneHeight )
+ {
+ /* take maximum before darkening adjustment */
+ /* so overshoot suppression point doesn't change */
+ maxZoneHeight = zoneHeight;
+ }
+
+ /* Note: bottom zones are not adjusted for darkening amount */
+
+ /* all OtherBlues are bottom zone */
+ blues->zone[blues->count].bottomZone =
+ TRUE;
+ blues->zone[blues->count].csFlatEdge =
+ blues->zone[blues->count].csTopEdge;
+
+ blues->count += 1;
+ }
+
+ /* Adjust for FamilyBlues */
+
+ /* Search for the nearest flat edge in `FamilyBlues' or */
+ /* `FamilyOtherBlues'. According to the Black Book, any matching edge */
+ /* must be within one device pixel */
+
+ csUnitsPerPixel = FT_DivFix( cf2_intToFixed( 1 ), blues->scale );
+
+ /* loop on all zones in this font */
+ for ( i = 0; i < blues->count; i++ )
+ {
+ size_t j;
+ CF2_Fixed minDiff;
+ CF2_Fixed flatFamilyEdge, diff;
+ /* value for this font */
+ CF2_Fixed flatEdge = blues->zone[i].csFlatEdge;
+
+
+ if ( blues->zone[i].bottomZone )
+ {
+ /* In a bottom zone, the top edge is the flat edge. */
+ /* Search `FamilyOtherBlues' for bottom zones; look for closest */
+ /* Family edge that is within the one pixel threshold. */
+
+ minDiff = CF2_FIXED_MAX;
+
+ for ( j = 0; j < numFamilyOtherBlues; j += 2 )
+ {
+ /* top edge */
+ flatFamilyEdge = cf2_blueToFixed( familyOtherBlues[j + 1] );
+
+ diff = cf2_fixedAbs( SUB_INT32( flatEdge, flatFamilyEdge ) );
+
+ if ( diff < minDiff && diff < csUnitsPerPixel )
+ {
+ blues->zone[i].csFlatEdge = flatFamilyEdge;
+ minDiff = diff;
+
+ if ( diff == 0 )
+ break;
+ }
+ }
+
+ /* check the first member of FamilyBlues, which is a bottom zone */
+ if ( numFamilyBlues >= 2 )
+ {
+ /* top edge */
+ flatFamilyEdge = cf2_blueToFixed( familyBlues[1] );
+
+ diff = cf2_fixedAbs( SUB_INT32( flatEdge, flatFamilyEdge ) );
+
+ if ( diff < minDiff && diff < csUnitsPerPixel )
+ blues->zone[i].csFlatEdge = flatFamilyEdge;
+ }
+ }
+ else
+ {
+ /* In a top zone, the bottom edge is the flat edge. */
+ /* Search `FamilyBlues' for top zones; skip first zone, which is a */
+ /* bottom zone; look for closest Family edge that is within the */
+ /* one pixel threshold */
+
+ minDiff = CF2_FIXED_MAX;
+
+ for ( j = 2; j < numFamilyBlues; j += 2 )
+ {
+ /* bottom edge */
+ flatFamilyEdge = cf2_blueToFixed( familyBlues[j] );
+
+ /* adjust edges of top zone upward by twice darkening amount */
+ flatFamilyEdge += 2 * font->darkenY; /* bottom edge */
+
+ diff = cf2_fixedAbs( SUB_INT32( flatEdge, flatFamilyEdge ) );
+
+ if ( diff < minDiff && diff < csUnitsPerPixel )
+ {
+ blues->zone[i].csFlatEdge = flatFamilyEdge;
+ minDiff = diff;
+
+ if ( diff == 0 )
+ break;
+ }
+ }
+ }
+ }
+
+ /* TODO: enforce separation of zones, including BlueFuzz */
+
+ /* Adjust BlueScale; similar to AdjustBlueScale() in coretype */
+ /* `bcsetup.c'. */
+
+ if ( maxZoneHeight > 0 )
+ {
+ if ( blues->blueScale > FT_DivFix( cf2_intToFixed( 1 ),
+ maxZoneHeight ) )
+ {
+ /* clamp at maximum scale */
+ blues->blueScale = FT_DivFix( cf2_intToFixed( 1 ),
+ maxZoneHeight );
+ }
+
+ /*
+ * TODO: Revisit the bug fix for 613448. The minimum scale
+ * requirement catches a number of library fonts. For
+ * example, with default BlueScale (.039625) and 0.4 minimum,
+ * the test below catches any font with maxZoneHeight < 10.1.
+ * There are library fonts ranging from 2 to 10 that get
+ * caught, including e.g., Eurostile LT Std Medium with
+ * maxZoneHeight of 6.
+ *
+ */
+#if 0
+ if ( blueScale < .4 / maxZoneHeight )
+ {
+ tetraphilia_assert( 0 );
+ /* clamp at minimum scale, per bug 0613448 fix */
+ blueScale = .4 / maxZoneHeight;
+ }
+#endif
+
+ }
+
+ /*
+ * Suppress overshoot and boost blue zones at small sizes. Boost
+ * amount varies linearly from 0.5 pixel near 0 to 0 pixel at
+ * blueScale cutoff.
+ * Note: This boost amount is different from the coretype heuristic.
+ *
+ */
+
+ if ( blues->scale < blues->blueScale )
+ {
+ blues->suppressOvershoot = TRUE;
+
+ /* Change rounding threshold for `dsFlatEdge'. */
+ /* Note: constant changed from 0.5 to 0.6 to avoid a problem with */
+ /* 10ppem Arial */
+
+ blues->boost = cf2_doubleToFixed( .6 ) -
+ FT_MulDiv( cf2_doubleToFixed ( .6 ),
+ blues->scale,
+ blues->blueScale );
+ if ( blues->boost > 0x7FFF )
+ {
+ /* boost must remain less than 0.5, or baseline could go negative */
+ blues->boost = 0x7FFF;
+ }
+ }
+
+ /* boost and darkening have similar effects; don't do both */
+ if ( font->stemDarkened )
+ blues->boost = 0;
+
+ /* set device space alignment for each zone; */
+ /* apply boost amount before rounding flat edge */
+
+ for ( i = 0; i < blues->count; i++ )
+ {
+ if ( blues->zone[i].bottomZone )
+ blues->zone[i].dsFlatEdge = cf2_fixedRound(
+ FT_MulFix(
+ blues->zone[i].csFlatEdge,
+ blues->scale ) -
+ blues->boost );
+ else
+ blues->zone[i].dsFlatEdge = cf2_fixedRound(
+ FT_MulFix(
+ blues->zone[i].csFlatEdge,
+ blues->scale ) +
+ blues->boost );
+ }
+ }
+
+
+ /*
+ * Check whether `stemHint' is captured by one of the blue zones.
+ *
+ * Zero, one or both edges may be valid; only valid edges can be
+ * captured. For compatibility with CoolType, search top and bottom
+ * zones in the same pass (see `BlueLock'). If a hint is captured,
+ * return true and position the edge(s) in one of 3 ways:
+ *
+ * 1) If `BlueScale' suppresses overshoot, position the captured edge
+ * at the flat edge of the zone.
+ * 2) If overshoot is not suppressed and `BlueShift' requires
+ * overshoot, position the captured edge a minimum of 1 device pixel
+ * from the flat edge.
+ * 3) If overshoot is not suppressed or required, position the captured
+ * edge at the nearest device pixel.
+ *
+ */
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_blues_capture( const CF2_Blues blues,
+ CF2_Hint bottomHintEdge,
+ CF2_Hint topHintEdge )
+ {
+ /* TODO: validate? */
+ CF2_Fixed csFuzz = blues->blueFuzz;
+
+ /* new position of captured edge */
+ CF2_Fixed dsNew;
+
+ /* amount that hint is moved when positioned */
+ CF2_Fixed dsMove = 0;
+
+ FT_Bool captured = FALSE;
+ CF2_UInt i;
+
+
+ /* assert edge flags are consistent */
+ FT_ASSERT( !cf2_hint_isTop( bottomHintEdge ) &&
+ !cf2_hint_isBottom( topHintEdge ) );
+
+ /* TODO: search once without blue fuzz for compatibility with coretype? */
+ for ( i = 0; i < blues->count; i++ )
+ {
+ if ( blues->zone[i].bottomZone &&
+ cf2_hint_isBottom( bottomHintEdge ) )
+ {
+ if ( SUB_INT32( blues->zone[i].csBottomEdge, csFuzz ) <=
+ bottomHintEdge->csCoord &&
+ bottomHintEdge->csCoord <=
+ ADD_INT32( blues->zone[i].csTopEdge, csFuzz ) )
+ {
+ /* bottom edge captured by bottom zone */
+
+ if ( blues->suppressOvershoot )
+ dsNew = blues->zone[i].dsFlatEdge;
+
+ else if ( SUB_INT32( blues->zone[i].csTopEdge,
+ bottomHintEdge->csCoord ) >=
+ blues->blueShift )
+ {
+ /* guarantee minimum of 1 pixel overshoot */
+ dsNew = FT_MIN(
+ cf2_fixedRound( bottomHintEdge->dsCoord ),
+ blues->zone[i].dsFlatEdge - cf2_intToFixed( 1 ) );
+ }
+
+ else
+ {
+ /* simply round captured edge */
+ dsNew = cf2_fixedRound( bottomHintEdge->dsCoord );
+ }
+
+ dsMove = SUB_INT32( dsNew, bottomHintEdge->dsCoord );
+ captured = TRUE;
+
+ break;
+ }
+ }
+
+ if ( !blues->zone[i].bottomZone && cf2_hint_isTop( topHintEdge ) )
+ {
+ if ( SUB_INT32( blues->zone[i].csBottomEdge, csFuzz ) <=
+ topHintEdge->csCoord &&
+ topHintEdge->csCoord <=
+ ADD_INT32( blues->zone[i].csTopEdge, csFuzz ) )
+ {
+ /* top edge captured by top zone */
+
+ if ( blues->suppressOvershoot )
+ dsNew = blues->zone[i].dsFlatEdge;
+
+ else if ( SUB_INT32( topHintEdge->csCoord,
+ blues->zone[i].csBottomEdge ) >=
+ blues->blueShift )
+ {
+ /* guarantee minimum of 1 pixel overshoot */
+ dsNew = FT_MAX(
+ cf2_fixedRound( topHintEdge->dsCoord ),
+ blues->zone[i].dsFlatEdge + cf2_intToFixed( 1 ) );
+ }
+
+ else
+ {
+ /* simply round captured edge */
+ dsNew = cf2_fixedRound( topHintEdge->dsCoord );
+ }
+
+ dsMove = SUB_INT32( dsNew, topHintEdge->dsCoord );
+ captured = TRUE;
+
+ break;
+ }
+ }
+ }
+
+ if ( captured )
+ {
+ /* move both edges and flag them `locked' */
+ if ( cf2_hint_isValid( bottomHintEdge ) )
+ {
+ bottomHintEdge->dsCoord = ADD_INT32( bottomHintEdge->dsCoord,
+ dsMove );
+ cf2_hint_lock( bottomHintEdge );
+ }
+
+ if ( cf2_hint_isValid( topHintEdge ) )
+ {
+ topHintEdge->dsCoord = ADD_INT32( topHintEdge->dsCoord, dsMove );
+ cf2_hint_lock( topHintEdge );
+ }
+ }
+
+ return captured;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psblues.h b/thirdparty/freetype/src/psaux/psblues.h
new file mode 100644
index 0000000000..25ef6849c7
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psblues.h
@@ -0,0 +1,185 @@
+/***************************************************************************/
+/* */
+/* psblues.h */
+/* */
+/* Adobe's code for handling Blue Zones (specification). */
+/* */
+/* Copyright 2009-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+ /*
+ * A `CF2_Blues' object stores the blue zones (horizontal alignment
+ * zones) of a font. These are specified in the CFF private dictionary
+ * by `BlueValues', `OtherBlues', `FamilyBlues', and `FamilyOtherBlues'.
+ * Each zone is defined by a top and bottom edge in character space.
+ * Further, each zone is either a top zone or a bottom zone, as recorded
+ * by `bottomZone'.
+ *
+ * The maximum number of `BlueValues' and `FamilyBlues' is 7 each.
+ * However, these are combined to produce a total of 7 zones.
+ * Similarly, the maximum number of `OtherBlues' and `FamilyOtherBlues'
+ * is 5 and these are combined to produce an additional 5 zones.
+ *
+ * Blue zones are used to `capture' hints and force them to a common
+ * alignment point. This alignment is recorded in device space in
+ * `dsFlatEdge'. Except for this value, a `CF2_Blues' object could be
+ * constructed independently of scaling. Construction may occur once
+ * the matrix is known. Other features implemented in the Capture
+ * method are overshoot suppression, overshoot enforcement, and Blue
+ * Boost.
+ *
+ * Capture is determined by `BlueValues' and `OtherBlues', but the
+ * alignment point may be adjusted to the scaled flat edge of
+ * `FamilyBlues' or `FamilyOtherBlues'. No alignment is done to the
+ * curved edge of a zone.
+ *
+ */
+
+
+#ifndef PSBLUES_H_
+#define PSBLUES_H_
+
+
+#include "psglue.h"
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * `CF2_Hint' is shared by `cf2hints.h' and
+ * `cf2blues.h', but `cf2blues.h' depends on
+ * `cf2hints.h', so define it here. Note: The typedef is in
+ * `cf2glue.h'.
+ *
+ */
+ enum
+ {
+ CF2_GhostBottom = 0x1, /* a single bottom edge */
+ CF2_GhostTop = 0x2, /* a single top edge */
+ CF2_PairBottom = 0x4, /* the bottom edge of a stem hint */
+ CF2_PairTop = 0x8, /* the top edge of a stem hint */
+ CF2_Locked = 0x10, /* this edge has been aligned */
+ /* by a blue zone */
+ CF2_Synthetic = 0x20 /* this edge was synthesized */
+ };
+
+
+ /*
+ * Default value for OS/2 typoAscender/Descender when their difference
+ * is not equal to `unitsPerEm'. The default is based on -250 and 1100
+ * in `CF2_Blues', assuming 1000 units per em here.
+ *
+ */
+ enum
+ {
+ CF2_ICF_Top = cf2_intToFixed( 880 ),
+ CF2_ICF_Bottom = cf2_intToFixed( -120 )
+ };
+
+
+ /*
+ * Constant used for hint adjustment and for synthetic em box hint
+ * placement.
+ */
+#define CF2_MIN_COUNTER cf2_doubleToFixed( 0.5 )
+
+
+ /* shared typedef is in cf2glue.h */
+ struct CF2_HintRec_
+ {
+ CF2_UInt flags; /* attributes of the edge */
+ size_t index; /* index in original stem hint array */
+ /* (if not synthetic) */
+ CF2_Fixed csCoord;
+ CF2_Fixed dsCoord;
+ CF2_Fixed scale;
+ };
+
+
+ typedef struct CF2_BlueRec_
+ {
+ CF2_Fixed csBottomEdge;
+ CF2_Fixed csTopEdge;
+ CF2_Fixed csFlatEdge; /* may be from either local or Family zones */
+ CF2_Fixed dsFlatEdge; /* top edge of bottom zone or bottom edge */
+ /* of top zone (rounded) */
+ FT_Bool bottomZone;
+
+ } CF2_BlueRec;
+
+
+ /* max total blue zones is 12 */
+ enum
+ {
+ CF2_MAX_BLUES = 7,
+ CF2_MAX_OTHERBLUES = 5
+ };
+
+
+ typedef struct CF2_BluesRec_
+ {
+ CF2_Fixed scale;
+ CF2_UInt count;
+ FT_Bool suppressOvershoot;
+ FT_Bool doEmBoxHints;
+
+ CF2_Fixed blueScale;
+ CF2_Fixed blueShift;
+ CF2_Fixed blueFuzz;
+
+ CF2_Fixed boost;
+
+ CF2_HintRec emBoxTopEdge;
+ CF2_HintRec emBoxBottomEdge;
+
+ CF2_BlueRec zone[CF2_MAX_BLUES + CF2_MAX_OTHERBLUES];
+
+ } CF2_BluesRec, *CF2_Blues;
+
+
+ FT_LOCAL( void )
+ cf2_blues_init( CF2_Blues blues,
+ CF2_Font font );
+ FT_LOCAL( FT_Bool )
+ cf2_blues_capture( const CF2_Blues blues,
+ CF2_Hint bottomHintEdge,
+ CF2_Hint topHintEdge );
+
+
+FT_END_HEADER
+
+
+#endif /* PSBLUES_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psconv.c b/thirdparty/freetype/src/psaux/psconv.c
index d125b0834a..a03385000d 100644
--- a/thirdparty/freetype/src/psaux/psconv.c
+++ b/thirdparty/freetype/src/psaux/psconv.c
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/psconv.h b/thirdparty/freetype/src/psaux/psconv.h
index cab254ac5a..d643ffcfc2 100644
--- a/thirdparty/freetype/src/psaux/psconv.h
+++ b/thirdparty/freetype/src/psaux/psconv.h
@@ -4,7 +4,7 @@
/* */
/* Some convenience conversions (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/pserror.c b/thirdparty/freetype/src/psaux/pserror.c
new file mode 100644
index 0000000000..9169e5222d
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/pserror.c
@@ -0,0 +1,52 @@
+/***************************************************************************/
+/* */
+/* pserror.c */
+/* */
+/* Adobe's code for error handling (body). */
+/* */
+/* Copyright 2006-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include "pserror.h"
+
+
+ FT_LOCAL_DEF( void )
+ cf2_setError( FT_Error* error,
+ FT_Error value )
+ {
+ if ( error && !*error )
+ *error = value;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/pserror.h b/thirdparty/freetype/src/psaux/pserror.h
new file mode 100644
index 0000000000..13d52062bf
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/pserror.h
@@ -0,0 +1,119 @@
+/***************************************************************************/
+/* */
+/* pserror.h */
+/* */
+/* Adobe's code for error handling (specification). */
+/* */
+/* Copyright 2006-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSERROR_H_
+#define PSERROR_H_
+
+
+#include FT_MODULE_ERRORS_H
+
+#undef FTERRORS_H_
+
+#undef FT_ERR_PREFIX
+#define FT_ERR_PREFIX CF2_Err_
+#define FT_ERR_BASE FT_Mod_Err_CF2
+
+
+#include FT_ERRORS_H
+#include "psft.h"
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * A poor-man error facility.
+ *
+ * This code being written in vanilla C, doesn't have the luxury of a
+ * language-supported exception mechanism such as the one available in
+ * Java. Instead, we are stuck with using error codes that must be
+ * carefully managed and preserved. However, it is convenient for us to
+ * model our error mechanism on a Java-like exception mechanism.
+ * When we assign an error code we are thus `throwing' an error.
+ *
+ * The preservation of an error code is done by coding convention.
+ * Upon a function call if the error code is anything other than
+ * `FT_Err_Ok', which is guaranteed to be zero, we
+ * will return without altering that error. This will allow the
+ * error to propagate and be handled at the appropriate location in
+ * the code.
+ *
+ * This allows a style of code where the error code is initialized
+ * up front and a block of calls are made with the error code only
+ * being checked after the block. If a new error occurs, the original
+ * error will be preserved and a functional no-op should result in any
+ * subsequent function that has an initial error code not equal to
+ * `FT_Err_Ok'.
+ *
+ * Errors are encoded by calling the `FT_THROW' macro. For example,
+ *
+ * {
+ * FT_Error e;
+ *
+ *
+ * ...
+ * e = FT_THROW( Out_Of_Memory );
+ * }
+ *
+ */
+
+
+ /* Set error code to a particular value. */
+ FT_LOCAL( void )
+ cf2_setError( FT_Error* error,
+ FT_Error value );
+
+
+ /*
+ * A macro that conditionally sets an error code.
+ *
+ * This macro will first check whether `error' is set;
+ * if not, it will set it to `e'.
+ *
+ */
+#define CF2_SET_ERROR( error, e ) \
+ cf2_setError( error, FT_THROW( e ) )
+
+
+FT_END_HEADER
+
+
+#endif /* PSERROR_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psfixed.h b/thirdparty/freetype/src/psaux/psfixed.h
new file mode 100644
index 0000000000..219589e7fc
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psfixed.h
@@ -0,0 +1,95 @@
+/***************************************************************************/
+/* */
+/* psfixed.h */
+/* */
+/* Adobe's code for Fixed Point Mathematics (specification only). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSFIXED_H_
+#define PSFIXED_H_
+
+
+FT_BEGIN_HEADER
+
+
+ /* rasterizer integer and fixed point arithmetic must be 32-bit */
+
+#define CF2_Fixed CF2_F16Dot16
+ typedef FT_Int32 CF2_Frac; /* 2.30 fixed point */
+
+
+#define CF2_FIXED_MAX ( (CF2_Fixed)0x7FFFFFFFL )
+#define CF2_FIXED_MIN ( (CF2_Fixed)0x80000000L )
+#define CF2_FIXED_ONE ( (CF2_Fixed)0x10000L )
+#define CF2_FIXED_EPSILON ( (CF2_Fixed)0x0001 )
+
+ /* in C 89, left and right shift of negative numbers is */
+ /* implementation specific behaviour in the general case */
+
+#define cf2_intToFixed( i ) \
+ ( (CF2_Fixed)( (FT_UInt32)(i) << 16 ) )
+#define cf2_fixedToInt( x ) \
+ ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
+#define cf2_fixedRound( x ) \
+ ( (CF2_Fixed)( ( (FT_UInt32)(x) + 0x8000U ) & 0xFFFF0000UL ) )
+#define cf2_doubleToFixed( f ) \
+ ( (CF2_Fixed)( (f) * 65536.0 + 0.5 ) )
+#define cf2_fixedAbs( x ) \
+ ( (x) < 0 ? NEG_INT32( x ) : (x) )
+#define cf2_fixedFloor( x ) \
+ ( (CF2_Fixed)( (FT_UInt32)(x) & 0xFFFF0000UL ) )
+#define cf2_fixedFraction( x ) \
+ ( (x) - cf2_fixedFloor( x ) )
+#define cf2_fracToFixed( x ) \
+ ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 ) \
+ : ( ( (x) + 0x2000 ) >> 14 ) )
+
+
+ /* signed numeric types */
+ typedef enum CF2_NumberType_
+ {
+ CF2_NumberFixed, /* 16.16 */
+ CF2_NumberFrac, /* 2.30 */
+ CF2_NumberInt /* 32.0 */
+
+ } CF2_NumberType;
+
+
+FT_END_HEADER
+
+
+#endif /* PSFIXED_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psfont.c b/thirdparty/freetype/src/psaux/psfont.c
new file mode 100644
index 0000000000..dde67a739d
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psfont.c
@@ -0,0 +1,567 @@
+/***************************************************************************/
+/* */
+/* psfont.c */
+/* */
+/* Adobe's code for font instances (body). */
+/* */
+/* Copyright 2007-2014 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_CALC_H
+
+#include "psft.h"
+
+#include "psglue.h"
+#include "psfont.h"
+#include "pserror.h"
+#include "psintrp.h"
+
+
+ /* Compute a stem darkening amount in character space. */
+ static void
+ cf2_computeDarkening( CF2_Fixed emRatio,
+ CF2_Fixed ppem,
+ CF2_Fixed stemWidth,
+ CF2_Fixed* darkenAmount,
+ CF2_Fixed boldenAmount,
+ FT_Bool stemDarkened,
+ FT_Int* darkenParams )
+ {
+ /*
+ * Total darkening amount is computed in 1000 unit character space
+ * using the modified 5 part curve as Adobe's Avalon rasterizer.
+ * The darkening amount is smaller for thicker stems.
+ * It becomes zero when the stem is thicker than 2.333 pixels.
+ *
+ * By default, we use
+ *
+ * darkenAmount = 0.4 pixels if scaledStem <= 0.5 pixels,
+ * darkenAmount = 0.275 pixels if 1 <= scaledStem <= 1.667 pixels,
+ * darkenAmount = 0 pixel if scaledStem >= 2.333 pixels,
+ *
+ * and piecewise linear in-between:
+ *
+ *
+ * darkening
+ * ^
+ * |
+ * | (x1,y1)
+ * |--------+
+ * | \
+ * | \
+ * | \ (x3,y3)
+ * | +----------+
+ * | (x2,y2) \
+ * | \
+ * | \
+ * | +-----------------
+ * | (x4,y4)
+ * +---------------------------------------------> stem
+ * thickness
+ *
+ *
+ * This corresponds to the following values for the
+ * `darkening-parameters' property:
+ *
+ * (x1, y1) = (500, 400)
+ * (x2, y2) = (1000, 275)
+ * (x3, y3) = (1667, 275)
+ * (x4, y4) = (2333, 0)
+ *
+ */
+
+ /* Internal calculations are done in units per thousand for */
+ /* convenience. The x axis is scaled stem width in */
+ /* thousandths of a pixel. That is, 1000 is 1 pixel. */
+ /* The y axis is darkening amount in thousandths of a pixel.*/
+ /* In the code, below, dividing by ppem and */
+ /* adjusting for emRatio converts darkenAmount to character */
+ /* space (font units). */
+ CF2_Fixed stemWidthPer1000, scaledStem;
+ FT_Int logBase2;
+
+
+ *darkenAmount = 0;
+
+ if ( boldenAmount == 0 && !stemDarkened )
+ return;
+
+ /* protect against range problems and divide by zero */
+ if ( emRatio < cf2_doubleToFixed( .01 ) )
+ return;
+
+ if ( stemDarkened )
+ {
+ FT_Int x1 = darkenParams[0];
+ FT_Int y1 = darkenParams[1];
+ FT_Int x2 = darkenParams[2];
+ FT_Int y2 = darkenParams[3];
+ FT_Int x3 = darkenParams[4];
+ FT_Int y3 = darkenParams[5];
+ FT_Int x4 = darkenParams[6];
+ FT_Int y4 = darkenParams[7];
+
+
+ /* convert from true character space to 1000 unit character space; */
+ /* add synthetic emboldening effect */
+
+ /* `stemWidthPer1000' will not overflow for a legitimate font */
+
+ stemWidthPer1000 = FT_MulFix( stemWidth + boldenAmount, emRatio );
+
+ /* `scaledStem' can easily overflow, so we must clamp its maximum */
+ /* value; the test doesn't need to be precise, but must be */
+ /* conservative. The clamp value (default 2333) where */
+ /* `darkenAmount' is zero is well below the overflow value of */
+ /* 32767. */
+ /* */
+ /* FT_MSB computes the integer part of the base 2 logarithm. The */
+ /* number of bits for the product is 1 or 2 more than the sum of */
+ /* logarithms; remembering that the 16 lowest bits of the fraction */
+ /* are dropped this is correct to within a factor of almost 4. */
+ /* For example, 0x80.0000 * 0x80.0000 = 0x4000.0000 is 23+23 and */
+ /* is flagged as possible overflow because 0xFF.FFFF * 0xFF.FFFF = */
+ /* 0xFFFF.FE00 is also 23+23. */
+
+ logBase2 = FT_MSB( (FT_UInt32)stemWidthPer1000 ) +
+ FT_MSB( (FT_UInt32)ppem );
+
+ if ( logBase2 >= 46 )
+ /* possible overflow */
+ scaledStem = cf2_intToFixed( x4 );
+ else
+ scaledStem = FT_MulFix( stemWidthPer1000, ppem );
+
+ /* now apply the darkening parameters */
+
+ if ( scaledStem < cf2_intToFixed( x1 ) )
+ *darkenAmount = FT_DivFix( cf2_intToFixed( y1 ), ppem );
+
+ else if ( scaledStem < cf2_intToFixed( x2 ) )
+ {
+ FT_Int xdelta = x2 - x1;
+ FT_Int ydelta = y2 - y1;
+ FT_Int x = stemWidthPer1000 -
+ FT_DivFix( cf2_intToFixed( x1 ), ppem );
+
+
+ if ( !xdelta )
+ goto Try_x3;
+
+ *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+ FT_DivFix( cf2_intToFixed( y1 ), ppem );
+ }
+
+ else if ( scaledStem < cf2_intToFixed( x3 ) )
+ {
+ Try_x3:
+ {
+ FT_Int xdelta = x3 - x2;
+ FT_Int ydelta = y3 - y2;
+ FT_Int x = stemWidthPer1000 -
+ FT_DivFix( cf2_intToFixed( x2 ), ppem );
+
+
+ if ( !xdelta )
+ goto Try_x4;
+
+ *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+ FT_DivFix( cf2_intToFixed( y2 ), ppem );
+ }
+ }
+
+ else if ( scaledStem < cf2_intToFixed( x4 ) )
+ {
+ Try_x4:
+ {
+ FT_Int xdelta = x4 - x3;
+ FT_Int ydelta = y4 - y3;
+ FT_Int x = stemWidthPer1000 -
+ FT_DivFix( cf2_intToFixed( x3 ), ppem );
+
+
+ if ( !xdelta )
+ goto Use_y4;
+
+ *darkenAmount = FT_MulDiv( x, ydelta, xdelta ) +
+ FT_DivFix( cf2_intToFixed( y3 ), ppem );
+ }
+ }
+
+ else
+ {
+ Use_y4:
+ *darkenAmount = FT_DivFix( cf2_intToFixed( y4 ), ppem );
+ }
+
+ /* use half the amount on each side and convert back to true */
+ /* character space */
+ *darkenAmount = FT_DivFix( *darkenAmount, 2 * emRatio );
+ }
+
+ /* add synthetic emboldening effect in character space */
+ *darkenAmount += boldenAmount / 2;
+ }
+
+
+ /* set up values for the current FontDict and matrix; */
+ /* called for each glyph to be rendered */
+
+ /* caller's transform is adjusted for subpixel positioning */
+ static void
+ cf2_font_setup( CF2_Font font,
+ const CF2_Matrix* transform )
+ {
+ /* pointer to parsed font object */
+ PS_Decoder* decoder = font->decoder;
+
+ FT_Bool needExtraSetup = FALSE;
+
+ CFF_VStoreRec* vstore;
+ FT_Bool hasVariations = FALSE;
+
+ /* character space units */
+ CF2_Fixed boldenX = font->syntheticEmboldeningAmountX;
+ CF2_Fixed boldenY = font->syntheticEmboldeningAmountY;
+
+ CFF_SubFont subFont;
+ CF2_Fixed ppem;
+
+ CF2_UInt lenNormalizedV = 0;
+ FT_Fixed* normalizedV = NULL;
+
+ /* clear previous error */
+ font->error = FT_Err_Ok;
+
+ /* if a CID fontDict has changed, we need to recompute some cached */
+ /* data */
+ subFont = cf2_getSubfont( decoder );
+ if ( font->lastSubfont != subFont )
+ {
+ font->lastSubfont = subFont;
+ needExtraSetup = TRUE;
+ }
+
+ if ( !font->isT1 )
+ {
+ FT_Service_CFFLoad cffload = (FT_Service_CFFLoad)font->cffload;
+
+
+ /* check for variation vectors */
+ vstore = cf2_getVStore( decoder );
+ hasVariations = ( vstore->dataCount != 0 );
+
+ if ( hasVariations )
+ {
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* check whether Private DICT in this subfont needs to be reparsed */
+ font->error = cf2_getNormalizedVector( decoder,
+ &lenNormalizedV,
+ &normalizedV );
+ if ( font->error )
+ return;
+
+ if ( cffload->blend_check_vector( &subFont->blend,
+ subFont->private_dict.vsindex,
+ lenNormalizedV,
+ normalizedV ) )
+ {
+ /* blend has changed, reparse */
+ cffload->load_private_dict( decoder->cff,
+ subFont,
+ lenNormalizedV,
+ normalizedV );
+ needExtraSetup = TRUE;
+ }
+#endif
+
+ /* copy from subfont */
+ font->blend.font = subFont->blend.font;
+
+ /* clear state of charstring blend */
+ font->blend.usedBV = FALSE;
+
+ /* initialize value for charstring */
+ font->vsindex = subFont->private_dict.vsindex;
+
+ /* store vector inputs for blends in charstring */
+ font->lenNDV = lenNormalizedV;
+ font->NDV = normalizedV;
+ }
+ }
+
+ /* if ppem has changed, we need to recompute some cached data */
+ /* note: because of CID font matrix concatenation, ppem and transform */
+ /* do not necessarily track. */
+ ppem = cf2_getPpemY( decoder );
+ if ( font->ppem != ppem )
+ {
+ font->ppem = ppem;
+ needExtraSetup = TRUE;
+ }
+
+ /* copy hinted flag on each call */
+ font->hinted = (FT_Bool)( font->renderingFlags & CF2_FlagsHinted );
+
+ /* determine if transform has changed; */
+ /* include Fontmatrix but ignore translation */
+ if ( ft_memcmp( transform,
+ &font->currentTransform,
+ 4 * sizeof ( CF2_Fixed ) ) != 0 )
+ {
+ /* save `key' information for `cache of one' matrix data; */
+ /* save client transform, without the translation */
+ font->currentTransform = *transform;
+ font->currentTransform.tx =
+ font->currentTransform.ty = cf2_intToFixed( 0 );
+
+ /* TODO: FreeType transform is simple scalar; for now, use identity */
+ /* for outer */
+ font->innerTransform = *transform;
+ font->outerTransform.a =
+ font->outerTransform.d = cf2_intToFixed( 1 );
+ font->outerTransform.b =
+ font->outerTransform.c = cf2_intToFixed( 0 );
+
+ needExtraSetup = TRUE;
+ }
+
+ /*
+ * font->darkened is set to true if there is a stem darkening request or
+ * the font is synthetic emboldened.
+ * font->darkened controls whether to adjust blue zones, winding order,
+ * and hinting.
+ *
+ */
+ if ( font->stemDarkened != ( font->renderingFlags & CF2_FlagsDarkened ) )
+ {
+ font->stemDarkened =
+ (FT_Bool)( font->renderingFlags & CF2_FlagsDarkened );
+
+ /* blue zones depend on darkened flag */
+ needExtraSetup = TRUE;
+ }
+
+ /* recompute variables that are dependent on transform or FontDict or */
+ /* darken flag */
+ if ( needExtraSetup )
+ {
+ /* StdVW is found in the private dictionary; */
+ /* recompute darkening amounts whenever private dictionary or */
+ /* transform change */
+ /* Note: a rendering flag turns darkening on or off, so we want to */
+ /* store the `on' amounts; */
+ /* darkening amount is computed in character space */
+ /* TODO: testing size-dependent darkening here; */
+ /* what to do for rotations? */
+
+ CF2_Fixed emRatio;
+ CF2_Fixed stdHW;
+ CF2_Int unitsPerEm = font->unitsPerEm;
+
+
+ if ( unitsPerEm == 0 )
+ unitsPerEm = 1000;
+
+ ppem = FT_MAX( cf2_intToFixed( 4 ),
+ font->ppem ); /* use minimum ppem of 4 */
+
+#if 0
+ /* since vstem is measured in the x-direction, we use the `a' member */
+ /* of the fontMatrix */
+ emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->a );
+#endif
+
+ /* Freetype does not preserve the fontMatrix when parsing; use */
+ /* unitsPerEm instead. */
+ /* TODO: check precision of this */
+ emRatio = cf2_intToFixed( 1000 ) / unitsPerEm;
+ font->stdVW = cf2_getStdVW( decoder );
+
+ if ( font->stdVW <= 0 )
+ font->stdVW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );
+
+ if ( boldenX > 0 )
+ {
+ /* Ensure that boldenX is at least 1 pixel for synthetic bold font */
+ /* (similar to what Avalon does) */
+ boldenX = FT_MAX( boldenX,
+ FT_DivFix( cf2_intToFixed( unitsPerEm ), ppem ) );
+
+ /* Synthetic emboldening adds at least 1 pixel to darkenX, while */
+ /* stem darkening adds at most half pixel. Since the purpose of */
+ /* stem darkening (readability at small sizes) is met with */
+ /* synthetic emboldening, no need to add stem darkening for a */
+ /* synthetic bold font. */
+ cf2_computeDarkening( emRatio,
+ ppem,
+ font->stdVW,
+ &font->darkenX,
+ boldenX,
+ FALSE,
+ font->darkenParams );
+ }
+ else
+ cf2_computeDarkening( emRatio,
+ ppem,
+ font->stdVW,
+ &font->darkenX,
+ 0,
+ font->stemDarkened,
+ font->darkenParams );
+
+#if 0
+ /* since hstem is measured in the y-direction, we use the `d' member */
+ /* of the fontMatrix */
+ /* TODO: use the same units per em as above; check this */
+ emRatio = cf2_fixedFracMul( cf2_intToFixed( 1000 ), fontMatrix->d );
+#endif
+
+ /* set the default stem width, because it must be the same for all */
+ /* family members; */
+ /* choose a constant for StdHW that depends on font contrast */
+ stdHW = cf2_getStdHW( decoder );
+
+ if ( stdHW > 0 && font->stdVW > MUL_INT32( 2, stdHW ) )
+ font->stdHW = FT_DivFix( cf2_intToFixed( 75 ), emRatio );
+ else
+ {
+ /* low contrast font gets less hstem darkening */
+ font->stdHW = FT_DivFix( cf2_intToFixed( 110 ), emRatio );
+ }
+
+ cf2_computeDarkening( emRatio,
+ ppem,
+ font->stdHW,
+ &font->darkenY,
+ boldenY,
+ font->stemDarkened,
+ font->darkenParams );
+
+ if ( font->darkenX != 0 || font->darkenY != 0 )
+ font->darkened = TRUE;
+ else
+ font->darkened = FALSE;
+
+ font->reverseWinding = FALSE; /* initial expectation is CCW */
+
+ /* compute blue zones for this instance */
+ cf2_blues_init( &font->blues, font );
+
+ } /* needExtraSetup */
+ }
+
+
+ /* equivalent to AdobeGetOutline */
+ FT_LOCAL_DEF( FT_Error )
+ cf2_getGlyphOutline( CF2_Font font,
+ CF2_Buffer charstring,
+ const CF2_Matrix* transform,
+ CF2_F16Dot16* glyphWidth )
+ {
+ FT_Error lastError = FT_Err_Ok;
+
+ FT_Vector translation;
+
+#if 0
+ FT_Vector advancePoint;
+#endif
+
+ CF2_Fixed advWidth = 0;
+ FT_Bool needWinding;
+
+
+ /* Note: use both integer and fraction for outlines. This allows bbox */
+ /* to come out directly. */
+
+ translation.x = transform->tx;
+ translation.y = transform->ty;
+
+ /* set up values based on transform */
+ cf2_font_setup( font, transform );
+ if ( font->error )
+ goto exit; /* setup encountered an error */
+
+ /* reset darken direction */
+ font->reverseWinding = FALSE;
+
+ /* winding order only affects darkening */
+ needWinding = font->darkened;
+
+ while ( 1 )
+ {
+ /* reset output buffer */
+ cf2_outline_reset( &font->outline );
+
+ /* build the outline, passing the full translation */
+ cf2_interpT2CharString( font,
+ charstring,
+ (CF2_OutlineCallbacks)&font->outline,
+ &translation,
+ FALSE,
+ 0,
+ 0,
+ &advWidth );
+
+ if ( font->error )
+ goto exit;
+
+ if ( !needWinding )
+ break;
+
+ /* check winding order */
+ if ( font->outline.root.windingMomentum >= 0 ) /* CFF is CCW */
+ break;
+
+ /* invert darkening and render again */
+ /* TODO: this should be a parameter to getOutline-computeOffset */
+ font->reverseWinding = TRUE;
+
+ needWinding = FALSE; /* exit after next iteration */
+ }
+
+ /* finish storing client outline */
+ cf2_outline_close( &font->outline );
+
+ exit:
+ /* FreeType just wants the advance width; there is no translation */
+ *glyphWidth = advWidth;
+
+ /* free resources and collect errors from objects we've used */
+ cf2_setError( &font->error, lastError );
+
+ return font->error;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psfont.h b/thirdparty/freetype/src/psaux/psfont.h
new file mode 100644
index 0000000000..e611ac4bdc
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psfont.h
@@ -0,0 +1,134 @@
+/***************************************************************************/
+/* */
+/* psfont.h */
+/* */
+/* Adobe's code for font instances (specification). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSFONT_H_
+#define PSFONT_H_
+
+
+#include FT_SERVICE_CFF_TABLE_LOAD_H
+
+#include "psft.h"
+#include "psblues.h"
+
+
+FT_BEGIN_HEADER
+
+
+#define CF2_OPERAND_STACK_SIZE 48
+#define CF2_MAX_SUBR 16 /* maximum subroutine nesting; */
+ /* only 10 are allowed but there exist */
+ /* fonts like `HiraKakuProN-W3.ttf' */
+ /* (Hiragino Kaku Gothic ProN W3; */
+ /* 8.2d6e1; 2014-12-19) that exceed */
+ /* this limit */
+#define CF2_STORAGE_SIZE 32
+
+
+ /* typedef is in `cf2glue.h' */
+ struct CF2_FontRec_
+ {
+ FT_Memory memory;
+ FT_Error error; /* shared error for this instance */
+
+ FT_Bool isT1;
+ FT_Bool isCFF2;
+ CF2_RenderingFlags renderingFlags;
+
+ /* variables that depend on Transform: */
+ /* the following have zero translation; */
+ /* inner * outer = font * original */
+
+ CF2_Matrix currentTransform; /* original client matrix */
+ CF2_Matrix innerTransform; /* for hinting; erect, scaled */
+ CF2_Matrix outerTransform; /* post hinting; includes rotations */
+ CF2_Fixed ppem; /* transform-dependent */
+
+ /* variation data */
+ CFF_BlendRec blend; /* cached charstring blend vector */
+ CF2_UInt vsindex; /* current vsindex */
+ CF2_UInt lenNDV; /* current length NDV or zero */
+ FT_Fixed* NDV; /* ptr to current NDV or NULL */
+
+ CF2_Int unitsPerEm;
+
+ CF2_Fixed syntheticEmboldeningAmountX; /* character space units */
+ CF2_Fixed syntheticEmboldeningAmountY; /* character space units */
+
+ /* FreeType related members */
+ CF2_OutlineRec outline; /* freetype glyph outline functions */
+ PS_Decoder* decoder;
+ CFF_SubFont lastSubfont; /* FreeType parsed data; */
+ /* top font or subfont */
+
+ /* these flags can vary from one call to the next */
+ FT_Bool hinted;
+ FT_Bool darkened; /* true if stemDarkened or synthetic bold */
+ /* i.e. darkenX != 0 || darkenY != 0 */
+ FT_Bool stemDarkened;
+
+ FT_Int darkenParams[8]; /* 1000 unit character space */
+
+ /* variables that depend on both FontDict and Transform */
+ CF2_Fixed stdVW; /* in character space; depends on dict entry */
+ CF2_Fixed stdHW; /* in character space; depends on dict entry */
+ CF2_Fixed darkenX; /* character space units */
+ CF2_Fixed darkenY; /* depends on transform */
+ /* and private dict (StdVW) */
+ FT_Bool reverseWinding; /* darken assuming */
+ /* counterclockwise winding */
+
+ CF2_BluesRec blues; /* computed zone data */
+
+ FT_Service_CFFLoad cffload; /* pointer to cff functions */
+ };
+
+
+ FT_LOCAL( FT_Error )
+ cf2_getGlyphOutline( CF2_Font font,
+ CF2_Buffer charstring,
+ const CF2_Matrix* transform,
+ CF2_F16Dot16* glyphWidth );
+
+
+FT_END_HEADER
+
+
+#endif /* PSFONT_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psft.c b/thirdparty/freetype/src/psaux/psft.c
new file mode 100644
index 0000000000..1f750174a1
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psft.c
@@ -0,0 +1,890 @@
+/***************************************************************************/
+/* */
+/* psft.c */
+/* */
+/* FreeType Glue Component to Adobe's Interpreter (body). */
+/* */
+/* Copyright 2013-2014 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psfont.h"
+#include "pserror.h"
+#include "psobjs.h"
+#include "cffdecode.h"
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#include FT_MULTIPLE_MASTERS_H
+#include FT_SERVICE_MULTIPLE_MASTERS_H
+#endif
+
+#include FT_SERVICE_CFF_TABLE_LOAD_H
+
+
+#define CF2_MAX_SIZE cf2_intToFixed( 2000 ) /* max ppem */
+
+
+ /*
+ * This check should avoid most internal overflow cases. Clients should
+ * generally respond to `Glyph_Too_Big' by getting a glyph outline
+ * at EM size, scaling it and filling it as a graphics operation.
+ *
+ */
+ static FT_Error
+ cf2_checkTransform( const CF2_Matrix* transform,
+ CF2_Int unitsPerEm )
+ {
+ CF2_Fixed maxScale;
+
+
+ FT_ASSERT( unitsPerEm > 0 );
+
+ if ( transform->a <= 0 || transform->d <= 0 )
+ return FT_THROW( Invalid_Size_Handle );
+
+ FT_ASSERT( transform->b == 0 && transform->c == 0 );
+ FT_ASSERT( transform->tx == 0 && transform->ty == 0 );
+
+ if ( unitsPerEm > 0x7FFF )
+ return FT_THROW( Glyph_Too_Big );
+
+ maxScale = FT_DivFix( CF2_MAX_SIZE, cf2_intToFixed( unitsPerEm ) );
+
+ if ( transform->a > maxScale || transform->d > maxScale )
+ return FT_THROW( Glyph_Too_Big );
+
+ return FT_Err_Ok;
+ }
+
+
+ static void
+ cf2_setGlyphWidth( CF2_Outline outline,
+ CF2_Fixed width )
+ {
+ PS_Decoder* decoder = outline->decoder;
+
+
+ FT_ASSERT( decoder );
+
+ if ( !decoder->builder.is_t1 )
+ *decoder->glyph_width = cf2_fixedToInt( width );
+ }
+
+
+ /* Clean up font instance. */
+ static void
+ cf2_free_instance( void* ptr )
+ {
+ CF2_Font font = (CF2_Font)ptr;
+
+
+ if ( font )
+ {
+ FT_Memory memory = font->memory;
+
+
+ FT_FREE( font->blend.lastNDV );
+ FT_FREE( font->blend.BV );
+ }
+ }
+
+
+ /********************************************/
+ /* */
+ /* functions for handling client outline; */
+ /* FreeType uses coordinates in 26.6 format */
+ /* */
+ /********************************************/
+
+ static void
+ cf2_builder_moveTo( CF2_OutlineCallbacks callbacks,
+ const CF2_CallbackParams params )
+ {
+ /* downcast the object pointer */
+ CF2_Outline outline = (CF2_Outline)callbacks;
+ PS_Builder* builder;
+
+ (void)params; /* only used in debug mode */
+
+
+ FT_ASSERT( outline && outline->decoder );
+ FT_ASSERT( params->op == CF2_PathOpMoveTo );
+
+ builder = &outline->decoder->builder;
+
+ /* note: two successive moves simply close the contour twice */
+ ps_builder_close_contour( builder );
+ builder->path_begun = 0;
+ }
+
+
+ static void
+ cf2_builder_lineTo( CF2_OutlineCallbacks callbacks,
+ const CF2_CallbackParams params )
+ {
+ FT_Error error;
+
+ /* downcast the object pointer */
+ CF2_Outline outline = (CF2_Outline)callbacks;
+ PS_Builder* builder;
+
+
+ FT_ASSERT( outline && outline->decoder );
+ FT_ASSERT( params->op == CF2_PathOpLineTo );
+
+ builder = &outline->decoder->builder;
+
+ if ( !builder->path_begun )
+ {
+ /* record the move before the line; also check points and set */
+ /* `path_begun' */
+ error = ps_builder_start_point( builder,
+ params->pt0.x,
+ params->pt0.y );
+ if ( error )
+ {
+ if ( !*callbacks->error )
+ *callbacks->error = error;
+ return;
+ }
+ }
+
+ /* `ps_builder_add_point1' includes a check_points call for one point */
+ error = ps_builder_add_point1( builder,
+ params->pt1.x,
+ params->pt1.y );
+ if ( error )
+ {
+ if ( !*callbacks->error )
+ *callbacks->error = error;
+ return;
+ }
+ }
+
+
+ static void
+ cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks,
+ const CF2_CallbackParams params )
+ {
+ FT_Error error;
+
+ /* downcast the object pointer */
+ CF2_Outline outline = (CF2_Outline)callbacks;
+ PS_Builder* builder;
+
+
+ FT_ASSERT( outline && outline->decoder );
+ FT_ASSERT( params->op == CF2_PathOpCubeTo );
+
+ builder = &outline->decoder->builder;
+
+ if ( !builder->path_begun )
+ {
+ /* record the move before the line; also check points and set */
+ /* `path_begun' */
+ error = ps_builder_start_point( builder,
+ params->pt0.x,
+ params->pt0.y );
+ if ( error )
+ {
+ if ( !*callbacks->error )
+ *callbacks->error = error;
+ return;
+ }
+ }
+
+ /* prepare room for 3 points: 2 off-curve, 1 on-curve */
+ error = ps_builder_check_points( builder, 3 );
+ if ( error )
+ {
+ if ( !*callbacks->error )
+ *callbacks->error = error;
+ return;
+ }
+
+ ps_builder_add_point( builder,
+ params->pt1.x,
+ params->pt1.y, 0 );
+ ps_builder_add_point( builder,
+ params->pt2.x,
+ params->pt2.y, 0 );
+ ps_builder_add_point( builder,
+ params->pt3.x,
+ params->pt3.y, 1 );
+ }
+
+
+ static void
+ cf2_outline_init( CF2_Outline outline,
+ FT_Memory memory,
+ FT_Error* error )
+ {
+ FT_ZERO( outline );
+
+ outline->root.memory = memory;
+ outline->root.error = error;
+
+ outline->root.moveTo = cf2_builder_moveTo;
+ outline->root.lineTo = cf2_builder_lineTo;
+ outline->root.cubeTo = cf2_builder_cubeTo;
+ }
+
+
+ /* get scaling and hint flag from GlyphSlot */
+ static void
+ cf2_getScaleAndHintFlag( PS_Decoder* decoder,
+ CF2_Fixed* x_scale,
+ CF2_Fixed* y_scale,
+ FT_Bool* hinted,
+ FT_Bool* scaled )
+ {
+ FT_ASSERT( decoder && decoder->builder.glyph );
+
+ /* note: FreeType scale includes a factor of 64 */
+ *hinted = decoder->builder.glyph->hint;
+ *scaled = decoder->builder.glyph->scaled;
+
+ if ( *hinted )
+ {
+ *x_scale = ADD_INT32( decoder->builder.glyph->x_scale, 32 ) / 64;
+ *y_scale = ADD_INT32( decoder->builder.glyph->y_scale, 32 ) / 64;
+ }
+ else
+ {
+ /* for unhinted outlines, `cff_slot_load' does the scaling, */
+ /* thus render at `unity' scale */
+
+ *x_scale = 0x0400; /* 1/64 as 16.16 */
+ *y_scale = 0x0400;
+ }
+ }
+
+
+ /* get units per em from `FT_Face' */
+ /* TODO: should handle font matrix concatenation? */
+ static FT_UShort
+ cf2_getUnitsPerEm( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->builder.face );
+ FT_ASSERT( decoder->builder.face->units_per_EM );
+
+ return decoder->builder.face->units_per_EM;
+ }
+
+
+ /* Main entry point: Render one glyph. */
+ FT_LOCAL_DEF( FT_Error )
+ cf2_decoder_parse_charstrings( PS_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len )
+ {
+ FT_Memory memory;
+ FT_Error error = FT_Err_Ok;
+ CF2_Font font;
+
+ FT_Bool is_t1 = decoder->builder.is_t1;
+
+
+ FT_ASSERT( decoder &&
+ ( is_t1 || decoder->cff ) );
+
+ if ( is_t1 && !decoder->current_subfont )
+ {
+ FT_ERROR(( "cf2_decoder_parse_charstrings (Type 1): "
+ "SubFont missing. Use `t1_make_subfont' first\n" ));
+ return FT_THROW( Invalid_Table );
+ }
+
+ memory = decoder->builder.memory;
+
+ /* CF2 data is saved here across glyphs */
+ font = (CF2_Font)decoder->cf2_instance->data;
+
+ /* on first glyph, allocate instance structure */
+ if ( !decoder->cf2_instance->data )
+ {
+ decoder->cf2_instance->finalizer =
+ (FT_Generic_Finalizer)cf2_free_instance;
+
+ if ( FT_ALLOC( decoder->cf2_instance->data,
+ sizeof ( CF2_FontRec ) ) )
+ return FT_THROW( Out_Of_Memory );
+
+ font = (CF2_Font)decoder->cf2_instance->data;
+
+ font->memory = memory;
+
+ if ( !is_t1 )
+ font->cffload = (FT_Service_CFFLoad)decoder->cff->cffload;
+
+ /* initialize a client outline, to be shared by each glyph rendered */
+ cf2_outline_init( &font->outline, font->memory, &font->error );
+ }
+
+ /* save decoder; it is a stack variable and will be different on each */
+ /* call */
+ font->decoder = decoder;
+ font->outline.decoder = decoder;
+
+ {
+ /* build parameters for Adobe engine */
+
+ PS_Builder* builder = &decoder->builder;
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face );
+
+ FT_Bool no_stem_darkening_driver =
+ driver->no_stem_darkening;
+ FT_Char no_stem_darkening_font =
+ builder->face->internal->no_stem_darkening;
+
+ /* local error */
+ FT_Error error2 = FT_Err_Ok;
+ CF2_BufferRec buf;
+ CF2_Matrix transform;
+ CF2_F16Dot16 glyphWidth;
+
+ FT_Bool hinted;
+ FT_Bool scaled;
+
+
+ /* FreeType has already looked up the GID; convert to */
+ /* `RegionBuffer', assuming that the input has been validated */
+ FT_ASSERT( charstring_base + charstring_len >= charstring_base );
+
+ FT_ZERO( &buf );
+ buf.start =
+ buf.ptr = charstring_base;
+ buf.end = charstring_base + charstring_len;
+
+ FT_ZERO( &transform );
+
+ cf2_getScaleAndHintFlag( decoder,
+ &transform.a,
+ &transform.d,
+ &hinted,
+ &scaled );
+
+ if ( is_t1 )
+ font->isCFF2 = FALSE;
+ else
+ {
+ /* copy isCFF2 boolean from TT_Face to CF2_Font */
+ font->isCFF2 = ((TT_Face)builder->face)->is_cff2;
+ }
+ font->isT1 = is_t1;
+
+ font->renderingFlags = 0;
+ if ( hinted )
+ font->renderingFlags |= CF2_FlagsHinted;
+ if ( scaled && ( !no_stem_darkening_font ||
+ ( no_stem_darkening_font < 0 &&
+ !no_stem_darkening_driver ) ) )
+ font->renderingFlags |= CF2_FlagsDarkened;
+
+ font->darkenParams[0] = driver->darken_params[0];
+ font->darkenParams[1] = driver->darken_params[1];
+ font->darkenParams[2] = driver->darken_params[2];
+ font->darkenParams[3] = driver->darken_params[3];
+ font->darkenParams[4] = driver->darken_params[4];
+ font->darkenParams[5] = driver->darken_params[5];
+ font->darkenParams[6] = driver->darken_params[6];
+ font->darkenParams[7] = driver->darken_params[7];
+
+ /* now get an outline for this glyph; */
+ /* also get units per em to validate scale */
+ font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder );
+
+ if ( scaled )
+ {
+ error2 = cf2_checkTransform( &transform, font->unitsPerEm );
+ if ( error2 )
+ return error2;
+ }
+
+ error2 = cf2_getGlyphOutline( font, &buf, &transform, &glyphWidth );
+ if ( error2 )
+ return FT_ERR( Invalid_File_Format );
+
+ cf2_setGlyphWidth( &font->outline, glyphWidth );
+
+ return FT_Err_Ok;
+ }
+ }
+
+
+ /* get pointer to current FreeType subfont (based on current glyphID) */
+ FT_LOCAL_DEF( CFF_SubFont )
+ cf2_getSubfont( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return decoder->current_subfont;
+ }
+
+
+ /* get pointer to VStore structure */
+ FT_LOCAL_DEF( CFF_VStore )
+ cf2_getVStore( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->cff );
+
+ return &decoder->cff->vstore;
+ }
+
+
+ /* get maxstack value from CFF2 Top DICT */
+ FT_LOCAL_DEF( FT_UInt )
+ cf2_getMaxstack( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->cff );
+
+ return decoder->cff->top_font.font_dict.maxstack;
+ }
+
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* Get normalized design vector for current render request; */
+ /* return pointer and length. */
+ /* */
+ /* Note: Uses FT_Fixed not CF2_Fixed for the vector. */
+ FT_LOCAL_DEF( FT_Error )
+ cf2_getNormalizedVector( PS_Decoder* decoder,
+ CF2_UInt *len,
+ FT_Fixed* *vec )
+ {
+ TT_Face face;
+ FT_Service_MultiMasters mm;
+
+
+ FT_ASSERT( decoder && decoder->builder.face );
+ FT_ASSERT( vec && len );
+ FT_ASSERT( !decoder->builder.is_t1 );
+
+ face = (TT_Face)decoder->builder.face;
+ mm = (FT_Service_MultiMasters)face->mm;
+
+ return mm->get_var_blend( FT_FACE( face ), len, NULL, vec, NULL );
+ }
+#endif
+
+
+ /* get `y_ppem' from `CFF_Size' */
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_getPpemY( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder &&
+ decoder->builder.face &&
+ decoder->builder.face->size );
+
+ /*
+ * Note that `y_ppem' can be zero if there wasn't a call to
+ * `FT_Set_Char_Size' or something similar. However, this isn't a
+ * problem since we come to this place in the code only if
+ * FT_LOAD_NO_SCALE is set (the other case gets caught by
+ * `cf2_checkTransform'). The ppem value is needed to compute the stem
+ * darkening, which is disabled for getting the unscaled outline.
+ *
+ */
+ return cf2_intToFixed(
+ decoder->builder.face->size->metrics.y_ppem );
+ }
+
+
+ /* get standard stem widths for the current subfont; */
+ /* FreeType stores these as integer font units */
+ /* (note: variable names seem swapped) */
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_getStdVW( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return cf2_intToFixed(
+ decoder->current_subfont->private_dict.standard_height );
+ }
+
+
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_getStdHW( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return cf2_intToFixed(
+ decoder->current_subfont->private_dict.standard_width );
+ }
+
+
+ /* note: FreeType stores 1000 times the actual value for `BlueScale' */
+ FT_LOCAL_DEF( void )
+ cf2_getBlueMetrics( PS_Decoder* decoder,
+ CF2_Fixed* blueScale,
+ CF2_Fixed* blueShift,
+ CF2_Fixed* blueFuzz )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ *blueScale = FT_DivFix(
+ decoder->current_subfont->private_dict.blue_scale,
+ cf2_intToFixed( 1000 ) );
+ *blueShift = cf2_intToFixed(
+ decoder->current_subfont->private_dict.blue_shift );
+ *blueFuzz = cf2_intToFixed(
+ decoder->current_subfont->private_dict.blue_fuzz );
+ }
+
+
+ /* get blue values counts and arrays; the FreeType parser has validated */
+ /* the counts and verified that each is an even number */
+ FT_LOCAL_DEF( void )
+ cf2_getBlueValues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ *count = decoder->current_subfont->private_dict.num_blue_values;
+ *data = (FT_Pos*)
+ &decoder->current_subfont->private_dict.blue_values;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_getOtherBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ *count = decoder->current_subfont->private_dict.num_other_blues;
+ *data = (FT_Pos*)
+ &decoder->current_subfont->private_dict.other_blues;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_getFamilyBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ *count = decoder->current_subfont->private_dict.num_family_blues;
+ *data = (FT_Pos*)
+ &decoder->current_subfont->private_dict.family_blues;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_getFamilyOtherBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ *count = decoder->current_subfont->private_dict.num_family_other_blues;
+ *data = (FT_Pos*)
+ &decoder->current_subfont->private_dict.family_other_blues;
+ }
+
+
+ FT_LOCAL_DEF( CF2_Int )
+ cf2_getLanguageGroup( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return decoder->current_subfont->private_dict.language_group;
+ }
+
+
+ /* convert unbiased subroutine index to `CF2_Buffer' and */
+ /* return 0 on success */
+ FT_LOCAL_DEF( CF2_Int )
+ cf2_initGlobalRegionBuffer( PS_Decoder* decoder,
+ CF2_Int subrNum,
+ CF2_Buffer buf )
+ {
+ CF2_UInt idx;
+
+
+ FT_ASSERT( decoder );
+
+ FT_ZERO( buf );
+
+ idx = (CF2_UInt)( subrNum + decoder->globals_bias );
+ if ( idx >= decoder->num_globals )
+ return TRUE; /* error */
+
+ FT_ASSERT( decoder->globals );
+
+ buf->start =
+ buf->ptr = decoder->globals[idx];
+ buf->end = decoder->globals[idx + 1];
+
+ return FALSE; /* success */
+ }
+
+
+ /* convert AdobeStandardEncoding code to CF2_Buffer; */
+ /* used for seac component */
+ FT_LOCAL_DEF( FT_Error )
+ cf2_getSeacComponent( PS_Decoder* decoder,
+ CF2_Int code,
+ CF2_Buffer buf )
+ {
+ CF2_Int gid;
+ FT_Byte* charstring;
+ FT_ULong len;
+ FT_Error error;
+
+
+ FT_ASSERT( decoder );
+ FT_ASSERT( !decoder->builder.is_t1 );
+
+ FT_ZERO( buf );
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ /* Incremental fonts don't necessarily have valid charsets. */
+ /* They use the character code, not the glyph index, in this case. */
+ if ( decoder->builder.face->internal->incremental_interface )
+ gid = code;
+ else
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ gid = cff_lookup_glyph_by_stdcharcode( decoder->cff, code );
+ if ( gid < 0 )
+ return FT_THROW( Invalid_Glyph_Format );
+ }
+
+ error = decoder->get_glyph_callback( (TT_Face)decoder->builder.face,
+ (CF2_UInt)gid,
+ &charstring,
+ &len );
+ /* TODO: for now, just pass the FreeType error through */
+ if ( error )
+ return error;
+
+ /* assume input has been validated */
+ FT_ASSERT( charstring + len >= charstring );
+
+ buf->start = charstring;
+ buf->end = charstring + len;
+ buf->ptr = buf->start;
+
+ return FT_Err_Ok;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_freeSeacComponent( PS_Decoder* decoder,
+ CF2_Buffer buf )
+ {
+ FT_ASSERT( decoder );
+ FT_ASSERT( !decoder->builder.is_t1 );
+
+ decoder->free_glyph_callback( (TT_Face)decoder->builder.face,
+ (FT_Byte**)&buf->start,
+ (FT_ULong)( buf->end - buf->start ) );
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ cf2_getT1SeacComponent( PS_Decoder* decoder,
+ FT_UInt glyph_index,
+ CF2_Buffer buf )
+ {
+ FT_Data glyph_data;
+ FT_Error error = FT_Err_Ok;
+ T1_Face face = (T1_Face)decoder->builder.face;
+ T1_Font type1 = &face->type1;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ FT_Incremental_InterfaceRec *inc =
+ face->root.internal->incremental_interface;
+
+
+ /* For incremental fonts get the character data using the */
+ /* callback function. */
+ if ( inc )
+ error = inc->funcs->get_glyph_data( inc->object,
+ glyph_index, &glyph_data );
+ else
+#endif
+ /* For ordinary fonts get the character data stored in the face record. */
+ {
+ glyph_data.pointer = type1->charstrings[glyph_index];
+ glyph_data.length = (FT_Int)type1->charstrings_len[glyph_index];
+ }
+
+ if ( !error )
+ {
+ FT_Byte* charstring_base = (FT_Byte*)glyph_data.pointer;
+ FT_ULong charstring_len = (FT_ULong)glyph_data.length;
+
+
+ FT_ASSERT( charstring_base + charstring_len >= charstring_base );
+
+ FT_ZERO( buf );
+ buf->start =
+ buf->ptr = charstring_base;
+ buf->end = charstring_base + charstring_len;
+ }
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_freeT1SeacComponent( PS_Decoder* decoder,
+ CF2_Buffer buf )
+ {
+ T1_Face face;
+ FT_Data data;
+
+
+ FT_ASSERT( decoder );
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ face = (T1_Face)decoder->builder.face;
+
+ data.pointer = buf->start;
+ data.length = (FT_Int)( buf->end - buf->start );
+
+ if ( face->root.internal->incremental_interface )
+ face->root.internal->incremental_interface->funcs->free_glyph_data(
+ face->root.internal->incremental_interface->object,
+ &data );
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ }
+
+
+ FT_LOCAL_DEF( CF2_Int )
+ cf2_initLocalRegionBuffer( PS_Decoder* decoder,
+ CF2_Int subrNum,
+ CF2_Buffer buf )
+ {
+ CF2_UInt idx;
+
+
+ FT_ASSERT( decoder );
+
+ FT_ZERO( buf );
+
+ idx = (CF2_UInt)( subrNum + decoder->locals_bias );
+ if ( idx >= decoder->num_locals )
+ return TRUE; /* error */
+
+ FT_ASSERT( decoder->locals );
+
+ buf->start = decoder->locals[idx];
+
+ if ( decoder->builder.is_t1 )
+ {
+ /* The Type 1 driver stores subroutines without the seed bytes. */
+ /* The CID driver stores subroutines with seed bytes. This */
+ /* case is taken care of when decoder->subrs_len == 0. */
+ if ( decoder->locals_len )
+ buf->end = buf->start + decoder->locals_len[idx];
+ else
+ {
+ /* We are using subroutines from a CID font. We must adjust */
+ /* for the seed bytes. */
+ buf->start += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
+ buf->end = decoder->locals[idx + 1];
+ }
+
+ if ( !buf->start )
+ {
+ FT_ERROR(( "cf2_initLocalRegionBuffer (Type 1 mode):"
+ " invoking empty subrs\n" ));
+ }
+ }
+ else
+ {
+ buf->end = decoder->locals[idx + 1];
+ }
+
+ buf->ptr = buf->start;
+
+ return FALSE; /* success */
+ }
+
+
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_getDefaultWidthX( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return cf2_intToFixed(
+ decoder->current_subfont->private_dict.default_width );
+ }
+
+
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_getNominalWidthX( PS_Decoder* decoder )
+ {
+ FT_ASSERT( decoder && decoder->current_subfont );
+
+ return cf2_intToFixed(
+ decoder->current_subfont->private_dict.nominal_width );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_outline_reset( CF2_Outline outline )
+ {
+ PS_Decoder* decoder = outline->decoder;
+
+
+ FT_ASSERT( decoder );
+
+ outline->root.windingMomentum = 0;
+
+ FT_GlyphLoader_Rewind( decoder->builder.loader );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_outline_close( CF2_Outline outline )
+ {
+ PS_Decoder* decoder = outline->decoder;
+
+
+ FT_ASSERT( decoder );
+
+ ps_builder_close_contour( &decoder->builder );
+
+ FT_GlyphLoader_Add( decoder->builder.loader );
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psft.h b/thirdparty/freetype/src/psaux/psft.h
new file mode 100644
index 0000000000..ab172110bb
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psft.h
@@ -0,0 +1,167 @@
+/***************************************************************************/
+/* */
+/* psft.h */
+/* */
+/* FreeType Glue Component to Adobe's Interpreter (specification). */
+/* */
+/* Copyright 2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSFT_H_
+#define PSFT_H_
+
+
+#include "pstypes.h"
+
+
+ /* TODO: disable asserts for now */
+#define CF2_NDEBUG
+
+
+#include FT_SYSTEM_H
+
+#include "psglue.h"
+#include FT_INTERNAL_POSTSCRIPT_AUX_H /* for PS_Decoder */
+
+
+FT_BEGIN_HEADER
+
+
+ FT_LOCAL( FT_Error )
+ cf2_decoder_parse_charstrings( PS_Decoder* decoder,
+ FT_Byte* charstring_base,
+ FT_ULong charstring_len );
+
+ FT_LOCAL( CFF_SubFont )
+ cf2_getSubfont( PS_Decoder* decoder );
+
+ FT_LOCAL( CFF_VStore )
+ cf2_getVStore( PS_Decoder* decoder );
+
+ FT_LOCAL( FT_UInt )
+ cf2_getMaxstack( PS_Decoder* decoder );
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ FT_LOCAL( FT_Error )
+ cf2_getNormalizedVector( PS_Decoder* decoder,
+ CF2_UInt *len,
+ FT_Fixed* *vec );
+#endif
+
+ FT_LOCAL( CF2_Fixed )
+ cf2_getPpemY( PS_Decoder* decoder );
+ FT_LOCAL( CF2_Fixed )
+ cf2_getStdVW( PS_Decoder* decoder );
+ FT_LOCAL( CF2_Fixed )
+ cf2_getStdHW( PS_Decoder* decoder );
+
+ FT_LOCAL( void )
+ cf2_getBlueMetrics( PS_Decoder* decoder,
+ CF2_Fixed* blueScale,
+ CF2_Fixed* blueShift,
+ CF2_Fixed* blueFuzz );
+ FT_LOCAL( void )
+ cf2_getBlueValues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data );
+ FT_LOCAL( void )
+ cf2_getOtherBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data );
+ FT_LOCAL( void )
+ cf2_getFamilyBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data );
+ FT_LOCAL( void )
+ cf2_getFamilyOtherBlues( PS_Decoder* decoder,
+ size_t* count,
+ FT_Pos* *data );
+
+ FT_LOCAL( CF2_Int )
+ cf2_getLanguageGroup( PS_Decoder* decoder );
+
+ FT_LOCAL( CF2_Int )
+ cf2_initGlobalRegionBuffer( PS_Decoder* decoder,
+ CF2_Int subrNum,
+ CF2_Buffer buf );
+ FT_LOCAL( FT_Error )
+ cf2_getSeacComponent( PS_Decoder* decoder,
+ CF2_Int code,
+ CF2_Buffer buf );
+ FT_LOCAL( void )
+ cf2_freeSeacComponent( PS_Decoder* decoder,
+ CF2_Buffer buf );
+ FT_LOCAL( CF2_Int )
+ cf2_initLocalRegionBuffer( PS_Decoder* decoder,
+ CF2_Int subrNum,
+ CF2_Buffer buf );
+
+ FT_LOCAL( CF2_Fixed )
+ cf2_getDefaultWidthX( PS_Decoder* decoder );
+ FT_LOCAL( CF2_Fixed )
+ cf2_getNominalWidthX( PS_Decoder* decoder );
+
+
+ FT_LOCAL( FT_Error )
+ cf2_getT1SeacComponent( PS_Decoder* decoder,
+ FT_UInt glyph_index,
+ CF2_Buffer buf );
+ FT_LOCAL( void )
+ cf2_freeT1SeacComponent( PS_Decoder* decoder,
+ CF2_Buffer buf );
+
+ /*
+ * FreeType client outline
+ *
+ * process output from the charstring interpreter
+ */
+ typedef struct CF2_OutlineRec_
+ {
+ CF2_OutlineCallbacksRec root; /* base class must be first */
+ PS_Decoder* decoder;
+
+ } CF2_OutlineRec, *CF2_Outline;
+
+
+ FT_LOCAL( void )
+ cf2_outline_reset( CF2_Outline outline );
+ FT_LOCAL( void )
+ cf2_outline_close( CF2_Outline outline );
+
+
+FT_END_HEADER
+
+
+#endif /* PSFT_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psglue.h b/thirdparty/freetype/src/psaux/psglue.h
new file mode 100644
index 0000000000..5545e12a5b
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psglue.h
@@ -0,0 +1,144 @@
+/***************************************************************************/
+/* */
+/* psglue.h */
+/* */
+/* Adobe's code for shared stuff (specification only). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSGLUE_H_
+#define PSGLUE_H_
+
+
+/* common includes for other modules */
+#include "pserror.h"
+#include "psfixed.h"
+#include "psarrst.h"
+#include "psread.h"
+
+
+FT_BEGIN_HEADER
+
+
+ /* rendering parameters */
+
+ /* apply hints to rendered glyphs */
+#define CF2_FlagsHinted 1
+ /* for testing */
+#define CF2_FlagsDarkened 2
+
+ /* type for holding the flags */
+ typedef CF2_Int CF2_RenderingFlags;
+
+
+ /* elements of a glyph outline */
+ typedef enum CF2_PathOp_
+ {
+ CF2_PathOpMoveTo = 1, /* change the current point */
+ CF2_PathOpLineTo = 2, /* line */
+ CF2_PathOpQuadTo = 3, /* quadratic curve */
+ CF2_PathOpCubeTo = 4 /* cubic curve */
+
+ } CF2_PathOp;
+
+
+ /* a matrix of fixed point values */
+ typedef struct CF2_Matrix_
+ {
+ CF2_F16Dot16 a;
+ CF2_F16Dot16 b;
+ CF2_F16Dot16 c;
+ CF2_F16Dot16 d;
+ CF2_F16Dot16 tx;
+ CF2_F16Dot16 ty;
+
+ } CF2_Matrix;
+
+
+ /* these typedefs are needed by more than one header file */
+ /* and gcc compiler doesn't allow redefinition */
+ typedef struct CF2_FontRec_ CF2_FontRec, *CF2_Font;
+ typedef struct CF2_HintRec_ CF2_HintRec, *CF2_Hint;
+
+
+ /* A common structure for all callback parameters. */
+ /* */
+ /* Some members may be unused. For example, `pt0' is not used for */
+ /* `moveTo' and `pt3' is not used for `quadTo'. The initial point `pt0' */
+ /* is included for each path element for generality; curve conversions */
+ /* need it. The `op' parameter allows one function to handle multiple */
+ /* element types. */
+
+ typedef struct CF2_CallbackParamsRec_
+ {
+ FT_Vector pt0;
+ FT_Vector pt1;
+ FT_Vector pt2;
+ FT_Vector pt3;
+
+ CF2_Int op;
+
+ } CF2_CallbackParamsRec, *CF2_CallbackParams;
+
+
+ /* forward reference */
+ typedef struct CF2_OutlineCallbacksRec_ CF2_OutlineCallbacksRec,
+ *CF2_OutlineCallbacks;
+
+ /* callback function pointers */
+ typedef void
+ (*CF2_Callback_Type)( CF2_OutlineCallbacks callbacks,
+ const CF2_CallbackParams params );
+
+
+ struct CF2_OutlineCallbacksRec_
+ {
+ CF2_Callback_Type moveTo;
+ CF2_Callback_Type lineTo;
+ CF2_Callback_Type quadTo;
+ CF2_Callback_Type cubeTo;
+
+ CF2_Int windingMomentum; /* for winding order detection */
+
+ FT_Memory memory;
+ FT_Error* error;
+ };
+
+
+FT_END_HEADER
+
+
+#endif /* PSGLUE_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/pshints.c b/thirdparty/freetype/src/psaux/pshints.c
new file mode 100644
index 0000000000..3615196425
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/pshints.c
@@ -0,0 +1,1939 @@
+/***************************************************************************/
+/* */
+/* pshints.c */
+/* */
+/* Adobe's code for handling CFF hints (body). */
+/* */
+/* Copyright 2007-2014 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psglue.h"
+#include "psfont.h"
+#include "pshints.h"
+#include "psintrp.h"
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_cf2hints
+
+
+ typedef struct CF2_HintMoveRec_
+ {
+ size_t j; /* index of upper hint map edge */
+ CF2_Fixed moveUp; /* adjustment to optimum position */
+
+ } CF2_HintMoveRec, *CF2_HintMove;
+
+
+ /* Compute angular momentum for winding order detection. It is called */
+ /* for all lines and curves, but not necessarily in element order. */
+ static CF2_Int
+ cf2_getWindingMomentum( CF2_Fixed x1,
+ CF2_Fixed y1,
+ CF2_Fixed x2,
+ CF2_Fixed y2 )
+ {
+ /* cross product of pt1 position from origin with pt2 position from */
+ /* pt1; we reduce the precision so that the result fits into 32 bits */
+
+ return ( x1 >> 16 ) * ( SUB_INT32( y2, y1 ) >> 16 ) -
+ ( y1 >> 16 ) * ( SUB_INT32( x2, x1 ) >> 16 );
+ }
+
+
+ /*
+ * Construct from a StemHint; this is used as a parameter to
+ * `cf2_blues_capture'.
+ * `hintOrigin' is the character space displacement of a seac accent.
+ * Adjust stem hint for darkening here.
+ *
+ */
+ static void
+ cf2_hint_init( CF2_Hint hint,
+ const CF2_ArrStack stemHintArray,
+ size_t indexStemHint,
+ const CF2_Font font,
+ CF2_Fixed hintOrigin,
+ CF2_Fixed scale,
+ FT_Bool bottom )
+ {
+ CF2_Fixed width;
+ const CF2_StemHintRec* stemHint;
+
+
+ FT_ZERO( hint );
+
+ stemHint = (const CF2_StemHintRec*)cf2_arrstack_getPointer(
+ stemHintArray,
+ indexStemHint );
+
+ width = SUB_INT32( stemHint->max, stemHint->min );
+
+ if ( width == cf2_intToFixed( -21 ) )
+ {
+ /* ghost bottom */
+
+ if ( bottom )
+ {
+ hint->csCoord = stemHint->max;
+ hint->flags = CF2_GhostBottom;
+ }
+ else
+ hint->flags = 0;
+ }
+
+ else if ( width == cf2_intToFixed( -20 ) )
+ {
+ /* ghost top */
+
+ if ( bottom )
+ hint->flags = 0;
+ else
+ {
+ hint->csCoord = stemHint->min;
+ hint->flags = CF2_GhostTop;
+ }
+ }
+
+ else if ( width < 0 )
+ {
+ /* inverted pair */
+
+ /*
+ * Hints with negative widths were produced by an early version of a
+ * non-Adobe font tool. The Type 2 spec allows edge (ghost) hints
+ * with negative widths, but says
+ *
+ * All other negative widths have undefined meaning.
+ *
+ * CoolType has a silent workaround that negates the hint width; for
+ * permissive mode, we do the same here.
+ *
+ * Note: Such fonts cannot use ghost hints, but should otherwise work.
+ * Note: Some poor hints in our faux fonts can produce negative
+ * widths at some blends. For example, see a light weight of
+ * `u' in ASerifMM.
+ *
+ */
+ if ( bottom )
+ {
+ hint->csCoord = stemHint->max;
+ hint->flags = CF2_PairBottom;
+ }
+ else
+ {
+ hint->csCoord = stemHint->min;
+ hint->flags = CF2_PairTop;
+ }
+ }
+
+ else
+ {
+ /* normal pair */
+
+ if ( bottom )
+ {
+ hint->csCoord = stemHint->min;
+ hint->flags = CF2_PairBottom;
+ }
+ else
+ {
+ hint->csCoord = stemHint->max;
+ hint->flags = CF2_PairTop;
+ }
+ }
+
+ /* Now that ghost hints have been detected, adjust this edge for */
+ /* darkening. Bottoms are not changed; tops are incremented by twice */
+ /* `darkenY'. */
+ if ( cf2_hint_isTop( hint ) )
+ hint->csCoord = ADD_INT32( hint->csCoord, 2 * font->darkenY );
+
+ hint->csCoord = ADD_INT32( hint->csCoord, hintOrigin );
+ hint->scale = scale;
+ hint->index = indexStemHint; /* index in original stem hint array */
+
+ /* if original stem hint has been used, use the same position */
+ if ( hint->flags != 0 && stemHint->used )
+ {
+ if ( cf2_hint_isTop( hint ) )
+ hint->dsCoord = stemHint->maxDS;
+ else
+ hint->dsCoord = stemHint->minDS;
+
+ cf2_hint_lock( hint );
+ }
+ else
+ hint->dsCoord = FT_MulFix( hint->csCoord, scale );
+ }
+
+
+ /* initialize an invalid hint map element */
+ static void
+ cf2_hint_initZero( CF2_Hint hint )
+ {
+ FT_ZERO( hint );
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_hint_isValid( const CF2_Hint hint )
+ {
+ return (FT_Bool)( hint->flags != 0 );
+ }
+
+
+ static FT_Bool
+ cf2_hint_isPair( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags &
+ ( CF2_PairBottom | CF2_PairTop ) ) != 0 );
+ }
+
+
+ static FT_Bool
+ cf2_hint_isPairTop( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags & CF2_PairTop ) != 0 );
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_hint_isTop( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags &
+ ( CF2_PairTop | CF2_GhostTop ) ) != 0 );
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_hint_isBottom( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags &
+ ( CF2_PairBottom | CF2_GhostBottom ) ) != 0 );
+ }
+
+
+ static FT_Bool
+ cf2_hint_isLocked( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags & CF2_Locked ) != 0 );
+ }
+
+
+ static FT_Bool
+ cf2_hint_isSynthetic( const CF2_Hint hint )
+ {
+ return (FT_Bool)( ( hint->flags & CF2_Synthetic ) != 0 );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_hint_lock( CF2_Hint hint )
+ {
+ hint->flags |= CF2_Locked;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_hintmap_init( CF2_HintMap hintmap,
+ CF2_Font font,
+ CF2_HintMap initialMap,
+ CF2_ArrStack hintMoves,
+ CF2_Fixed scale )
+ {
+ FT_ZERO( hintmap );
+
+ /* copy parameters from font instance */
+ hintmap->hinted = font->hinted;
+ hintmap->scale = scale;
+ hintmap->font = font;
+ hintmap->initialHintMap = initialMap;
+ /* will clear in `cf2_hintmap_adjustHints' */
+ hintmap->hintMoves = hintMoves;
+ }
+
+
+ static FT_Bool
+ cf2_hintmap_isValid( const CF2_HintMap hintmap )
+ {
+ return hintmap->isValid;
+ }
+
+
+ static void
+ cf2_hintmap_dump( CF2_HintMap hintmap )
+ {
+#ifdef FT_DEBUG_LEVEL_TRACE
+ CF2_UInt i;
+
+
+ FT_TRACE6(( " index csCoord dsCoord scale flags\n" ));
+
+ for ( i = 0; i < hintmap->count; i++ )
+ {
+ CF2_Hint hint = &hintmap->edge[i];
+
+
+ FT_TRACE6(( " %3d %7.2f %7.2f %5d %s%s%s%s\n",
+ hint->index,
+ hint->csCoord / 65536.0,
+ hint->dsCoord / ( hint->scale * 1.0 ),
+ hint->scale,
+ ( cf2_hint_isPair( hint ) ? "p" : "g" ),
+ ( cf2_hint_isTop( hint ) ? "t" : "b" ),
+ ( cf2_hint_isLocked( hint ) ? "L" : ""),
+ ( cf2_hint_isSynthetic( hint ) ? "S" : "" ) ));
+ }
+#else
+ FT_UNUSED( hintmap );
+#endif
+ }
+
+
+ /* transform character space coordinate to device space using hint map */
+ static CF2_Fixed
+ cf2_hintmap_map( CF2_HintMap hintmap,
+ CF2_Fixed csCoord )
+ {
+ if ( hintmap->count == 0 || ! hintmap->hinted )
+ {
+ /* there are no hints; use uniform scale and zero offset */
+ return FT_MulFix( csCoord, hintmap->scale );
+ }
+ else
+ {
+ /* start linear search from last hit */
+ CF2_UInt i = hintmap->lastIndex;
+
+
+ FT_ASSERT( hintmap->lastIndex < CF2_MAX_HINT_EDGES );
+
+ /* search up */
+ while ( i < hintmap->count - 1 &&
+ csCoord >= hintmap->edge[i + 1].csCoord )
+ i += 1;
+
+ /* search down */
+ while ( i > 0 && csCoord < hintmap->edge[i].csCoord )
+ i -= 1;
+
+ hintmap->lastIndex = i;
+
+ if ( i == 0 && csCoord < hintmap->edge[0].csCoord )
+ {
+ /* special case for points below first edge: use uniform scale */
+ return ADD_INT32( FT_MulFix( SUB_INT32( csCoord,
+ hintmap->edge[0].csCoord ),
+ hintmap->scale ),
+ hintmap->edge[0].dsCoord );
+ }
+ else
+ {
+ /*
+ * Note: entries with duplicate csCoord are allowed.
+ * Use edge[i], the highest entry where csCoord >= entry[i].csCoord
+ */
+ return ADD_INT32( FT_MulFix( SUB_INT32( csCoord,
+ hintmap->edge[i].csCoord ),
+ hintmap->edge[i].scale ),
+ hintmap->edge[i].dsCoord );
+ }
+ }
+ }
+
+
+ /*
+ * This hinting policy moves a hint pair in device space so that one of
+ * its two edges is on a device pixel boundary (its fractional part is
+ * zero). `cf2_hintmap_insertHint' guarantees no overlap in CS
+ * space. Ensure here that there is no overlap in DS.
+ *
+ * In the first pass, edges are adjusted relative to adjacent hints.
+ * Those that are below have already been adjusted. Those that are
+ * above have not yet been adjusted. If a hint above blocks an
+ * adjustment to an optimal position, we will try again in a second
+ * pass. The second pass is top-down.
+ *
+ */
+
+ static void
+ cf2_hintmap_adjustHints( CF2_HintMap hintmap )
+ {
+ size_t i, j;
+
+
+ cf2_arrstack_clear( hintmap->hintMoves ); /* working storage */
+
+ /*
+ * First pass is bottom-up (font hint order) without look-ahead.
+ * Locked edges are already adjusted.
+ * Unlocked edges begin with dsCoord from `initialHintMap'.
+ * Save edges that are not optimally adjusted in `hintMoves' array,
+ * and process them in second pass.
+ */
+
+ for ( i = 0; i < hintmap->count; i++ )
+ {
+ FT_Bool isPair = cf2_hint_isPair( &hintmap->edge[i] );
+
+
+ /* index of upper edge (same value for ghost hint) */
+ j = isPair ? i + 1 : i;
+
+ FT_ASSERT( j < hintmap->count );
+ FT_ASSERT( cf2_hint_isValid( &hintmap->edge[i] ) );
+ FT_ASSERT( cf2_hint_isValid( &hintmap->edge[j] ) );
+ FT_ASSERT( cf2_hint_isLocked( &hintmap->edge[i] ) ==
+ cf2_hint_isLocked( &hintmap->edge[j] ) );
+
+ if ( !cf2_hint_isLocked( &hintmap->edge[i] ) )
+ {
+ /* hint edge is not locked, we can adjust it */
+ CF2_Fixed fracDown = cf2_fixedFraction( hintmap->edge[i].dsCoord );
+ CF2_Fixed fracUp = cf2_fixedFraction( hintmap->edge[j].dsCoord );
+
+ /* calculate all four possibilities; moves down are negative */
+ CF2_Fixed downMoveDown = 0 - fracDown;
+ CF2_Fixed upMoveDown = 0 - fracUp;
+ CF2_Fixed downMoveUp = ( fracDown == 0 )
+ ? 0
+ : cf2_intToFixed( 1 ) - fracDown;
+ CF2_Fixed upMoveUp = ( fracUp == 0 )
+ ? 0
+ : cf2_intToFixed( 1 ) - fracUp;
+
+ /* smallest move up */
+ CF2_Fixed moveUp = FT_MIN( downMoveUp, upMoveUp );
+ /* smallest move down */
+ CF2_Fixed moveDown = FT_MAX( downMoveDown, upMoveDown );
+
+ /* final amount to move edge or edge pair */
+ CF2_Fixed move;
+
+ CF2_Fixed downMinCounter = CF2_MIN_COUNTER;
+ CF2_Fixed upMinCounter = CF2_MIN_COUNTER;
+ FT_Bool saveEdge = FALSE;
+
+
+ /* minimum counter constraint doesn't apply when adjacent edges */
+ /* are synthetic */
+ /* TODO: doesn't seem a big effect; for now, reduce the code */
+#if 0
+ if ( i == 0 ||
+ cf2_hint_isSynthetic( &hintmap->edge[i - 1] ) )
+ downMinCounter = 0;
+
+ if ( j >= hintmap->count - 1 ||
+ cf2_hint_isSynthetic( &hintmap->edge[j + 1] ) )
+ upMinCounter = 0;
+#endif
+
+ /* is there room to move up? */
+ /* there is if we are at top of array or the next edge is at or */
+ /* beyond proposed move up? */
+ if ( j >= hintmap->count - 1 ||
+ hintmap->edge[j + 1].dsCoord >=
+ ADD_INT32( hintmap->edge[j].dsCoord,
+ moveUp + upMinCounter ) )
+ {
+ /* there is room to move up; is there also room to move down? */
+ if ( i == 0 ||
+ hintmap->edge[i - 1].dsCoord <=
+ ADD_INT32( hintmap->edge[i].dsCoord,
+ moveDown - downMinCounter ) )
+ {
+ /* move smaller absolute amount */
+ move = ( -moveDown < moveUp ) ? moveDown : moveUp; /* optimum */
+ }
+ else
+ move = moveUp;
+ }
+ else
+ {
+ /* is there room to move down? */
+ if ( i == 0 ||
+ hintmap->edge[i - 1].dsCoord <=
+ ADD_INT32( hintmap->edge[i].dsCoord,
+ moveDown - downMinCounter ) )
+ {
+ move = moveDown;
+ /* true if non-optimum move */
+ saveEdge = (FT_Bool)( moveUp < -moveDown );
+ }
+ else
+ {
+ /* no room to move either way without overlapping or reducing */
+ /* the counter too much */
+ move = 0;
+ saveEdge = TRUE;
+ }
+ }
+
+ /* Identify non-moves and moves down that aren't optimal, and save */
+ /* them for second pass. */
+ /* Do this only if there is an unlocked edge above (which could */
+ /* possibly move). */
+ if ( saveEdge &&
+ j < hintmap->count - 1 &&
+ !cf2_hint_isLocked( &hintmap->edge[j + 1] ) )
+ {
+ CF2_HintMoveRec savedMove;
+
+
+ savedMove.j = j;
+ /* desired adjustment in second pass */
+ savedMove.moveUp = moveUp - move;
+
+ cf2_arrstack_push( hintmap->hintMoves, &savedMove );
+ }
+
+ /* move the edge(s) */
+ hintmap->edge[i].dsCoord = ADD_INT32( hintmap->edge[i].dsCoord,
+ move );
+ if ( isPair )
+ hintmap->edge[j].dsCoord = ADD_INT32( hintmap->edge[j].dsCoord,
+ move );
+ }
+
+ /* assert there are no overlaps in device space */
+ FT_ASSERT( i == 0 ||
+ hintmap->edge[i - 1].dsCoord <= hintmap->edge[i].dsCoord );
+ FT_ASSERT( i < j ||
+ hintmap->edge[i].dsCoord <= hintmap->edge[j].dsCoord );
+
+ /* adjust the scales, avoiding divide by zero */
+ if ( i > 0 )
+ {
+ if ( hintmap->edge[i].csCoord != hintmap->edge[i - 1].csCoord )
+ hintmap->edge[i - 1].scale =
+ FT_DivFix( SUB_INT32( hintmap->edge[i].dsCoord,
+ hintmap->edge[i - 1].dsCoord ),
+ SUB_INT32( hintmap->edge[i].csCoord,
+ hintmap->edge[i - 1].csCoord ) );
+ }
+
+ if ( isPair )
+ {
+ if ( hintmap->edge[j].csCoord != hintmap->edge[j - 1].csCoord )
+ hintmap->edge[j - 1].scale =
+ FT_DivFix( SUB_INT32( hintmap->edge[j].dsCoord,
+ hintmap->edge[j - 1].dsCoord ),
+ SUB_INT32( hintmap->edge[j].csCoord,
+ hintmap->edge[j - 1].csCoord ) );
+
+ i += 1; /* skip upper edge on next loop */
+ }
+ }
+
+ /* second pass tries to move non-optimal hints up, in case there is */
+ /* room now */
+ for ( i = cf2_arrstack_size( hintmap->hintMoves ); i > 0; i-- )
+ {
+ CF2_HintMove hintMove = (CF2_HintMove)
+ cf2_arrstack_getPointer( hintmap->hintMoves, i - 1 );
+
+
+ j = hintMove->j;
+
+ /* this was tested before the push, above */
+ FT_ASSERT( j < hintmap->count - 1 );
+
+ /* is there room to move up? */
+ if ( hintmap->edge[j + 1].dsCoord >=
+ ADD_INT32( hintmap->edge[j].dsCoord,
+ hintMove->moveUp + CF2_MIN_COUNTER ) )
+ {
+ /* there is more room now, move edge up */
+ hintmap->edge[j].dsCoord = ADD_INT32( hintmap->edge[j].dsCoord,
+ hintMove->moveUp );
+
+ if ( cf2_hint_isPair( &hintmap->edge[j] ) )
+ {
+ FT_ASSERT( j > 0 );
+ hintmap->edge[j - 1].dsCoord =
+ ADD_INT32( hintmap->edge[j - 1].dsCoord, hintMove->moveUp );
+ }
+ }
+ }
+ }
+
+
+ /* insert hint edges into map, sorted by csCoord */
+ static void
+ cf2_hintmap_insertHint( CF2_HintMap hintmap,
+ CF2_Hint bottomHintEdge,
+ CF2_Hint topHintEdge )
+ {
+ CF2_UInt indexInsert;
+
+ /* set default values, then check for edge hints */
+ FT_Bool isPair = TRUE;
+ CF2_Hint firstHintEdge = bottomHintEdge;
+ CF2_Hint secondHintEdge = topHintEdge;
+
+
+ /* one or none of the input params may be invalid when dealing with */
+ /* edge hints; at least one edge must be valid */
+ FT_ASSERT( cf2_hint_isValid( bottomHintEdge ) ||
+ cf2_hint_isValid( topHintEdge ) );
+
+ /* determine how many and which edges to insert */
+ if ( !cf2_hint_isValid( bottomHintEdge ) )
+ {
+ /* insert only the top edge */
+ firstHintEdge = topHintEdge;
+ isPair = FALSE;
+ }
+ else if ( !cf2_hint_isValid( topHintEdge ) )
+ {
+ /* insert only the bottom edge */
+ isPair = FALSE;
+ }
+
+ /* paired edges must be in proper order */
+ if ( isPair &&
+ topHintEdge->csCoord < bottomHintEdge->csCoord )
+ return;
+
+ /* linear search to find index value of insertion point */
+ indexInsert = 0;
+ for ( ; indexInsert < hintmap->count; indexInsert++ )
+ {
+ if ( hintmap->edge[indexInsert].csCoord >= firstHintEdge->csCoord )
+ break;
+ }
+
+ FT_TRACE7(( " Got hint at %.2f (%.2f)\n",
+ firstHintEdge->csCoord / 65536.0,
+ firstHintEdge->dsCoord / 65536.0 ));
+ if ( isPair )
+ FT_TRACE7(( " Got hint at %.2f (%.2f)\n",
+ secondHintEdge->csCoord / 65536.0,
+ secondHintEdge->dsCoord / 65536.0 ));
+
+ /*
+ * Discard any hints that overlap in character space. Most often, this
+ * is while building the initial map, where captured hints from all
+ * zones are combined. Define overlap to include hints that `touch'
+ * (overlap zero). Hiragino Sans/Gothic fonts have numerous hints that
+ * touch. Some fonts have non-ideographic glyphs that overlap our
+ * synthetic hints.
+ *
+ * Overlap also occurs when darkening stem hints that are close.
+ *
+ */
+ if ( indexInsert < hintmap->count )
+ {
+ /* we are inserting before an existing edge: */
+ /* verify that an existing edge is not the same */
+ if ( hintmap->edge[indexInsert].csCoord == firstHintEdge->csCoord )
+ return; /* ignore overlapping stem hint */
+
+ /* verify that a new pair does not straddle the next edge */
+ if ( isPair &&
+ hintmap->edge[indexInsert].csCoord <= secondHintEdge->csCoord )
+ return; /* ignore overlapping stem hint */
+
+ /* verify that we are not inserting between paired edges */
+ if ( cf2_hint_isPairTop( &hintmap->edge[indexInsert] ) )
+ return; /* ignore overlapping stem hint */
+ }
+
+ /* recompute device space locations using initial hint map */
+ if ( cf2_hintmap_isValid( hintmap->initialHintMap ) &&
+ !cf2_hint_isLocked( firstHintEdge ) )
+ {
+ if ( isPair )
+ {
+ /* Use hint map to position the center of stem, and nominal scale */
+ /* to position the two edges. This preserves the stem width. */
+ CF2_Fixed midpoint =
+ cf2_hintmap_map(
+ hintmap->initialHintMap,
+ ADD_INT32( secondHintEdge->csCoord,
+ firstHintEdge->csCoord ) / 2 );
+ CF2_Fixed halfWidth =
+ FT_MulFix( SUB_INT32( secondHintEdge->csCoord,
+ firstHintEdge->csCoord ) / 2,
+ hintmap->scale );
+
+
+ firstHintEdge->dsCoord = SUB_INT32( midpoint, halfWidth );
+ secondHintEdge->dsCoord = ADD_INT32( midpoint, halfWidth );
+ }
+ else
+ firstHintEdge->dsCoord = cf2_hintmap_map( hintmap->initialHintMap,
+ firstHintEdge->csCoord );
+ }
+
+ /*
+ * Discard any hints that overlap in device space; this can occur
+ * because locked hints have been moved to align with blue zones.
+ *
+ * TODO: Although we might correct this later during adjustment, we
+ * don't currently have a way to delete a conflicting hint once it has
+ * been inserted. See v2.030 MinionPro-Regular, 12 ppem darkened,
+ * initial hint map for second path, glyph 945 (the perispomeni (tilde)
+ * in U+1F6E, Greek omega with psili and perispomeni). Darkening is
+ * 25. Pair 667,747 initially conflicts in design space with top edge
+ * 660. This is because 667 maps to 7.87, and the top edge was
+ * captured by a zone at 8.0. The pair is later successfully inserted
+ * in a zone without the top edge. In this zone it is adjusted to 8.0,
+ * and no longer conflicts with the top edge in design space. This
+ * means it can be included in yet a later zone which does have the top
+ * edge hint. This produces a small mismatch between the first and
+ * last points of this path, even though the hint masks are the same.
+ * The density map difference is tiny (1/256).
+ *
+ */
+
+ if ( indexInsert > 0 )
+ {
+ /* we are inserting after an existing edge */
+ if ( firstHintEdge->dsCoord < hintmap->edge[indexInsert - 1].dsCoord )
+ return;
+ }
+
+ if ( indexInsert < hintmap->count )
+ {
+ /* we are inserting before an existing edge */
+ if ( isPair )
+ {
+ if ( secondHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )
+ return;
+ }
+ else
+ {
+ if ( firstHintEdge->dsCoord > hintmap->edge[indexInsert].dsCoord )
+ return;
+ }
+ }
+
+ /* make room to insert */
+ {
+ CF2_UInt iSrc = hintmap->count - 1;
+ CF2_UInt iDst = isPair ? hintmap->count + 1 : hintmap->count;
+
+ CF2_UInt count = hintmap->count - indexInsert;
+
+
+ if ( iDst >= CF2_MAX_HINT_EDGES )
+ {
+ FT_TRACE4(( "cf2_hintmap_insertHint: too many hintmaps\n" ));
+ return;
+ }
+
+ while ( count-- )
+ hintmap->edge[iDst--] = hintmap->edge[iSrc--];
+
+ /* insert first edge */
+ hintmap->edge[indexInsert] = *firstHintEdge; /* copy struct */
+ hintmap->count += 1;
+
+ FT_TRACE7(( " Inserting hint %.2f (%.2f)\n",
+ firstHintEdge->csCoord / 65536.0,
+ firstHintEdge->dsCoord / 65536.0 ));
+
+ if ( isPair )
+ {
+ /* insert second edge */
+ hintmap->edge[indexInsert + 1] = *secondHintEdge; /* copy struct */
+ hintmap->count += 1;
+
+ FT_TRACE7(( " Inserting hint %.2f (%.2f)\n",
+ secondHintEdge->csCoord / 65536.0,
+ secondHintEdge->dsCoord / 65536.0 ));
+
+ }
+ }
+
+ return;
+ }
+
+
+ /*
+ * Build a map from hints and mask.
+ *
+ * This function may recur one level if `hintmap->initialHintMap' is not yet
+ * valid.
+ * If `initialMap' is true, simply build initial map.
+ *
+ * Synthetic hints are used in two ways. A hint at zero is inserted, if
+ * needed, in the initial hint map, to prevent translations from
+ * propagating across the origin. If synthetic em box hints are enabled
+ * for ideographic dictionaries, then they are inserted in all hint
+ * maps, including the initial one.
+ *
+ */
+ FT_LOCAL_DEF( void )
+ cf2_hintmap_build( CF2_HintMap hintmap,
+ CF2_ArrStack hStemHintArray,
+ CF2_ArrStack vStemHintArray,
+ CF2_HintMask hintMask,
+ CF2_Fixed hintOrigin,
+ FT_Bool initialMap )
+ {
+ FT_Byte* maskPtr;
+
+ CF2_Font font = hintmap->font;
+ CF2_HintMaskRec tempHintMask;
+
+ size_t bitCount, i;
+ FT_Byte maskByte;
+
+
+ /* check whether initial map is constructed */
+ if ( !initialMap && !cf2_hintmap_isValid( hintmap->initialHintMap ) )
+ {
+ /* make recursive call with initialHintMap and temporary mask; */
+ /* temporary mask will get all bits set, below */
+ cf2_hintmask_init( &tempHintMask, hintMask->error );
+ cf2_hintmap_build( hintmap->initialHintMap,
+ hStemHintArray,
+ vStemHintArray,
+ &tempHintMask,
+ hintOrigin,
+ TRUE );
+ }
+
+ if ( !cf2_hintmask_isValid( hintMask ) )
+ {
+ /* without a hint mask, assume all hints are active */
+ cf2_hintmask_setAll( hintMask,
+ cf2_arrstack_size( hStemHintArray ) +
+ cf2_arrstack_size( vStemHintArray ) );
+ if ( !cf2_hintmask_isValid( hintMask ) )
+ {
+ if ( font->isT1 )
+ {
+ /* no error, just continue unhinted */
+ *hintMask->error = FT_Err_Ok;
+ hintmap->hinted = FALSE;
+ }
+ return; /* too many stem hints */
+ }
+ }
+
+ /* begin by clearing the map */
+ hintmap->count = 0;
+ hintmap->lastIndex = 0;
+
+ /* make a copy of the hint mask so we can modify it */
+ tempHintMask = *hintMask;
+ maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask );
+
+ /* use the hStem hints only, which are first in the mask */
+ bitCount = cf2_arrstack_size( hStemHintArray );
+
+ /* Defense-in-depth. Should never return here. */
+ if ( bitCount > hintMask->bitCount )
+ return;
+
+ /* synthetic embox hints get highest priority */
+ if ( font->blues.doEmBoxHints )
+ {
+ CF2_HintRec dummy;
+
+
+ cf2_hint_initZero( &dummy ); /* invalid hint map element */
+
+ /* ghost bottom */
+ cf2_hintmap_insertHint( hintmap,
+ &font->blues.emBoxBottomEdge,
+ &dummy );
+ /* ghost top */
+ cf2_hintmap_insertHint( hintmap,
+ &dummy,
+ &font->blues.emBoxTopEdge );
+ }
+
+ /* insert hints captured by a blue zone or already locked (higher */
+ /* priority) */
+ for ( i = 0, maskByte = 0x80; i < bitCount; i++ )
+ {
+ if ( maskByte & *maskPtr )
+ {
+ /* expand StemHint into two `CF2_Hint' elements */
+ CF2_HintRec bottomHintEdge, topHintEdge;
+
+
+ cf2_hint_init( &bottomHintEdge,
+ hStemHintArray,
+ i,
+ font,
+ hintOrigin,
+ hintmap->scale,
+ TRUE /* bottom */ );
+ cf2_hint_init( &topHintEdge,
+ hStemHintArray,
+ i,
+ font,
+ hintOrigin,
+ hintmap->scale,
+ FALSE /* top */ );
+
+ if ( cf2_hint_isLocked( &bottomHintEdge ) ||
+ cf2_hint_isLocked( &topHintEdge ) ||
+ cf2_blues_capture( &font->blues,
+ &bottomHintEdge,
+ &topHintEdge ) )
+ {
+ /* insert captured hint into map */
+ cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );
+
+ *maskPtr &= ~maskByte; /* turn off the bit for this hint */
+ }
+ }
+
+ if ( ( i & 7 ) == 7 )
+ {
+ /* move to next mask byte */
+ maskPtr++;
+ maskByte = 0x80;
+ }
+ else
+ maskByte >>= 1;
+ }
+
+ /* initial hint map includes only captured hints plus maybe one at 0 */
+
+ /*
+ * TODO: There is a problem here because we are trying to build a
+ * single hint map containing all captured hints. It is
+ * possible for there to be conflicts between captured hints,
+ * either because of darkening or because the hints are in
+ * separate hint zones (we are ignoring hint zones for the
+ * initial map). An example of the latter is MinionPro-Regular
+ * v2.030 glyph 883 (Greek Capital Alpha with Psili) at 15ppem.
+ * A stem hint for the psili conflicts with the top edge hint
+ * for the base character. The stem hint gets priority because
+ * of its sort order. In glyph 884 (Greek Capital Alpha with
+ * Psili and Oxia), the top of the base character gets a stem
+ * hint, and the psili does not. This creates different initial
+ * maps for the two glyphs resulting in different renderings of
+ * the base character. Will probably defer this either as not
+ * worth the cost or as a font bug. I don't think there is any
+ * good reason for an accent to be captured by an alignment
+ * zone. -darnold 2/12/10
+ */
+
+ if ( initialMap )
+ {
+ /* Apply a heuristic that inserts a point for (0,0), unless it's */
+ /* already covered by a mapping. This locks the baseline for glyphs */
+ /* that have no baseline hints. */
+
+ if ( hintmap->count == 0 ||
+ hintmap->edge[0].csCoord > 0 ||
+ hintmap->edge[hintmap->count - 1].csCoord < 0 )
+ {
+ /* all edges are above 0 or all edges are below 0; */
+ /* construct a locked edge hint at 0 */
+
+ CF2_HintRec edge, invalid;
+
+
+ cf2_hint_initZero( &edge );
+
+ edge.flags = CF2_GhostBottom |
+ CF2_Locked |
+ CF2_Synthetic;
+ edge.scale = hintmap->scale;
+
+ cf2_hint_initZero( &invalid );
+ cf2_hintmap_insertHint( hintmap, &edge, &invalid );
+ }
+ }
+ else
+ {
+ /* insert remaining hints */
+
+ maskPtr = cf2_hintmask_getMaskPtr( &tempHintMask );
+
+ for ( i = 0, maskByte = 0x80; i < bitCount; i++ )
+ {
+ if ( maskByte & *maskPtr )
+ {
+ CF2_HintRec bottomHintEdge, topHintEdge;
+
+
+ cf2_hint_init( &bottomHintEdge,
+ hStemHintArray,
+ i,
+ font,
+ hintOrigin,
+ hintmap->scale,
+ TRUE /* bottom */ );
+ cf2_hint_init( &topHintEdge,
+ hStemHintArray,
+ i,
+ font,
+ hintOrigin,
+ hintmap->scale,
+ FALSE /* top */ );
+
+ cf2_hintmap_insertHint( hintmap, &bottomHintEdge, &topHintEdge );
+ }
+
+ if ( ( i & 7 ) == 7 )
+ {
+ /* move to next mask byte */
+ maskPtr++;
+ maskByte = 0x80;
+ }
+ else
+ maskByte >>= 1;
+ }
+ }
+
+ FT_TRACE6(( initialMap ? "flags: [p]air [g]host [t]op "
+ "[b]ottom [L]ocked [S]ynthetic\n"
+ "Initial hintmap\n"
+ : "Hints:\n" ));
+ cf2_hintmap_dump( hintmap );
+
+ /*
+ * Note: The following line is a convenient place to break when
+ * debugging hinting. Examine `hintmap->edge' for the list of
+ * enabled hints, then step over the call to see the effect of
+ * adjustment. We stop here first on the recursive call that
+ * creates the initial map, and then on each counter group and
+ * hint zone.
+ */
+
+ /* adjust positions of hint edges that are not locked to blue zones */
+ cf2_hintmap_adjustHints( hintmap );
+
+ FT_TRACE6(( "(adjusted)\n" ));
+ cf2_hintmap_dump( hintmap );
+
+ /* save the position of all hints that were used in this hint map; */
+ /* if we use them again, we'll locate them in the same position */
+ if ( !initialMap )
+ {
+ for ( i = 0; i < hintmap->count; i++ )
+ {
+ if ( !cf2_hint_isSynthetic( &hintmap->edge[i] ) )
+ {
+ /* Note: include both valid and invalid edges */
+ /* Note: top and bottom edges are copied back separately */
+ CF2_StemHint stemhint = (CF2_StemHint)
+ cf2_arrstack_getPointer( hStemHintArray,
+ hintmap->edge[i].index );
+
+
+ if ( cf2_hint_isTop( &hintmap->edge[i] ) )
+ stemhint->maxDS = hintmap->edge[i].dsCoord;
+ else
+ stemhint->minDS = hintmap->edge[i].dsCoord;
+
+ stemhint->used = TRUE;
+ }
+ }
+ }
+
+ /* hint map is ready to use */
+ hintmap->isValid = TRUE;
+
+ /* remember this mask has been used */
+ cf2_hintmask_setNew( hintMask, FALSE );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_init( CF2_GlyphPath glyphpath,
+ CF2_Font font,
+ CF2_OutlineCallbacks callbacks,
+ CF2_Fixed scaleY,
+ /* CF2_Fixed hShift, */
+ CF2_ArrStack hStemHintArray,
+ CF2_ArrStack vStemHintArray,
+ CF2_HintMask hintMask,
+ CF2_Fixed hintOriginY,
+ const CF2_Blues blues,
+ const FT_Vector* fractionalTranslation )
+ {
+ FT_ZERO( glyphpath );
+
+ glyphpath->font = font;
+ glyphpath->callbacks = callbacks;
+
+ cf2_arrstack_init( &glyphpath->hintMoves,
+ font->memory,
+ &font->error,
+ sizeof ( CF2_HintMoveRec ) );
+
+ cf2_hintmap_init( &glyphpath->initialHintMap,
+ font,
+ &glyphpath->initialHintMap,
+ &glyphpath->hintMoves,
+ scaleY );
+ cf2_hintmap_init( &glyphpath->firstHintMap,
+ font,
+ &glyphpath->initialHintMap,
+ &glyphpath->hintMoves,
+ scaleY );
+ cf2_hintmap_init( &glyphpath->hintMap,
+ font,
+ &glyphpath->initialHintMap,
+ &glyphpath->hintMoves,
+ scaleY );
+
+ glyphpath->scaleX = font->innerTransform.a;
+ glyphpath->scaleC = font->innerTransform.c;
+ glyphpath->scaleY = font->innerTransform.d;
+
+ glyphpath->fractionalTranslation = *fractionalTranslation;
+
+#if 0
+ glyphpath->hShift = hShift; /* for fauxing */
+#endif
+
+ glyphpath->hStemHintArray = hStemHintArray;
+ glyphpath->vStemHintArray = vStemHintArray;
+ glyphpath->hintMask = hintMask; /* ptr to current mask */
+ glyphpath->hintOriginY = hintOriginY;
+ glyphpath->blues = blues;
+ glyphpath->darken = font->darkened; /* TODO: should we make copies? */
+ glyphpath->xOffset = font->darkenX;
+ glyphpath->yOffset = font->darkenY;
+ glyphpath->miterLimit = 2 * FT_MAX(
+ cf2_fixedAbs( glyphpath->xOffset ),
+ cf2_fixedAbs( glyphpath->yOffset ) );
+
+ /* .1 character space unit */
+ glyphpath->snapThreshold = cf2_doubleToFixed( 0.1 );
+
+ glyphpath->moveIsPending = TRUE;
+ glyphpath->pathIsOpen = FALSE;
+ glyphpath->pathIsClosing = FALSE;
+ glyphpath->elemIsQueued = FALSE;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_finalize( CF2_GlyphPath glyphpath )
+ {
+ cf2_arrstack_finalize( &glyphpath->hintMoves );
+ }
+
+
+ /*
+ * Hint point in y-direction and apply outerTransform.
+ * Input `current' hint map (which is actually delayed by one element).
+ * Input x,y point in Character Space.
+ * Output x,y point in Device Space, including translation.
+ */
+ static void
+ cf2_glyphpath_hintPoint( CF2_GlyphPath glyphpath,
+ CF2_HintMap hintmap,
+ FT_Vector* ppt,
+ CF2_Fixed x,
+ CF2_Fixed y )
+ {
+ FT_Vector pt; /* hinted point in upright DS */
+
+
+ pt.x = ADD_INT32( FT_MulFix( glyphpath->scaleX, x ),
+ FT_MulFix( glyphpath->scaleC, y ) );
+ pt.y = cf2_hintmap_map( hintmap, y );
+
+ ppt->x = ADD_INT32(
+ FT_MulFix( glyphpath->font->outerTransform.a, pt.x ),
+ ADD_INT32(
+ FT_MulFix( glyphpath->font->outerTransform.c, pt.y ),
+ glyphpath->fractionalTranslation.x ) );
+ ppt->y = ADD_INT32(
+ FT_MulFix( glyphpath->font->outerTransform.b, pt.x ),
+ ADD_INT32(
+ FT_MulFix( glyphpath->font->outerTransform.d, pt.y ),
+ glyphpath->fractionalTranslation.y ) );
+ }
+
+
+ /*
+ * From two line segments, (u1,u2) and (v1,v2), compute a point of
+ * intersection on the corresponding lines.
+ * Return false if no intersection is found, or if the intersection is
+ * too far away from the ends of the line segments, u2 and v1.
+ *
+ */
+ static FT_Bool
+ cf2_glyphpath_computeIntersection( CF2_GlyphPath glyphpath,
+ const FT_Vector* u1,
+ const FT_Vector* u2,
+ const FT_Vector* v1,
+ const FT_Vector* v2,
+ FT_Vector* intersection )
+ {
+ /*
+ * Let `u' be a zero-based vector from the first segment, `v' from the
+ * second segment.
+ * Let `w 'be the zero-based vector from `u1' to `v1'.
+ * `perp' is the `perpendicular dot product'; see
+ * https://mathworld.wolfram.com/PerpDotProduct.html.
+ * `s' is the parameter for the parametric line for the first segment
+ * (`u').
+ *
+ * See notation in
+ * http://softsurfer.com/Archive/algorithm_0104/algorithm_0104B.htm.
+ * Calculations are done in 16.16, but must handle the squaring of
+ * line lengths in character space. We scale all vectors by 1/32 to
+ * avoid overflow. This allows values up to 4095 to be squared. The
+ * scale factor cancels in the divide.
+ *
+ * TODO: the scale factor could be computed from UnitsPerEm.
+ *
+ */
+
+#define cf2_perp( a, b ) \
+ ( FT_MulFix( a.x, b.y ) - FT_MulFix( a.y, b.x ) )
+
+ /* round and divide by 32 */
+#define CF2_CS_SCALE( x ) \
+ ( ( (x) + 0x10 ) >> 5 )
+
+ FT_Vector u, v, w; /* scaled vectors */
+ CF2_Fixed denominator, s;
+
+
+ u.x = CF2_CS_SCALE( SUB_INT32( u2->x, u1->x ) );
+ u.y = CF2_CS_SCALE( SUB_INT32( u2->y, u1->y ) );
+ v.x = CF2_CS_SCALE( SUB_INT32( v2->x, v1->x ) );
+ v.y = CF2_CS_SCALE( SUB_INT32( v2->y, v1->y ) );
+ w.x = CF2_CS_SCALE( SUB_INT32( v1->x, u1->x ) );
+ w.y = CF2_CS_SCALE( SUB_INT32( v1->y, u1->y ) );
+
+ denominator = cf2_perp( u, v );
+
+ if ( denominator == 0 )
+ return FALSE; /* parallel or coincident lines */
+
+ s = FT_DivFix( cf2_perp( w, v ), denominator );
+
+ intersection->x = ADD_INT32( u1->x,
+ FT_MulFix( s, SUB_INT32( u2->x, u1->x ) ) );
+ intersection->y = ADD_INT32( u1->y,
+ FT_MulFix( s, SUB_INT32( u2->y, u1->y ) ) );
+
+
+ /*
+ * Special case snapping for horizontal and vertical lines.
+ * This cleans up intersections and reduces problems with winding
+ * order detection.
+ * Sample case is sbc cd KozGoPr6N-Medium.otf 20 16685.
+ * Note: these calculations are in character space.
+ *
+ */
+
+ if ( u1->x == u2->x &&
+ cf2_fixedAbs( SUB_INT32( intersection->x,
+ u1->x ) ) < glyphpath->snapThreshold )
+ intersection->x = u1->x;
+ if ( u1->y == u2->y &&
+ cf2_fixedAbs( SUB_INT32( intersection->y,
+ u1->y ) ) < glyphpath->snapThreshold )
+ intersection->y = u1->y;
+
+ if ( v1->x == v2->x &&
+ cf2_fixedAbs( SUB_INT32( intersection->x,
+ v1->x ) ) < glyphpath->snapThreshold )
+ intersection->x = v1->x;
+ if ( v1->y == v2->y &&
+ cf2_fixedAbs( SUB_INT32( intersection->y,
+ v1->y ) ) < glyphpath->snapThreshold )
+ intersection->y = v1->y;
+
+ /* limit the intersection distance from midpoint of u2 and v1 */
+ if ( cf2_fixedAbs( intersection->x - ADD_INT32( u2->x, v1->x ) / 2 ) >
+ glyphpath->miterLimit ||
+ cf2_fixedAbs( intersection->y - ADD_INT32( u2->y, v1->y ) / 2 ) >
+ glyphpath->miterLimit )
+ return FALSE;
+
+ return TRUE;
+ }
+
+
+ /*
+ * Push the cached element (glyphpath->prevElem*) to the outline
+ * consumer. When a darkening offset is used, the end point of the
+ * cached element may be adjusted to an intersection point or we may
+ * synthesize a connecting line to the current element. If we are
+ * closing a subpath, we may also generate a connecting line to the start
+ * point.
+ *
+ * This is where Character Space (CS) is converted to Device Space (DS)
+ * using a hint map. This calculation must use a HintMap that was valid
+ * at the time the element was saved. For the first point in a subpath,
+ * that is a saved HintMap. For most elements, it just means the caller
+ * has delayed building a HintMap from the current HintMask.
+ *
+ * Transform each point with outerTransform and call the outline
+ * callbacks. This is a general 3x3 transform:
+ *
+ * x' = a*x + c*y + tx, y' = b*x + d*y + ty
+ *
+ * but it uses 4 elements from CF2_Font and the translation part
+ * from CF2_GlyphPath.
+ *
+ */
+ static void
+ cf2_glyphpath_pushPrevElem( CF2_GlyphPath glyphpath,
+ CF2_HintMap hintmap,
+ FT_Vector* nextP0,
+ FT_Vector nextP1,
+ FT_Bool close )
+ {
+ CF2_CallbackParamsRec params;
+
+ FT_Vector* prevP0;
+ FT_Vector* prevP1;
+
+ FT_Vector intersection = { 0, 0 };
+ FT_Bool useIntersection = FALSE;
+
+
+ FT_ASSERT( glyphpath->prevElemOp == CF2_PathOpLineTo ||
+ glyphpath->prevElemOp == CF2_PathOpCubeTo );
+
+ if ( glyphpath->prevElemOp == CF2_PathOpLineTo )
+ {
+ prevP0 = &glyphpath->prevElemP0;
+ prevP1 = &glyphpath->prevElemP1;
+ }
+ else
+ {
+ prevP0 = &glyphpath->prevElemP2;
+ prevP1 = &glyphpath->prevElemP3;
+ }
+
+ /* optimization: if previous and next elements are offset by the same */
+ /* amount, then there will be no gap, and no need to compute an */
+ /* intersection. */
+ if ( prevP1->x != nextP0->x || prevP1->y != nextP0->y )
+ {
+ /* previous element does not join next element: */
+ /* adjust end point of previous element to the intersection */
+ useIntersection = cf2_glyphpath_computeIntersection( glyphpath,
+ prevP0,
+ prevP1,
+ nextP0,
+ &nextP1,
+ &intersection );
+ if ( useIntersection )
+ {
+ /* modify the last point of the cached element (either line or */
+ /* curve) */
+ *prevP1 = intersection;
+ }
+ }
+
+ params.pt0 = glyphpath->currentDS;
+
+ switch( glyphpath->prevElemOp )
+ {
+ case CF2_PathOpLineTo:
+ params.op = CF2_PathOpLineTo;
+
+ /* note: pt2 and pt3 are unused */
+
+ if ( close )
+ {
+ /* use first hint map if closing */
+ cf2_glyphpath_hintPoint( glyphpath,
+ &glyphpath->firstHintMap,
+ &params.pt1,
+ glyphpath->prevElemP1.x,
+ glyphpath->prevElemP1.y );
+ }
+ else
+ {
+ cf2_glyphpath_hintPoint( glyphpath,
+ hintmap,
+ &params.pt1,
+ glyphpath->prevElemP1.x,
+ glyphpath->prevElemP1.y );
+ }
+
+ /* output only non-zero length lines */
+ if ( params.pt0.x != params.pt1.x || params.pt0.y != params.pt1.y )
+ {
+ glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );
+
+ glyphpath->currentDS = params.pt1;
+ }
+ break;
+
+ case CF2_PathOpCubeTo:
+ params.op = CF2_PathOpCubeTo;
+
+ /* TODO: should we intersect the interior joins (p1-p2 and p2-p3)? */
+ cf2_glyphpath_hintPoint( glyphpath,
+ hintmap,
+ &params.pt1,
+ glyphpath->prevElemP1.x,
+ glyphpath->prevElemP1.y );
+ cf2_glyphpath_hintPoint( glyphpath,
+ hintmap,
+ &params.pt2,
+ glyphpath->prevElemP2.x,
+ glyphpath->prevElemP2.y );
+ cf2_glyphpath_hintPoint( glyphpath,
+ hintmap,
+ &params.pt3,
+ glyphpath->prevElemP3.x,
+ glyphpath->prevElemP3.y );
+
+ glyphpath->callbacks->cubeTo( glyphpath->callbacks, &params );
+
+ glyphpath->currentDS = params.pt3;
+
+ break;
+ }
+
+ if ( !useIntersection || close )
+ {
+ /* insert connecting line between end of previous element and start */
+ /* of current one */
+ /* note: at the end of a subpath, we might do both, so use `nextP0' */
+ /* before we change it, below */
+
+ if ( close )
+ {
+ /* if we are closing the subpath, then nextP0 is in the first */
+ /* hint zone */
+ cf2_glyphpath_hintPoint( glyphpath,
+ &glyphpath->firstHintMap,
+ &params.pt1,
+ nextP0->x,
+ nextP0->y );
+ }
+ else
+ {
+ cf2_glyphpath_hintPoint( glyphpath,
+ hintmap,
+ &params.pt1,
+ nextP0->x,
+ nextP0->y );
+ }
+
+ if ( params.pt1.x != glyphpath->currentDS.x ||
+ params.pt1.y != glyphpath->currentDS.y )
+ {
+ /* length is nonzero */
+ params.op = CF2_PathOpLineTo;
+ params.pt0 = glyphpath->currentDS;
+
+ /* note: pt2 and pt3 are unused */
+ glyphpath->callbacks->lineTo( glyphpath->callbacks, &params );
+
+ glyphpath->currentDS = params.pt1;
+ }
+ }
+
+ if ( useIntersection )
+ {
+ /* return intersection point to caller */
+ *nextP0 = intersection;
+ }
+ }
+
+
+ /* push a MoveTo element based on current point and offset of current */
+ /* element */
+ static void
+ cf2_glyphpath_pushMove( CF2_GlyphPath glyphpath,
+ FT_Vector start )
+ {
+ CF2_CallbackParamsRec params;
+
+
+ params.op = CF2_PathOpMoveTo;
+ params.pt0 = glyphpath->currentDS;
+
+ /* Test if move has really happened yet; it would have called */
+ /* `cf2_hintmap_build' to set `isValid'. */
+ if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) )
+ {
+ /* we are here iff first subpath is missing a moveto operator: */
+ /* synthesize first moveTo to finish initialization of hintMap */
+ cf2_glyphpath_moveTo( glyphpath,
+ glyphpath->start.x,
+ glyphpath->start.y );
+ }
+
+ cf2_glyphpath_hintPoint( glyphpath,
+ &glyphpath->hintMap,
+ &params.pt1,
+ start.x,
+ start.y );
+
+ /* note: pt2 and pt3 are unused */
+ glyphpath->callbacks->moveTo( glyphpath->callbacks, &params );
+
+ glyphpath->currentDS = params.pt1;
+ glyphpath->offsetStart0 = start;
+ }
+
+
+ /*
+ * All coordinates are in character space.
+ * On input, (x1, y1) and (x2, y2) give line segment.
+ * On output, (x, y) give offset vector.
+ * We use a piecewise approximation to trig functions.
+ *
+ * TODO: Offset true perpendicular and proper length
+ * supply the y-translation for hinting here, too,
+ * that adds yOffset unconditionally to *y.
+ */
+ static void
+ cf2_glyphpath_computeOffset( CF2_GlyphPath glyphpath,
+ CF2_Fixed x1,
+ CF2_Fixed y1,
+ CF2_Fixed x2,
+ CF2_Fixed y2,
+ CF2_Fixed* x,
+ CF2_Fixed* y )
+ {
+ CF2_Fixed dx = SUB_INT32( x2, x1 );
+ CF2_Fixed dy = SUB_INT32( y2, y1 );
+
+
+ /* note: negative offsets don't work here; negate deltas to change */
+ /* quadrants, below */
+ if ( glyphpath->font->reverseWinding )
+ {
+ dx = NEG_INT32( dx );
+ dy = NEG_INT32( dy );
+ }
+
+ *x = *y = 0;
+
+ if ( !glyphpath->darken )
+ return;
+
+ /* add momentum for this path element */
+ glyphpath->callbacks->windingMomentum =
+ ADD_INT32( glyphpath->callbacks->windingMomentum,
+ cf2_getWindingMomentum( x1, y1, x2, y2 ) );
+
+ /* note: allow mixed integer and fixed multiplication here */
+ if ( dx >= 0 )
+ {
+ if ( dy >= 0 )
+ {
+ /* first quadrant, +x +y */
+
+ if ( dx > MUL_INT32( 2, dy ) )
+ {
+ /* +x */
+ *x = 0;
+ *y = 0;
+ }
+ else if ( dy > MUL_INT32( 2, dx ) )
+ {
+ /* +y */
+ *x = glyphpath->xOffset;
+ *y = glyphpath->yOffset;
+ }
+ else
+ {
+ /* +x +y */
+ *x = FT_MulFix( cf2_doubleToFixed( 0.7 ),
+ glyphpath->xOffset );
+ *y = FT_MulFix( cf2_doubleToFixed( 1.0 - 0.7 ),
+ glyphpath->yOffset );
+ }
+ }
+ else
+ {
+ /* fourth quadrant, +x -y */
+
+ if ( dx > MUL_INT32( -2, dy ) )
+ {
+ /* +x */
+ *x = 0;
+ *y = 0;
+ }
+ else if ( NEG_INT32( dy ) > MUL_INT32( 2, dx ) )
+ {
+ /* -y */
+ *x = NEG_INT32( glyphpath->xOffset );
+ *y = glyphpath->yOffset;
+ }
+ else
+ {
+ /* +x -y */
+ *x = FT_MulFix( cf2_doubleToFixed( -0.7 ),
+ glyphpath->xOffset );
+ *y = FT_MulFix( cf2_doubleToFixed( 1.0 - 0.7 ),
+ glyphpath->yOffset );
+ }
+ }
+ }
+ else
+ {
+ if ( dy >= 0 )
+ {
+ /* second quadrant, -x +y */
+
+ if ( NEG_INT32( dx ) > MUL_INT32( 2, dy ) )
+ {
+ /* -x */
+ *x = 0;
+ *y = MUL_INT32( 2, glyphpath->yOffset );
+ }
+ else if ( dy > MUL_INT32( -2, dx ) )
+ {
+ /* +y */
+ *x = glyphpath->xOffset;
+ *y = glyphpath->yOffset;
+ }
+ else
+ {
+ /* -x +y */
+ *x = FT_MulFix( cf2_doubleToFixed( 0.7 ),
+ glyphpath->xOffset );
+ *y = FT_MulFix( cf2_doubleToFixed( 1.0 + 0.7 ),
+ glyphpath->yOffset );
+ }
+ }
+ else
+ {
+ /* third quadrant, -x -y */
+
+ if ( NEG_INT32( dx ) > MUL_INT32( -2, dy ) )
+ {
+ /* -x */
+ *x = 0;
+ *y = MUL_INT32( 2, glyphpath->yOffset );
+ }
+ else if ( NEG_INT32( dy ) > MUL_INT32( -2, dx ) )
+ {
+ /* -y */
+ *x = NEG_INT32( glyphpath->xOffset );
+ *y = glyphpath->yOffset;
+ }
+ else
+ {
+ /* -x -y */
+ *x = FT_MulFix( cf2_doubleToFixed( -0.7 ),
+ glyphpath->xOffset );
+ *y = FT_MulFix( cf2_doubleToFixed( 1.0 + 0.7 ),
+ glyphpath->yOffset );
+ }
+ }
+ }
+ }
+
+
+ /*
+ * The functions cf2_glyphpath_{moveTo,lineTo,curveTo,closeOpenPath} are
+ * called by the interpreter with Character Space (CS) coordinates. Each
+ * path element is placed into a queue of length one to await the
+ * calculation of the following element. At that time, the darkening
+ * offset of the following element is known and joins can be computed,
+ * including possible modification of this element, before mapping to
+ * Device Space (DS) and passing it on to the outline consumer.
+ *
+ */
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_moveTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x,
+ CF2_Fixed y )
+ {
+ cf2_glyphpath_closeOpenPath( glyphpath );
+
+ /* save the parameters of the move for later, when we'll know how to */
+ /* offset it; */
+ /* also save last move point */
+ glyphpath->currentCS.x = glyphpath->start.x = x;
+ glyphpath->currentCS.y = glyphpath->start.y = y;
+
+ glyphpath->moveIsPending = TRUE;
+
+ /* ensure we have a valid map with current mask */
+ if ( !cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+ cf2_hintmask_isNew( glyphpath->hintMask ) )
+ cf2_hintmap_build( &glyphpath->hintMap,
+ glyphpath->hStemHintArray,
+ glyphpath->vStemHintArray,
+ glyphpath->hintMask,
+ glyphpath->hintOriginY,
+ FALSE );
+
+ /* save a copy of current HintMap to use when drawing initial point */
+ glyphpath->firstHintMap = glyphpath->hintMap; /* structure copy */
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_lineTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x,
+ CF2_Fixed y )
+ {
+ CF2_Fixed xOffset, yOffset;
+ FT_Vector P0, P1;
+ FT_Bool newHintMap;
+
+ /*
+ * New hints will be applied after cf2_glyphpath_pushPrevElem has run.
+ * In case this is a synthesized closing line, any new hints should be
+ * delayed until this path is closed (`cf2_hintmask_isNew' will be
+ * called again before the next line or curve).
+ */
+
+ /* true if new hint map not on close */
+ newHintMap = cf2_hintmask_isNew( glyphpath->hintMask ) &&
+ !glyphpath->pathIsClosing;
+
+ /*
+ * Zero-length lines may occur in the charstring. Because we cannot
+ * compute darkening offsets or intersections from zero-length lines,
+ * it is best to remove them and avoid artifacts. However, zero-length
+ * lines in CS at the start of a new hint map can generate non-zero
+ * lines in DS due to hint substitution. We detect a change in hint
+ * map here and pass those zero-length lines along.
+ */
+
+ /*
+ * Note: Find explicitly closed paths here with a conditional
+ * breakpoint using
+ *
+ * !gp->pathIsClosing && gp->start.x == x && gp->start.y == y
+ *
+ */
+
+ if ( glyphpath->currentCS.x == x &&
+ glyphpath->currentCS.y == y &&
+ !newHintMap )
+ /*
+ * Ignore zero-length lines in CS where the hint map is the same
+ * because the line in DS will also be zero length.
+ *
+ * Ignore zero-length lines when we synthesize a closing line because
+ * the close will be handled in cf2_glyphPath_pushPrevElem.
+ */
+ return;
+
+ cf2_glyphpath_computeOffset( glyphpath,
+ glyphpath->currentCS.x,
+ glyphpath->currentCS.y,
+ x,
+ y,
+ &xOffset,
+ &yOffset );
+
+ /* construct offset points */
+ P0.x = ADD_INT32( glyphpath->currentCS.x, xOffset );
+ P0.y = ADD_INT32( glyphpath->currentCS.y, yOffset );
+ P1.x = ADD_INT32( x, xOffset );
+ P1.y = ADD_INT32( y, yOffset );
+
+ if ( glyphpath->moveIsPending )
+ {
+ /* emit offset 1st point as MoveTo */
+ cf2_glyphpath_pushMove( glyphpath, P0 );
+
+ glyphpath->moveIsPending = FALSE; /* adjust state machine */
+ glyphpath->pathIsOpen = TRUE;
+
+ glyphpath->offsetStart1 = P1; /* record second point */
+ }
+
+ if ( glyphpath->elemIsQueued )
+ {
+ FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+ glyphpath->hintMap.count == 0 );
+
+ cf2_glyphpath_pushPrevElem( glyphpath,
+ &glyphpath->hintMap,
+ &P0,
+ P1,
+ FALSE );
+ }
+
+ /* queue the current element with offset points */
+ glyphpath->elemIsQueued = TRUE;
+ glyphpath->prevElemOp = CF2_PathOpLineTo;
+ glyphpath->prevElemP0 = P0;
+ glyphpath->prevElemP1 = P1;
+
+ /* update current map */
+ if ( newHintMap )
+ cf2_hintmap_build( &glyphpath->hintMap,
+ glyphpath->hStemHintArray,
+ glyphpath->vStemHintArray,
+ glyphpath->hintMask,
+ glyphpath->hintOriginY,
+ FALSE );
+
+ glyphpath->currentCS.x = x; /* pre-offset current point */
+ glyphpath->currentCS.y = y;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_curveTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x1,
+ CF2_Fixed y1,
+ CF2_Fixed x2,
+ CF2_Fixed y2,
+ CF2_Fixed x3,
+ CF2_Fixed y3 )
+ {
+ CF2_Fixed xOffset1, yOffset1, xOffset3, yOffset3;
+ FT_Vector P0, P1, P2, P3;
+
+
+ /* TODO: ignore zero length portions of curve?? */
+ cf2_glyphpath_computeOffset( glyphpath,
+ glyphpath->currentCS.x,
+ glyphpath->currentCS.y,
+ x1,
+ y1,
+ &xOffset1,
+ &yOffset1 );
+ cf2_glyphpath_computeOffset( glyphpath,
+ x2,
+ y2,
+ x3,
+ y3,
+ &xOffset3,
+ &yOffset3 );
+
+ /* add momentum from the middle segment */
+ glyphpath->callbacks->windingMomentum =
+ ADD_INT32( glyphpath->callbacks->windingMomentum,
+ cf2_getWindingMomentum( x1, y1, x2, y2 ) );
+
+ /* construct offset points */
+ P0.x = ADD_INT32( glyphpath->currentCS.x, xOffset1 );
+ P0.y = ADD_INT32( glyphpath->currentCS.y, yOffset1 );
+ P1.x = ADD_INT32( x1, xOffset1 );
+ P1.y = ADD_INT32( y1, yOffset1 );
+ /* note: preserve angle of final segment by using offset3 at both ends */
+ P2.x = ADD_INT32( x2, xOffset3 );
+ P2.y = ADD_INT32( y2, yOffset3 );
+ P3.x = ADD_INT32( x3, xOffset3 );
+ P3.y = ADD_INT32( y3, yOffset3 );
+
+ if ( glyphpath->moveIsPending )
+ {
+ /* emit offset 1st point as MoveTo */
+ cf2_glyphpath_pushMove( glyphpath, P0 );
+
+ glyphpath->moveIsPending = FALSE;
+ glyphpath->pathIsOpen = TRUE;
+
+ glyphpath->offsetStart1 = P1; /* record second point */
+ }
+
+ if ( glyphpath->elemIsQueued )
+ {
+ FT_ASSERT( cf2_hintmap_isValid( &glyphpath->hintMap ) ||
+ glyphpath->hintMap.count == 0 );
+
+ cf2_glyphpath_pushPrevElem( glyphpath,
+ &glyphpath->hintMap,
+ &P0,
+ P1,
+ FALSE );
+ }
+
+ /* queue the current element with offset points */
+ glyphpath->elemIsQueued = TRUE;
+ glyphpath->prevElemOp = CF2_PathOpCubeTo;
+ glyphpath->prevElemP0 = P0;
+ glyphpath->prevElemP1 = P1;
+ glyphpath->prevElemP2 = P2;
+ glyphpath->prevElemP3 = P3;
+
+ /* update current map */
+ if ( cf2_hintmask_isNew( glyphpath->hintMask ) )
+ cf2_hintmap_build( &glyphpath->hintMap,
+ glyphpath->hStemHintArray,
+ glyphpath->vStemHintArray,
+ glyphpath->hintMask,
+ glyphpath->hintOriginY,
+ FALSE );
+
+ glyphpath->currentCS.x = x3; /* pre-offset current point */
+ glyphpath->currentCS.y = y3;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_glyphpath_closeOpenPath( CF2_GlyphPath glyphpath )
+ {
+ if ( glyphpath->pathIsOpen )
+ {
+ /*
+ * A closing line in Character Space line is always generated below
+ * with `cf2_glyphPath_lineTo'. It may be ignored later if it turns
+ * out to be zero length in Device Space.
+ */
+ glyphpath->pathIsClosing = TRUE;
+
+ cf2_glyphpath_lineTo( glyphpath,
+ glyphpath->start.x,
+ glyphpath->start.y );
+
+ /* empty the final element from the queue and close the path */
+ if ( glyphpath->elemIsQueued )
+ cf2_glyphpath_pushPrevElem( glyphpath,
+ &glyphpath->hintMap,
+ &glyphpath->offsetStart0,
+ glyphpath->offsetStart1,
+ TRUE );
+
+ /* reset state machine */
+ glyphpath->moveIsPending = TRUE;
+ glyphpath->pathIsOpen = FALSE;
+ glyphpath->pathIsClosing = FALSE;
+ glyphpath->elemIsQueued = FALSE;
+ }
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/pshints.h b/thirdparty/freetype/src/psaux/pshints.h
new file mode 100644
index 0000000000..92e37e98ae
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/pshints.h
@@ -0,0 +1,288 @@
+/***************************************************************************/
+/* */
+/* pshints.h */
+/* */
+/* Adobe's code for handling CFF hints (body). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSHINT_H_
+#define PSHINT_H_
+
+FT_BEGIN_HEADER
+
+
+ enum
+ {
+ CF2_MAX_HINTS = 96 /* maximum # of hints */
+ };
+
+
+ /*
+ * A HintMask object stores a bit mask that specifies which hints in the
+ * charstring are active at a given time. Hints in CFF must be declared
+ * at the start, before any drawing operators, with horizontal hints
+ * preceding vertical hints. The HintMask is ordered the same way, with
+ * horizontal hints immediately followed by vertical hints. Clients are
+ * responsible for knowing how many of each type are present.
+ *
+ * The maximum total number of hints is 96, as specified by the CFF
+ * specification.
+ *
+ * A HintMask is built 0 or more times while interpreting a charstring, by
+ * the HintMask operator. There is only one HintMask, but it is built or
+ * rebuilt each time there is a hint substitution (HintMask operator) in
+ * the charstring. A default HintMask with all bits set is built if there
+ * has been no HintMask operator prior to the first drawing operator.
+ *
+ */
+
+ typedef struct CF2_HintMaskRec_
+ {
+ FT_Error* error;
+
+ FT_Bool isValid;
+ FT_Bool isNew;
+
+ size_t bitCount;
+ size_t byteCount;
+
+ FT_Byte mask[( CF2_MAX_HINTS + 7 ) / 8];
+
+ } CF2_HintMaskRec, *CF2_HintMask;
+
+
+ typedef struct CF2_StemHintRec_
+ {
+ FT_Bool used; /* DS positions are valid */
+
+ CF2_Fixed min; /* original character space value */
+ CF2_Fixed max;
+
+ CF2_Fixed minDS; /* DS position after first use */
+ CF2_Fixed maxDS;
+
+ } CF2_StemHintRec, *CF2_StemHint;
+
+
+ /*
+ * A HintMap object stores a piecewise linear function for mapping
+ * y-coordinates from character space to device space, providing
+ * appropriate pixel alignment to stem edges.
+ *
+ * The map is implemented as an array of `CF2_Hint' elements, each
+ * representing an edge. When edges are paired, as from stem hints, the
+ * bottom edge must immediately precede the top edge in the array.
+ * Element character space AND device space positions must both increase
+ * monotonically in the array. `CF2_Hint' elements are also used as
+ * parameters to `cf2_blues_capture'.
+ *
+ * The `cf2_hintmap_build' method must be called before any drawing
+ * operation (beginning with a Move operator) and at each hint
+ * substitution (HintMask operator).
+ *
+ * The `cf2_hintmap_map' method is called to transform y-coordinates at
+ * each drawing operation (move, line, curve).
+ *
+ */
+
+ /* TODO: make this a CF2_ArrStack and add a deep copy method */
+ enum
+ {
+ CF2_MAX_HINT_EDGES = CF2_MAX_HINTS * 2
+ };
+
+
+ typedef struct CF2_HintMapRec_
+ {
+ CF2_Font font;
+
+ /* initial map based on blue zones */
+ struct CF2_HintMapRec_* initialHintMap;
+
+ /* working storage for 2nd pass adjustHints */
+ CF2_ArrStack hintMoves;
+
+ FT_Bool isValid;
+ FT_Bool hinted;
+
+ CF2_Fixed scale;
+ CF2_UInt count;
+
+ /* start search from this index */
+ CF2_UInt lastIndex;
+
+ CF2_HintRec edge[CF2_MAX_HINT_EDGES]; /* 192 */
+
+ } CF2_HintMapRec, *CF2_HintMap;
+
+
+ FT_LOCAL( FT_Bool )
+ cf2_hint_isValid( const CF2_Hint hint );
+ FT_LOCAL( FT_Bool )
+ cf2_hint_isTop( const CF2_Hint hint );
+ FT_LOCAL( FT_Bool )
+ cf2_hint_isBottom( const CF2_Hint hint );
+ FT_LOCAL( void )
+ cf2_hint_lock( CF2_Hint hint );
+
+
+ FT_LOCAL( void )
+ cf2_hintmap_init( CF2_HintMap hintmap,
+ CF2_Font font,
+ CF2_HintMap initialMap,
+ CF2_ArrStack hintMoves,
+ CF2_Fixed scale );
+ FT_LOCAL( void )
+ cf2_hintmap_build( CF2_HintMap hintmap,
+ CF2_ArrStack hStemHintArray,
+ CF2_ArrStack vStemHintArray,
+ CF2_HintMask hintMask,
+ CF2_Fixed hintOrigin,
+ FT_Bool initialMap );
+
+
+ /*
+ * GlyphPath is a wrapper for drawing operations that scales the
+ * coordinates according to the render matrix and HintMap. It also tracks
+ * open paths to control ClosePath and to insert MoveTo for broken fonts.
+ *
+ */
+ typedef struct CF2_GlyphPathRec_
+ {
+ /* TODO: gather some of these into a hinting context */
+
+ CF2_Font font; /* font instance */
+ CF2_OutlineCallbacks callbacks; /* outline consumer */
+
+
+ CF2_HintMapRec hintMap; /* current hint map */
+ CF2_HintMapRec firstHintMap; /* saved copy */
+ CF2_HintMapRec initialHintMap; /* based on all captured hints */
+
+ CF2_ArrStackRec hintMoves; /* list of hint moves for 2nd pass */
+
+ CF2_Fixed scaleX; /* matrix a */
+ CF2_Fixed scaleC; /* matrix c */
+ CF2_Fixed scaleY; /* matrix d */
+
+ FT_Vector fractionalTranslation; /* including deviceXScale */
+#if 0
+ CF2_Fixed hShift; /* character space horizontal shift */
+ /* (for fauxing) */
+#endif
+
+ FT_Bool pathIsOpen; /* true after MoveTo */
+ FT_Bool pathIsClosing; /* true when synthesizing closepath line */
+ FT_Bool darken; /* true if stem darkening */
+ FT_Bool moveIsPending; /* true between MoveTo and offset MoveTo */
+
+ /* references used to call `cf2_hintmap_build', if necessary */
+ CF2_ArrStack hStemHintArray;
+ CF2_ArrStack vStemHintArray;
+ CF2_HintMask hintMask; /* ptr to the current mask */
+ CF2_Fixed hintOriginY; /* copy of current origin */
+ const CF2_BluesRec* blues;
+
+ CF2_Fixed xOffset; /* character space offsets */
+ CF2_Fixed yOffset;
+
+ /* character space miter limit threshold */
+ CF2_Fixed miterLimit;
+ /* vertical/horizontal snap distance in character space */
+ CF2_Fixed snapThreshold;
+
+ FT_Vector offsetStart0; /* first and second points of first */
+ FT_Vector offsetStart1; /* element with offset applied */
+
+ /* current point, character space, before offset */
+ FT_Vector currentCS;
+ /* current point, device space */
+ FT_Vector currentDS;
+ /* start point of subpath, character space */
+ FT_Vector start;
+
+ /* the following members constitute the `queue' of one element */
+ FT_Bool elemIsQueued;
+ CF2_Int prevElemOp;
+
+ FT_Vector prevElemP0;
+ FT_Vector prevElemP1;
+ FT_Vector prevElemP2;
+ FT_Vector prevElemP3;
+
+ } CF2_GlyphPathRec, *CF2_GlyphPath;
+
+
+ FT_LOCAL( void )
+ cf2_glyphpath_init( CF2_GlyphPath glyphpath,
+ CF2_Font font,
+ CF2_OutlineCallbacks callbacks,
+ CF2_Fixed scaleY,
+ /* CF2_Fixed hShift, */
+ CF2_ArrStack hStemHintArray,
+ CF2_ArrStack vStemHintArray,
+ CF2_HintMask hintMask,
+ CF2_Fixed hintOrigin,
+ const CF2_Blues blues,
+ const FT_Vector* fractionalTranslation );
+ FT_LOCAL( void )
+ cf2_glyphpath_finalize( CF2_GlyphPath glyphpath );
+
+ FT_LOCAL( void )
+ cf2_glyphpath_moveTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x,
+ CF2_Fixed y );
+ FT_LOCAL( void )
+ cf2_glyphpath_lineTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x,
+ CF2_Fixed y );
+ FT_LOCAL( void )
+ cf2_glyphpath_curveTo( CF2_GlyphPath glyphpath,
+ CF2_Fixed x1,
+ CF2_Fixed y1,
+ CF2_Fixed x2,
+ CF2_Fixed y2,
+ CF2_Fixed x3,
+ CF2_Fixed y3 );
+ FT_LOCAL( void )
+ cf2_glyphpath_closeOpenPath( CF2_GlyphPath glyphpath );
+
+
+FT_END_HEADER
+
+
+#endif /* PSHINT_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psintrp.c b/thirdparty/freetype/src/psaux/psintrp.c
new file mode 100644
index 0000000000..da5a8dad1d
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psintrp.c
@@ -0,0 +1,3040 @@
+/***************************************************************************/
+/* */
+/* psintrp.c */
+/* */
+/* Adobe's CFF Interpreter (body). */
+/* */
+/* Copyright 2007-2014 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+#include FT_SERVICE_CFF_TABLE_LOAD_H
+
+#include "psglue.h"
+#include "psfont.h"
+#include "psstack.h"
+#include "pshints.h"
+#include "psintrp.h"
+
+#include "pserror.h"
+
+#include "psobjs.h" /* for cff_random */
+#include "t1decode.h" /* for t1 seac */
+
+
+ /*************************************************************************/
+ /* */
+ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
+ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
+ /* messages during execution. */
+ /* */
+#undef FT_COMPONENT
+#define FT_COMPONENT trace_cf2interp
+
+
+ FT_LOCAL_DEF( void )
+ cf2_hintmask_init( CF2_HintMask hintmask,
+ FT_Error* error )
+ {
+ FT_ZERO( hintmask );
+
+ hintmask->error = error;
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_hintmask_isValid( const CF2_HintMask hintmask )
+ {
+ return hintmask->isValid;
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_hintmask_isNew( const CF2_HintMask hintmask )
+ {
+ return hintmask->isNew;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_hintmask_setNew( CF2_HintMask hintmask,
+ FT_Bool val )
+ {
+ hintmask->isNew = val;
+ }
+
+
+ /* clients call `getMaskPtr' in order to iterate */
+ /* through hint mask */
+
+ FT_LOCAL_DEF( FT_Byte* )
+ cf2_hintmask_getMaskPtr( CF2_HintMask hintmask )
+ {
+ return hintmask->mask;
+ }
+
+
+ static size_t
+ cf2_hintmask_setCounts( CF2_HintMask hintmask,
+ size_t bitCount )
+ {
+ if ( bitCount > CF2_MAX_HINTS )
+ {
+ /* total of h and v stems must be <= 96 */
+ CF2_SET_ERROR( hintmask->error, Invalid_Glyph_Format );
+ return 0;
+ }
+
+ hintmask->bitCount = bitCount;
+ hintmask->byteCount = ( hintmask->bitCount + 7 ) / 8;
+
+ hintmask->isValid = TRUE;
+ hintmask->isNew = TRUE;
+
+ return bitCount;
+ }
+
+
+ /* consume the hintmask bytes from the charstring, advancing the src */
+ /* pointer */
+ static void
+ cf2_hintmask_read( CF2_HintMask hintmask,
+ CF2_Buffer charstring,
+ size_t bitCount )
+ {
+ size_t i;
+
+#ifndef CF2_NDEBUG
+ /* these are the bits in the final mask byte that should be zero */
+ /* Note: this variable is only used in an assert expression below */
+ /* and then only if CF2_NDEBUG is not defined */
+ CF2_UInt mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
+#endif
+
+
+ /* initialize counts and isValid */
+ if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
+ return;
+
+ FT_ASSERT( hintmask->byteCount > 0 );
+
+ FT_TRACE4(( " (maskbytes:" ));
+
+ /* set mask and advance interpreter's charstring pointer */
+ for ( i = 0; i < hintmask->byteCount; i++ )
+ {
+ hintmask->mask[i] = (FT_Byte)cf2_buf_readByte( charstring );
+ FT_TRACE4(( " 0x%02X", hintmask->mask[i] ));
+ }
+
+ FT_TRACE4(( ")\n" ));
+
+ /* assert any unused bits in last byte are zero unless there's a prior */
+ /* error */
+ /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */
+#ifndef CF2_NDEBUG
+ FT_ASSERT( ( hintmask->mask[hintmask->byteCount - 1] & mask ) == 0 ||
+ *hintmask->error );
+#endif
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_hintmask_setAll( CF2_HintMask hintmask,
+ size_t bitCount )
+ {
+ size_t i;
+ CF2_UInt mask = ( 1 << ( -(CF2_Int)bitCount & 7 ) ) - 1;
+
+
+ /* initialize counts and isValid */
+ if ( cf2_hintmask_setCounts( hintmask, bitCount ) == 0 )
+ return;
+
+ FT_ASSERT( hintmask->byteCount > 0 );
+ FT_ASSERT( hintmask->byteCount <=
+ sizeof ( hintmask->mask ) / sizeof ( hintmask->mask[0] ) );
+
+ /* set mask to all ones */
+ for ( i = 0; i < hintmask->byteCount; i++ )
+ hintmask->mask[i] = 0xFF;
+
+ /* clear unused bits */
+ /* bitCount -> mask, 0 -> 0, 1 -> 7f, 2 -> 3f, ... 6 -> 3, 7 -> 1 */
+ hintmask->mask[hintmask->byteCount - 1] &= ~mask;
+ }
+
+
+ /* Type2 charstring opcodes */
+ enum
+ {
+ cf2_cmdRESERVED_0, /* 0 */
+ cf2_cmdHSTEM, /* 1 */
+ cf2_cmdRESERVED_2, /* 2 */
+ cf2_cmdVSTEM, /* 3 */
+ cf2_cmdVMOVETO, /* 4 */
+ cf2_cmdRLINETO, /* 5 */
+ cf2_cmdHLINETO, /* 6 */
+ cf2_cmdVLINETO, /* 7 */
+ cf2_cmdRRCURVETO, /* 8 */
+ cf2_cmdCLOSEPATH, /* 9 T1 only */
+ cf2_cmdCALLSUBR, /* 10 */
+ cf2_cmdRETURN, /* 11 */
+ cf2_cmdESC, /* 12 */
+ cf2_cmdHSBW, /* 13 T1 only */
+ cf2_cmdENDCHAR, /* 14 */
+ cf2_cmdVSINDEX, /* 15 */
+ cf2_cmdBLEND, /* 16 */
+ cf2_cmdRESERVED_17, /* 17 */
+ cf2_cmdHSTEMHM, /* 18 */
+ cf2_cmdHINTMASK, /* 19 */
+ cf2_cmdCNTRMASK, /* 20 */
+ cf2_cmdRMOVETO, /* 21 */
+ cf2_cmdHMOVETO, /* 22 */
+ cf2_cmdVSTEMHM, /* 23 */
+ cf2_cmdRCURVELINE, /* 24 */
+ cf2_cmdRLINECURVE, /* 25 */
+ cf2_cmdVVCURVETO, /* 26 */
+ cf2_cmdHHCURVETO, /* 27 */
+ cf2_cmdEXTENDEDNMBR, /* 28 */
+ cf2_cmdCALLGSUBR, /* 29 */
+ cf2_cmdVHCURVETO, /* 30 */
+ cf2_cmdHVCURVETO /* 31 */
+ };
+
+ enum
+ {
+ cf2_escDOTSECTION, /* 0 */
+ cf2_escVSTEM3, /* 1 T1 only */
+ cf2_escHSTEM3, /* 2 T1 only */
+ cf2_escAND, /* 3 */
+ cf2_escOR, /* 4 */
+ cf2_escNOT, /* 5 */
+ cf2_escSEAC, /* 6 T1 only */
+ cf2_escSBW, /* 7 T1 only */
+ cf2_escRESERVED_8, /* 8 */
+ cf2_escABS, /* 9 */
+ cf2_escADD, /* 10 like otherADD */
+ cf2_escSUB, /* 11 like otherSUB */
+ cf2_escDIV, /* 12 */
+ cf2_escRESERVED_13, /* 13 */
+ cf2_escNEG, /* 14 */
+ cf2_escEQ, /* 15 */
+ cf2_escCALLOTHERSUBR,/* 16 T1 only */
+ cf2_escPOP, /* 17 T1 only */
+ cf2_escDROP, /* 18 */
+ cf2_escRESERVED_19, /* 19 */
+ cf2_escPUT, /* 20 like otherPUT */
+ cf2_escGET, /* 21 like otherGET */
+ cf2_escIFELSE, /* 22 like otherIFELSE */
+ cf2_escRANDOM, /* 23 like otherRANDOM */
+ cf2_escMUL, /* 24 like otherMUL */
+ cf2_escRESERVED_25, /* 25 */
+ cf2_escSQRT, /* 26 */
+ cf2_escDUP, /* 27 like otherDUP */
+ cf2_escEXCH, /* 28 like otherEXCH */
+ cf2_escINDEX, /* 29 */
+ cf2_escROLL, /* 30 */
+ cf2_escRESERVED_31, /* 31 */
+ cf2_escRESERVED_32, /* 32 */
+ cf2_escSETCURRENTPT, /* 33 T1 only */
+ cf2_escHFLEX, /* 34 */
+ cf2_escFLEX, /* 35 */
+ cf2_escHFLEX1, /* 36 */
+ cf2_escFLEX1, /* 37 */
+ cf2_escRESERVED_38 /* 38 & all higher */
+ };
+
+
+ /* `stemHintArray' does not change once we start drawing the outline. */
+ static void
+ cf2_doStems( const CF2_Font font,
+ CF2_Stack opStack,
+ CF2_ArrStack stemHintArray,
+ CF2_Fixed* width,
+ FT_Bool* haveWidth,
+ CF2_Fixed hintOffset )
+ {
+ CF2_UInt i;
+ CF2_UInt count = cf2_stack_count( opStack );
+ FT_Bool hasWidthArg = (FT_Bool)( count & 1 );
+
+ /* variable accumulates delta values from operand stack */
+ CF2_Fixed position = hintOffset;
+
+ if ( font->isT1 && !font->decoder->flex_state && !*haveWidth )
+ FT_ERROR(( "cf2_doStems (Type 1 mode):"
+ " No width. Use hsbw/sbw as first op\n" ));
+
+ if ( !font->isT1 && hasWidthArg && !*haveWidth )
+ *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
+ cf2_getNominalWidthX( font->decoder ) );
+
+ if ( font->decoder->width_only )
+ goto exit;
+
+ for ( i = hasWidthArg ? 1 : 0; i < count; i += 2 )
+ {
+ /* construct a CF2_StemHint and push it onto the list */
+ CF2_StemHintRec stemhint;
+
+
+ stemhint.min =
+ position = ADD_INT32( position,
+ cf2_stack_getReal( opStack, i ) );
+ stemhint.max =
+ position = ADD_INT32( position,
+ cf2_stack_getReal( opStack, i + 1 ) );
+
+ stemhint.used = FALSE;
+ stemhint.maxDS =
+ stemhint.minDS = 0;
+
+ cf2_arrstack_push( stemHintArray, &stemhint ); /* defer error check */
+ }
+
+ cf2_stack_clear( opStack );
+
+ exit:
+ /* cf2_doStems must define a width (may be default) */
+ *haveWidth = TRUE;
+ }
+
+
+ static void
+ cf2_doFlex( CF2_Stack opStack,
+ CF2_Fixed* curX,
+ CF2_Fixed* curY,
+ CF2_GlyphPath glyphPath,
+ const FT_Bool* readFromStack,
+ FT_Bool doConditionalLastRead )
+ {
+ CF2_Fixed vals[14];
+ CF2_UInt idx;
+ FT_Bool isHFlex;
+ CF2_Int top, i, j;
+
+
+ vals[0] = *curX;
+ vals[1] = *curY;
+ idx = 0;
+ isHFlex = FT_BOOL( readFromStack[9] == FALSE );
+ top = isHFlex ? 9 : 10;
+
+ for ( i = 0; i < top; i++ )
+ {
+ vals[i + 2] = vals[i];
+ if ( readFromStack[i] )
+ vals[i + 2] = ADD_INT32( vals[i + 2], cf2_stack_getReal( opStack,
+ idx++ ) );
+ }
+
+ if ( isHFlex )
+ vals[9 + 2] = *curY;
+
+ if ( doConditionalLastRead )
+ {
+ FT_Bool lastIsX = (FT_Bool)(
+ cf2_fixedAbs( SUB_INT32( vals[10], *curX ) ) >
+ cf2_fixedAbs( SUB_INT32( vals[11], *curY ) ) );
+ CF2_Fixed lastVal = cf2_stack_getReal( opStack, idx );
+
+
+ if ( lastIsX )
+ {
+ vals[12] = ADD_INT32( vals[10], lastVal );
+ vals[13] = *curY;
+ }
+ else
+ {
+ vals[12] = *curX;
+ vals[13] = ADD_INT32( vals[11], lastVal );
+ }
+ }
+ else
+ {
+ if ( readFromStack[10] )
+ vals[12] = ADD_INT32( vals[10],
+ cf2_stack_getReal( opStack, idx++ ) );
+ else
+ vals[12] = *curX;
+
+ if ( readFromStack[11] )
+ vals[13] = ADD_INT32( vals[11],
+ cf2_stack_getReal( opStack, idx ) );
+ else
+ vals[13] = *curY;
+ }
+
+ for ( j = 0; j < 2; j++ )
+ cf2_glyphpath_curveTo( glyphPath, vals[j * 6 + 2],
+ vals[j * 6 + 3],
+ vals[j * 6 + 4],
+ vals[j * 6 + 5],
+ vals[j * 6 + 6],
+ vals[j * 6 + 7] );
+
+ cf2_stack_clear( opStack );
+
+ *curX = vals[12];
+ *curY = vals[13];
+ }
+
+
+ /* Blend numOperands on the stack, */
+ /* store results into the first numBlends values, */
+ /* then pop remaining arguments. */
+ static void
+ cf2_doBlend( const CFF_Blend blend,
+ CF2_Stack opStack,
+ CF2_UInt numBlends )
+ {
+ CF2_UInt delta;
+ CF2_UInt base;
+ CF2_UInt i, j;
+ CF2_UInt numOperands = (CF2_UInt)( numBlends * blend->lenBV );
+
+
+ base = cf2_stack_count( opStack ) - numOperands;
+ delta = base + numBlends;
+
+ for ( i = 0; i < numBlends; i++ )
+ {
+ const CF2_Fixed* weight = &blend->BV[1];
+
+ /* start with first term */
+ CF2_Fixed sum = cf2_stack_getReal( opStack, i + base );
+
+
+ for ( j = 1; j < blend->lenBV; j++ )
+ sum = ADD_INT32( sum,
+ FT_MulFix( *weight++,
+ cf2_stack_getReal( opStack,
+ delta++ ) ) );
+
+ /* store blended result */
+ cf2_stack_setReal( opStack, i + base, sum );
+ }
+
+ /* leave only `numBlends' results on stack */
+ cf2_stack_pop( opStack, numOperands - numBlends );
+ }
+
+
+ /*
+ * `error' is a shared error code used by many objects in this
+ * routine. Before the code continues from an error, it must check and
+ * record the error in `*error'. The idea is that this shared
+ * error code will record the first error encountered. If testing
+ * for an error anyway, the cost of `goto exit' is small, so we do it,
+ * even if continuing would be safe. In this case, `lastError' is
+ * set, so the testing and storing can be done in one place, at `exit'.
+ *
+ * Continuing after an error is intended for objects which do their own
+ * testing of `*error', e.g., array stack functions. This allows us to
+ * avoid an extra test after the call.
+ *
+ * Unimplemented opcodes are ignored.
+ *
+ */
+ FT_LOCAL_DEF( void )
+ cf2_interpT2CharString( CF2_Font font,
+ CF2_Buffer buf,
+ CF2_OutlineCallbacks callbacks,
+ const FT_Vector* translation,
+ FT_Bool doingSeac,
+ CF2_Fixed curX,
+ CF2_Fixed curY,
+ CF2_Fixed* width )
+ {
+ /* lastError is used for errors that are immediately tested */
+ FT_Error lastError = FT_Err_Ok;
+
+ /* pointer to parsed font object */
+ PS_Decoder* decoder = font->decoder;
+
+ FT_Error* error = &font->error;
+ FT_Memory memory = font->memory;
+
+ CF2_Fixed scaleY = font->innerTransform.d;
+ CF2_Fixed nominalWidthX = cf2_getNominalWidthX( decoder );
+
+ /* stuff for Type 1 */
+ FT_Int known_othersubr_result_cnt = 0;
+ FT_Bool large_int = FALSE;
+ FT_Bool initial_map_ready = FALSE;
+
+#define PS_STORAGE_SIZE 3
+ CF2_F16Dot16 results[PS_STORAGE_SIZE]; /* for othersubr results */
+ FT_Int result_cnt = 0;
+
+ /* save this for hinting seac accents */
+ CF2_Fixed hintOriginY = curY;
+
+ CF2_Stack opStack = NULL;
+ FT_UInt stackSize;
+ FT_Byte op1; /* first opcode byte */
+
+ CF2_F16Dot16 storage[CF2_STORAGE_SIZE]; /* for `put' and `get' */
+ CF2_F16Dot16 flexStore[6]; /* for Type 1 flex */
+
+ /* instruction limit; 20,000,000 matches Avalon */
+ FT_UInt32 instructionLimit = 20000000UL;
+
+ CF2_ArrStackRec subrStack;
+
+ FT_Bool haveWidth;
+ CF2_Buffer charstring = NULL;
+
+ CF2_Int charstringIndex = -1; /* initialize to empty */
+
+ /* TODO: placeholders for hint structures */
+
+ /* objects used for hinting */
+ CF2_ArrStackRec hStemHintArray;
+ CF2_ArrStackRec vStemHintArray;
+
+ CF2_HintMaskRec hintMask;
+ CF2_GlyphPathRec glyphPath;
+
+
+ FT_ZERO( &storage );
+ FT_ZERO( &results );
+ FT_ZERO( &flexStore );
+
+ /* initialize the remaining objects */
+ cf2_arrstack_init( &subrStack,
+ memory,
+ error,
+ sizeof ( CF2_BufferRec ) );
+ cf2_arrstack_init( &hStemHintArray,
+ memory,
+ error,
+ sizeof ( CF2_StemHintRec ) );
+ cf2_arrstack_init( &vStemHintArray,
+ memory,
+ error,
+ sizeof ( CF2_StemHintRec ) );
+
+ /* initialize CF2_StemHint arrays */
+ cf2_hintmask_init( &hintMask, error );
+
+ /* initialize path map to manage drawing operations */
+
+ /* Note: last 4 params are used to handle `MoveToPermissive', which */
+ /* may need to call `hintMap.Build' */
+ /* TODO: MoveToPermissive is gone; are these still needed? */
+ cf2_glyphpath_init( &glyphPath,
+ font,
+ callbacks,
+ scaleY,
+ /* hShift, */
+ &hStemHintArray,
+ &vStemHintArray,
+ &hintMask,
+ hintOriginY,
+ &font->blues,
+ translation );
+
+ /*
+ * Initialize state for width parsing. From the CFF Spec:
+ *
+ * The first stack-clearing operator, which must be one of hstem,
+ * hstemhm, vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto,
+ * rmoveto, or endchar, takes an additional argument - the width (as
+ * described earlier), which may be expressed as zero or one numeric
+ * argument.
+ *
+ * What we implement here uses the first validly specified width, but
+ * does not detect errors for specifying more than one width.
+ *
+ * If one of the above operators occurs without explicitly specifying
+ * a width, we assume the default width.
+ *
+ * CFF2 charstrings always return the default width (0).
+ *
+ */
+ haveWidth = font->isCFF2 ? TRUE : FALSE;
+ *width = cf2_getDefaultWidthX( decoder );
+
+ /*
+ * Note: At this point, all pointers to resources must be NULL
+ * and all local objects must be initialized.
+ * There must be no branches to `exit:' above this point.
+ *
+ */
+
+ /* allocate an operand stack */
+ stackSize = font->isCFF2 ? cf2_getMaxstack( decoder )
+ : CF2_OPERAND_STACK_SIZE;
+ opStack = cf2_stack_init( memory, error, stackSize );
+
+ if ( !opStack )
+ {
+ lastError = FT_THROW( Out_Of_Memory );
+ goto exit;
+ }
+
+ /* initialize subroutine stack by placing top level charstring as */
+ /* first element (max depth plus one for the charstring) */
+ /* Note: Caller owns and must finalize the first charstring. */
+ /* Our copy of it does not change that requirement. */
+ cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );
+
+ charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
+ *charstring = *buf; /* structure copy */
+
+ charstringIndex = 0; /* entry is valid now */
+
+ /* catch errors so far */
+ if ( *error )
+ goto exit;
+
+ /* main interpreter loop */
+ while ( 1 )
+ {
+ if ( font->isT1 )
+ FT_ASSERT( known_othersubr_result_cnt == 0 ||
+ result_cnt == 0 );
+
+ if ( cf2_buf_isEnd( charstring ) )
+ {
+ /* If we've reached the end of the charstring, simulate a */
+ /* cf2_cmdRETURN or cf2_cmdENDCHAR. */
+ /* We do this for both CFF and CFF2. */
+ if ( charstringIndex )
+ op1 = cf2_cmdRETURN; /* end of buffer for subroutine */
+ else
+ op1 = cf2_cmdENDCHAR; /* end of buffer for top level charstring */
+ }
+ else
+ {
+ op1 = (FT_Byte)cf2_buf_readByte( charstring );
+
+ /* Explicit RETURN and ENDCHAR in CFF2 should be ignored. */
+ /* Note: Trace message will report 0 instead of 11 or 14. */
+ if ( ( op1 == cf2_cmdRETURN || op1 == cf2_cmdENDCHAR ) &&
+ font->isCFF2 )
+ op1 = cf2_cmdRESERVED_0;
+ }
+
+ if ( font->isT1 )
+ {
+ if ( !initial_map_ready &&
+ !( op1 == cf2_cmdHSTEM ||
+ op1 == cf2_cmdVSTEM ||
+ op1 == cf2_cmdHSBW ||
+ op1 == cf2_cmdCALLSUBR ||
+ op1 == cf2_cmdRETURN ||
+ op1 == cf2_cmdESC ||
+ op1 == cf2_cmdENDCHAR ||
+ op1 >= 32 /* Numbers */ ) )
+ {
+ /* Skip outline commands first time round. */
+ /* `endchar' will trigger initial hintmap build */
+ /* and rewind the charstring. */
+ cf2_stack_clear( opStack );
+ continue;
+ }
+
+ if ( result_cnt > 0 &&
+ !( op1 == cf2_cmdCALLSUBR ||
+ op1 == cf2_cmdRETURN ||
+ op1 == cf2_cmdESC ||
+ op1 >= 32 /* Numbers */ ) )
+ {
+ /* all operands have been transferred by previous pops */
+ result_cnt = 0;
+ }
+
+ if ( large_int && !( op1 >= 32 || op1 == cf2_escDIV ) )
+ {
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " no `div' after large integer\n" ));
+
+ large_int = FALSE;
+ }
+ }
+
+ /* check for errors once per loop */
+ if ( *error )
+ goto exit;
+
+ instructionLimit--;
+ if ( instructionLimit == 0 )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ switch( op1 )
+ {
+ case cf2_cmdRESERVED_0:
+ case cf2_cmdRESERVED_2:
+ case cf2_cmdRESERVED_17:
+ /* we may get here if we have a prior error */
+ FT_TRACE4(( " unknown op (%d)\n", op1 ));
+ break;
+
+ case cf2_cmdVSINDEX:
+ FT_TRACE4(( " vsindex\n" ));
+
+ if ( !font->isCFF2 )
+ break; /* clear stack & ignore */
+
+ if ( font->blend.usedBV )
+ {
+ /* vsindex not allowed after blend */
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ {
+ FT_Int temp = cf2_stack_popInt( opStack );
+
+
+ if ( temp >= 0 )
+ font->vsindex = (FT_UInt)temp;
+ }
+ break;
+
+ case cf2_cmdBLEND:
+ {
+ FT_UInt numBlends;
+
+
+ FT_TRACE4(( " blend\n" ));
+
+ if ( !font->isCFF2 )
+ break; /* clear stack & ignore */
+
+ /* do we have a `blend' op in a non-variant font? */
+ if ( !font->blend.font )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* check cached blend vector */
+ if ( font->cffload->blend_check_vector( &font->blend,
+ font->vsindex,
+ font->lenNDV,
+ font->NDV ) )
+ {
+ lastError = font->cffload->blend_build_vector( &font->blend,
+ font->vsindex,
+ font->lenNDV,
+ font->NDV );
+ if ( lastError )
+ goto exit;
+ }
+
+ /* do the blend */
+ numBlends = (FT_UInt)cf2_stack_popInt( opStack );
+ if ( numBlends > stackSize )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ cf2_doBlend( &font->blend, opStack, numBlends );
+
+ font->blend.usedBV = TRUE;
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_cmdHSTEMHM:
+ case cf2_cmdHSTEM:
+ FT_TRACE4(( op1 == cf2_cmdHSTEMHM ? " hstemhm\n" : " hstem\n" ));
+
+ if ( !font->isT1 )
+ {
+ /* never add hints after the mask is computed */
+ /* except if in Type 1 mode (no hintmask op) */
+ if ( cf2_hintmask_isValid( &hintMask ) )
+ {
+ FT_TRACE4(( "cf2_interpT2CharString:"
+ " invalid horizontal hint mask\n" ));
+ break;
+ }
+ }
+
+ /* add left-sidebearing correction in Type 1 mode */
+ cf2_doStems( font,
+ opStack,
+ &hStemHintArray,
+ width,
+ &haveWidth,
+ font->isT1 ? decoder->builder.left_bearing->y
+ : 0 );
+
+ if ( decoder->width_only )
+ goto exit;
+
+ break;
+
+ case cf2_cmdVSTEMHM:
+ case cf2_cmdVSTEM:
+ FT_TRACE4(( op1 == cf2_cmdVSTEMHM ? " vstemhm\n" : " vstem\n" ));
+
+ if ( !font->isT1 )
+ {
+ /* never add hints after the mask is computed */
+ /* except if in Type 1 mode (no hintmask op) */
+ if ( cf2_hintmask_isValid( &hintMask ) )
+ {
+ FT_TRACE4(( "cf2_interpT2CharString:"
+ " invalid vertical hint mask\n" ));
+ break;
+ }
+ }
+
+ /* add left-sidebearing correction in Type 1 mode */
+ cf2_doStems( font,
+ opStack,
+ &vStemHintArray,
+ width,
+ &haveWidth,
+ font->isT1 ? decoder->builder.left_bearing->x
+ : 0 );
+
+ if ( decoder->width_only )
+ goto exit;
+
+ break;
+
+ case cf2_cmdVMOVETO:
+ FT_TRACE4(( " vmoveto\n" ));
+
+ if ( font->isT1 && !decoder->flex_state && !haveWidth )
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " No width. Use hsbw/sbw as first op\n" ));
+
+ if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
+ *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
+ nominalWidthX );
+
+ /* width is defined or default after this */
+ haveWidth = TRUE;
+
+ if ( decoder->width_only )
+ goto exit;
+
+ curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) );
+
+ if ( !decoder->flex_state )
+ cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+ break;
+
+ case cf2_cmdRLINETO:
+ {
+ CF2_UInt idx;
+ CF2_UInt count = cf2_stack_count( opStack );
+
+
+ FT_TRACE4(( " rlineto\n" ));
+
+ for ( idx = 0; idx < count; idx += 2 )
+ {
+ curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
+ idx + 0 ) );
+ curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
+ idx + 1 ) );
+
+ cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdHLINETO:
+ case cf2_cmdVLINETO:
+ {
+ CF2_UInt idx;
+ CF2_UInt count = cf2_stack_count( opStack );
+
+ FT_Bool isX = FT_BOOL( op1 == cf2_cmdHLINETO );
+
+
+ FT_TRACE4(( isX ? " hlineto\n" : " vlineto\n" ));
+
+ for ( idx = 0; idx < count; idx++ )
+ {
+ CF2_Fixed v = cf2_stack_getReal( opStack, idx );
+
+
+ if ( isX )
+ curX = ADD_INT32( curX, v );
+ else
+ curY = ADD_INT32( curY, v );
+
+ isX = !isX;
+
+ cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue;
+
+ case cf2_cmdRCURVELINE:
+ case cf2_cmdRRCURVETO:
+ {
+ CF2_UInt count = cf2_stack_count( opStack );
+ CF2_UInt idx = 0;
+
+
+ FT_TRACE4(( op1 == cf2_cmdRCURVELINE ? " rcurveline\n"
+ : " rrcurveto\n" ));
+
+ while ( idx + 6 <= count )
+ {
+ CF2_Fixed x1, y1, x2, y2, x3, y3;
+
+
+ x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
+ y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), curY );
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y1 );
+ x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
+ y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 5 ), y2 );
+
+ cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+ curX = x3;
+ curY = y3;
+ idx += 6;
+ }
+
+ if ( op1 == cf2_cmdRCURVELINE )
+ {
+ curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
+ idx + 0 ) );
+ curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
+ idx + 1 ) );
+
+ cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdCLOSEPATH:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (%d)\n", op1 ));
+ else
+ {
+ FT_TRACE4(( " closepath" ));
+
+ /* if there is no path, `closepath' is a no-op */
+ ps_builder_close_contour( &decoder->builder );
+
+ haveWidth = TRUE;
+ }
+ break;
+
+ case cf2_cmdCALLGSUBR:
+ case cf2_cmdCALLSUBR:
+ {
+ CF2_Int subrNum;
+
+
+ FT_TRACE4(( op1 == cf2_cmdCALLGSUBR ? " callgsubr"
+ : " callsubr" ));
+
+ if ( ( !font->isT1 && charstringIndex > CF2_MAX_SUBR ) ||
+ ( font->isT1 && charstringIndex > T1_MAX_SUBRS_CALLS ) )
+ {
+ /* max subr plus one for charstring */
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* overflow of stack */
+ }
+
+ /* push our current CFF charstring region on subrStack */
+ charstring = (CF2_Buffer)
+ cf2_arrstack_getPointer(
+ &subrStack,
+ (size_t)charstringIndex + 1 );
+
+ /* set up the new CFF region and pointer */
+ subrNum = cf2_stack_popInt( opStack );
+
+ if ( font->isT1 && decoder->locals_hash )
+ {
+ size_t* val = ft_hash_num_lookup( subrNum,
+ decoder->locals_hash );
+
+
+ if ( val )
+ subrNum = *val;
+ else
+ subrNum = -1;
+ }
+
+ switch ( op1 )
+ {
+ case cf2_cmdCALLGSUBR:
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrNum + decoder->globals_bias,
+ charstringIndex + 1 ));
+
+ if ( cf2_initGlobalRegionBuffer( decoder,
+ subrNum,
+ charstring ) )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* subroutine lookup or stream error */
+ }
+ break;
+
+ default:
+ /* cf2_cmdCALLSUBR */
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrNum + decoder->locals_bias,
+ charstringIndex + 1 ));
+
+ if ( cf2_initLocalRegionBuffer( decoder,
+ subrNum,
+ charstring ) )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* subroutine lookup or stream error */
+ }
+ }
+
+ charstringIndex += 1; /* entry is valid now */
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_cmdRETURN:
+ FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
+
+ if ( charstringIndex < 1 )
+ {
+ /* Note: cannot return from top charstring */
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* underflow of stack */
+ }
+
+ /* restore position in previous charstring */
+ charstring = (CF2_Buffer)
+ cf2_arrstack_getPointer(
+ &subrStack,
+ (CF2_UInt)--charstringIndex );
+ continue; /* do not clear the stack */
+
+ case cf2_cmdESC:
+ {
+ FT_Byte op2 = (FT_Byte)cf2_buf_readByte( charstring );
+
+
+ /* first switch for 2-byte operators handles CFF2 */
+ /* and opcodes that are reserved for both CFF and CFF2 */
+ switch ( op2 )
+ {
+ case cf2_escHFLEX:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, FALSE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, FALSE /* dy3 */,
+ TRUE /* dx4 */, FALSE /* dy4 */,
+ TRUE /* dx5 */, FALSE /* dy5 */,
+ TRUE /* dx6 */, FALSE /* dy6 */
+ };
+
+
+ FT_TRACE4(( " hflex\n" ));
+
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
+ }
+ continue;
+
+ case cf2_escFLEX:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, TRUE /* dy3 */,
+ TRUE /* dx4 */, TRUE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ TRUE /* dx6 */, TRUE /* dy6 */
+ };
+
+
+ FT_TRACE4(( " flex\n" ));
+
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
+ }
+ break; /* TODO: why is this not a continue? */
+
+ case cf2_escHFLEX1:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, FALSE /* dy3 */,
+ TRUE /* dx4 */, FALSE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ TRUE /* dx6 */, FALSE /* dy6 */
+ };
+
+
+ FT_TRACE4(( " hflex1\n" ));
+
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ FALSE /* doConditionalLastRead */ );
+ }
+ continue;
+
+ case cf2_escFLEX1:
+ {
+ static const FT_Bool readFromStack[12] =
+ {
+ TRUE /* dx1 */, TRUE /* dy1 */,
+ TRUE /* dx2 */, TRUE /* dy2 */,
+ TRUE /* dx3 */, TRUE /* dy3 */,
+ TRUE /* dx4 */, TRUE /* dy4 */,
+ TRUE /* dx5 */, TRUE /* dy5 */,
+ FALSE /* dx6 */, FALSE /* dy6 */
+ };
+
+
+ FT_TRACE4(( " flex1\n" ));
+
+ cf2_doFlex( opStack,
+ &curX,
+ &curY,
+ &glyphPath,
+ readFromStack,
+ TRUE /* doConditionalLastRead */ );
+ }
+ continue;
+
+ /* these opcodes are always reserved */
+ case cf2_escRESERVED_8:
+ case cf2_escRESERVED_13:
+ case cf2_escRESERVED_19:
+ case cf2_escRESERVED_25:
+ case cf2_escRESERVED_31:
+ case cf2_escRESERVED_32:
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ break;
+
+ default:
+ {
+ if ( font->isCFF2 || op2 >= cf2_escRESERVED_38 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else if ( font->isT1 && result_cnt > 0 && op2 != cf2_escPOP )
+ {
+ /* all operands have been transferred by previous pops */
+ result_cnt = 0;
+ }
+ else
+ {
+ /* second switch for 2-byte operators handles */
+ /* CFF and Type 1 */
+ switch ( op2 )
+ {
+
+ case cf2_escDOTSECTION:
+ /* something about `flip type of locking' -- ignore it */
+ FT_TRACE4(( " dotsection\n" ));
+
+ break;
+
+ case cf2_escVSTEM3:
+ case cf2_escHSTEM3:
+ /*
+ * Type 1: Type 2:
+ * x0 dx0 x1 dx1 x2 dx2 vstem3 x dx {dxa dxb}* vstem
+ * y0 dy0 y1 dy1 y2 dy2 hstem3 y dy {dya dyb}* hstem
+ * relative to lsb point relative to zero
+ *
+ */
+ {
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ CF2_F16Dot16 v0, v1, v2;
+
+ FT_Bool isV = FT_BOOL( op2 == cf2_escVSTEM3 );
+
+
+ FT_TRACE4(( isV ? " vstem3\n"
+ : " hstem3\n" ));
+
+ FT_ASSERT( cf2_stack_count( opStack ) == 6 );
+
+ v0 = cf2_stack_getReal( opStack, 0 );
+ v1 = cf2_stack_getReal( opStack, 2 );
+ v2 = cf2_stack_getReal( opStack, 4 );
+
+ cf2_stack_setReal(
+ opStack, 2,
+ SUB_INT32( SUB_INT32( v1, v0 ),
+ cf2_stack_getReal( opStack, 1 ) ) );
+ cf2_stack_setReal(
+ opStack, 4,
+ SUB_INT32( SUB_INT32( v2, v1 ),
+ cf2_stack_getReal( opStack, 3 ) ) );
+
+ /* add left-sidebearing correction */
+ cf2_doStems( font,
+ opStack,
+ isV ? &vStemHintArray : &hStemHintArray,
+ width,
+ &haveWidth,
+ isV ? decoder->builder.left_bearing->x
+ : decoder->builder.left_bearing->y );
+
+ if ( decoder->width_only )
+ goto exit;
+ }
+ }
+ break;
+
+ case cf2_escAND:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+
+
+ FT_TRACE4(( " and\n" ));
+
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushInt( opStack, arg1 && arg2 );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escOR:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+
+
+ FT_TRACE4(( " or\n" ));
+
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushInt( opStack, arg1 || arg2 );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escNOT:
+ {
+ CF2_F16Dot16 arg;
+
+
+ FT_TRACE4(( " not\n" ));
+
+ arg = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushInt( opStack, !arg );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escSEAC:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ FT_Error error2;
+ CF2_Int bchar_index, achar_index;
+ FT_Vector left_bearing, advance;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ T1_Face face = (T1_Face)decoder->builder.face;
+#endif
+ CF2_BufferRec component;
+ CF2_Fixed dummyWidth;
+
+ CF2_Int achar = cf2_stack_popInt( opStack );
+ CF2_Int bchar = cf2_stack_popInt( opStack );
+
+ FT_Pos ady = cf2_stack_popFixed ( opStack );
+ FT_Pos adx = cf2_stack_popFixed ( opStack );
+ FT_Pos asb = cf2_stack_popFixed ( opStack );
+
+
+ FT_TRACE4(( " seac\n" ));
+
+ if ( doingSeac )
+ {
+ FT_ERROR(( " nested seac\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* nested seac */
+ }
+
+ if ( decoder->builder.metrics_only )
+ {
+ FT_ERROR(( " unexpected seac\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* unexpected seac */
+ }
+
+ /* `glyph_names' is set to 0 for CID fonts which do */
+ /* not include an encoding. How can we deal with */
+ /* these? */
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ if ( decoder->glyph_names == 0 &&
+ !face->root.internal->incremental_interface )
+#else
+ if ( decoder->glyph_names == 0 )
+#endif /* FT_CONFIG_OPTION_INCREMENTAL */
+ {
+ FT_ERROR((
+ "cf2_interpT2CharString: (Type 1 seac)"
+ " glyph names table not available in this font\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* seac weirdness */
+ adx += decoder->builder.left_bearing->x;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ if ( face->root.internal->incremental_interface )
+ {
+ /* the caller must handle the font encoding also */
+ bchar_index = bchar;
+ achar_index = achar;
+ }
+ else
+#endif
+ {
+ bchar_index = t1_lookup_glyph_by_stdcharcode_ps(
+ decoder, bchar );
+ achar_index = t1_lookup_glyph_by_stdcharcode_ps(
+ decoder, achar );
+ }
+
+ if ( bchar_index < 0 || achar_index < 0 )
+ {
+ FT_ERROR((
+ "cf2_interpT2CharString: (Type 1 seac)"
+ " invalid seac character code arguments\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* if we are trying to load a composite glyph, */
+ /* do not load the accent character and return */
+ /* the array of subglyphs. */
+ if ( decoder->builder.no_recurse )
+ {
+ FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
+ FT_GlyphLoader loader = glyph->internal->loader;
+ FT_SubGlyph subg;
+
+
+ /* reallocate subglyph array if necessary */
+ error2 = FT_GlyphLoader_CheckSubGlyphs( loader, 2 );
+ if ( error2 )
+ {
+ lastError = error2; /* pass FreeType error through */
+ goto exit;
+ }
+
+ subg = loader->current.subglyphs;
+
+ /* subglyph 0 = base character */
+ subg->index = bchar_index;
+ subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES |
+ FT_SUBGLYPH_FLAG_USE_MY_METRICS;
+ subg->arg1 = 0;
+ subg->arg2 = 0;
+ subg++;
+
+ /* subglyph 1 = accent character */
+ subg->index = achar_index;
+ subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;
+ subg->arg1 = (FT_Int)FIXED_TO_INT( adx - asb );
+ subg->arg2 = (FT_Int)FIXED_TO_INT( ady );
+
+ /* set up remaining glyph fields */
+ glyph->num_subglyphs = 2;
+ glyph->subglyphs = loader->base.subglyphs;
+ glyph->format = FT_GLYPH_FORMAT_COMPOSITE;
+
+ loader->current.num_subglyphs = 2;
+
+ goto exit;
+ }
+
+ /* First load `bchar' in builder */
+ /* now load the unscaled outline */
+
+ /* prepare loader */
+ FT_GlyphLoader_Prepare( decoder->builder.loader );
+
+ error2 = cf2_getT1SeacComponent( decoder,
+ (FT_UInt)bchar_index,
+ &component );
+ if ( error2 )
+ {
+ lastError = error2; /* pass FreeType error through */
+ goto exit;
+ }
+ cf2_interpT2CharString( font,
+ &component,
+ callbacks,
+ translation,
+ TRUE,
+ 0,
+ 0,
+ &dummyWidth );
+ cf2_freeT1SeacComponent( decoder, &component );
+
+ /* save the left bearing and width of the base */
+ /* character as they will be erased by the next load */
+
+ left_bearing = *decoder->builder.left_bearing;
+ advance = *decoder->builder.advance;
+
+ decoder->builder.left_bearing->x = 0;
+ decoder->builder.left_bearing->y = 0;
+
+ /* Now load `achar' on top of */
+ /* the base outline */
+
+ error2 = cf2_getT1SeacComponent( decoder,
+ (FT_UInt)achar_index,
+ &component );
+ if ( error2 )
+ {
+ lastError = error2; /* pass FreeType error through */
+ goto exit;
+ }
+ cf2_interpT2CharString( font,
+ &component,
+ callbacks,
+ translation,
+ TRUE,
+ adx - asb,
+ ady,
+ &dummyWidth );
+ cf2_freeT1SeacComponent( decoder, &component );
+
+ /* restore the left side bearing and */
+ /* advance width of the base character */
+
+ *decoder->builder.left_bearing = left_bearing;
+ *decoder->builder.advance = advance;
+
+ goto exit;
+ }
+ break;
+
+ case cf2_escSBW:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ CF2_Fixed lsb_x, lsb_y;
+ PS_Builder* builder;
+
+
+ FT_TRACE4(( " sbw" ));
+
+ builder = &decoder->builder;
+
+ builder->advance->y = cf2_stack_popFixed( opStack );
+ builder->advance->x = cf2_stack_popFixed( opStack );
+
+ lsb_y = cf2_stack_popFixed( opStack );
+ lsb_x = cf2_stack_popFixed( opStack );
+
+ builder->left_bearing->x =
+ ADD_INT32( builder->left_bearing->x, lsb_x );
+ builder->left_bearing->y =
+ ADD_INT32( builder->left_bearing->y, lsb_y );
+
+ haveWidth = TRUE;
+
+ /* the `metrics_only' indicates that we only want */
+ /* to compute the glyph's metrics (lsb + advance */
+ /* width), not load the rest of it; so exit */
+ /* immediately */
+ if ( builder->metrics_only )
+ goto exit;
+
+ if ( initial_map_ready )
+ {
+ curX = ADD_INT32( curX, lsb_x );
+ curY = ADD_INT32( curY, lsb_y );
+ }
+ }
+ break;
+
+ case cf2_escABS:
+ {
+ CF2_F16Dot16 arg;
+
+
+ FT_TRACE4(( " abs\n" ));
+
+ arg = cf2_stack_popFixed( opStack );
+
+ if ( arg < -CF2_FIXED_MAX )
+ cf2_stack_pushFixed( opStack, CF2_FIXED_MAX );
+ else
+ cf2_stack_pushFixed( opStack, FT_ABS( arg ) );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escADD:
+ {
+ CF2_F16Dot16 summand1;
+ CF2_F16Dot16 summand2;
+
+
+ FT_TRACE4(( " add\n" ));
+
+ summand2 = cf2_stack_popFixed( opStack );
+ summand1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ ADD_INT32( summand1,
+ summand2 ) );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escSUB:
+ {
+ CF2_F16Dot16 minuend;
+ CF2_F16Dot16 subtrahend;
+
+
+ FT_TRACE4(( " sub\n" ));
+
+ subtrahend = cf2_stack_popFixed( opStack );
+ minuend = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ SUB_INT32( minuend, subtrahend ) );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escDIV:
+ {
+ CF2_F16Dot16 dividend;
+ CF2_F16Dot16 divisor;
+
+
+ FT_TRACE4(( " div\n" ));
+
+ if ( font->isT1 && large_int )
+ {
+ divisor = (CF2_F16Dot16)cf2_stack_popInt( opStack );
+ dividend = (CF2_F16Dot16)cf2_stack_popInt( opStack );
+
+ large_int = FALSE;
+ }
+ else
+ {
+ divisor = cf2_stack_popFixed( opStack );
+ dividend = cf2_stack_popFixed( opStack );
+ }
+
+ cf2_stack_pushFixed( opStack,
+ FT_DivFix( dividend, divisor ) );
+
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escNEG:
+ {
+ CF2_F16Dot16 arg;
+
+
+ FT_TRACE4(( " neg\n" ));
+
+ arg = cf2_stack_popFixed( opStack );
+
+ if ( arg < -CF2_FIXED_MAX )
+ cf2_stack_pushFixed( opStack, CF2_FIXED_MAX );
+ else
+ cf2_stack_pushFixed( opStack, -arg );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escEQ:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+
+
+ FT_TRACE4(( " eq\n" ));
+
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushInt( opStack, arg1 == arg2 );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escCALLOTHERSUBR:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ CF2_Int subr_no;
+ CF2_Int arg_cnt;
+ CF2_UInt count;
+ CF2_UInt opIdx = 0;
+
+
+ FT_TRACE4(( " callothersubr\n" ));
+
+ subr_no = cf2_stack_popInt( opStack );
+ arg_cnt = cf2_stack_popInt( opStack );
+
+ /*******************************************************/
+ /* */
+ /* remove all operands to callothersubr from the stack */
+ /* */
+ /* for handled othersubrs, where we know the number of */
+ /* arguments, we increase the stack by the value of */
+ /* known_othersubr_result_cnt */
+ /* */
+ /* for unhandled othersubrs the following pops adjust */
+ /* the stack pointer as necessary */
+
+ count = cf2_stack_count( opStack );
+ FT_ASSERT( (CF2_UInt)arg_cnt <= count );
+
+ opIdx += count - (CF2_UInt)arg_cnt;
+
+ known_othersubr_result_cnt = 0;
+ result_cnt = 0;
+
+ /* XXX TODO: The checks to `arg_count == <whatever>' */
+ /* might not be correct; an othersubr expects a */
+ /* certain number of operands on the PostScript stack */
+ /* (as opposed to the T1 stack) but it doesn't have to */
+ /* put them there by itself; previous othersubrs might */
+ /* have left the operands there if they were not */
+ /* followed by an appropriate number of pops */
+ /* */
+ /* On the other hand, Adobe Reader 7.0.8 for Linux */
+ /* doesn't accept a font that contains charstrings */
+ /* like */
+ /* */
+ /* 100 200 2 20 callothersubr */
+ /* 300 1 20 callothersubr pop */
+ /* */
+ /* Perhaps this is the reason why BuildCharArray */
+ /* exists. */
+
+ switch ( subr_no )
+ {
+ case 0: /* end flex feature */
+ if ( arg_cnt != 3 )
+ goto Unexpected_OtherSubr;
+
+ if ( initial_map_ready &&
+ ( !decoder->flex_state ||
+ decoder->num_flex_vectors != 7 ) )
+ {
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " unexpected flex end\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* the two `results' are popped */
+ /* by the following setcurrentpoint */
+ cf2_stack_pushFixed( opStack, curX );
+ cf2_stack_pushFixed( opStack, curY );
+ known_othersubr_result_cnt = 2;
+ break;
+
+ case 1: /* start flex feature */
+ if ( arg_cnt != 0 )
+ goto Unexpected_OtherSubr;
+
+ if ( !initial_map_ready )
+ break;
+
+ if ( ps_builder_check_points( &decoder->builder, 6 ) )
+ goto exit;
+
+ decoder->flex_state = 1;
+ decoder->num_flex_vectors = 0;
+ break;
+
+ case 2: /* add flex vectors */
+ {
+ FT_Int idx;
+ FT_Int idx2;
+
+
+ if ( arg_cnt != 0 )
+ goto Unexpected_OtherSubr;
+
+ if ( !initial_map_ready )
+ break;
+
+ if ( !decoder->flex_state )
+ {
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " missing flex start\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* note that we should not add a point for */
+ /* index 0; this will move our current position */
+ /* to the flex point without adding any point */
+ /* to the outline */
+ idx = decoder->num_flex_vectors++;
+ if ( idx > 0 && idx < 7 )
+ {
+ /* in malformed fonts it is possible to have */
+ /* other opcodes in the middle of a flex (which */
+ /* don't increase `num_flex_vectors'); we thus */
+ /* have to check whether we can add a point */
+
+ if ( ps_builder_check_points( &decoder->builder,
+ 1 ) )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* map: 1->2 2->4 3->6 4->2 5->4 6->6 */
+ idx2 = ( idx > 3 ? idx - 3 : idx ) * 2;
+
+ flexStore[idx2 - 2] = curX;
+ flexStore[idx2 - 1] = curY;
+
+ if ( idx == 3 || idx == 6 )
+ cf2_glyphpath_curveTo( &glyphPath,
+ flexStore[0],
+ flexStore[1],
+ flexStore[2],
+ flexStore[3],
+ flexStore[4],
+ flexStore[5] );
+ }
+ }
+ break;
+
+ case 3: /* change hints */
+ if ( arg_cnt != 1 )
+ goto Unexpected_OtherSubr;
+
+ if ( initial_map_ready )
+ {
+ /* do not clear hints if initial hintmap */
+ /* is not ready - we need to collate all */
+ cf2_arrstack_clear( &vStemHintArray );
+ cf2_arrstack_clear( &hStemHintArray );
+
+ cf2_hintmask_init( &hintMask, error );
+ hintMask.isValid = FALSE;
+ hintMask.isNew = TRUE;
+ }
+
+ known_othersubr_result_cnt = 1;
+ break;
+
+ case 12:
+ case 13:
+ /* counter control hints, clear stack */
+ cf2_stack_clear( opStack );
+ break;
+
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18: /* multiple masters */
+ {
+ PS_Blend blend = decoder->blend;
+ FT_UInt num_points, nn, mm;
+ CF2_UInt delta;
+ CF2_UInt values;
+
+
+ if ( !blend )
+ {
+ FT_ERROR((
+ "cf2_interpT2CharString:"
+ " unexpected multiple masters operator\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ num_points = (FT_UInt)subr_no - 13 +
+ ( subr_no == 18 );
+ if ( arg_cnt != (FT_Int)( num_points *
+ blend->num_designs ) )
+ {
+ FT_ERROR((
+ "cf2_interpT2CharString:"
+ " incorrect number of multiple masters arguments\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ /* We want to compute */
+ /* */
+ /* a0*w0 + a1*w1 + ... + ak*wk */
+ /* */
+ /* but we only have a0, a1-a0, a2-a0, ..., ak-a0. */
+ /* */
+ /* However, given that w0 + w1 + ... + wk == 1, we */
+ /* can rewrite it easily as */
+ /* */
+ /* a0 + (a1-a0)*w1 + (a2-a0)*w2 + ... + (ak-a0)*wk */
+ /* */
+ /* where k == num_designs-1. */
+ /* */
+ /* I guess that's why it's written in this `compact' */
+ /* form. */
+ /* */
+ delta = opIdx + num_points;
+ values = opIdx;
+ for ( nn = 0; nn < num_points; nn++ )
+ {
+ CF2_Fixed tmp = cf2_stack_getReal( opStack,
+ values );
+
+
+ for ( mm = 1; mm < blend->num_designs; mm++ )
+ tmp = ADD_INT32( tmp,
+ FT_MulFix(
+ cf2_stack_getReal( opStack,
+ delta++ ),
+ blend->weight_vector[mm] ) );
+
+ cf2_stack_setReal( opStack, values++, tmp );
+ }
+ cf2_stack_pop( opStack,
+ (CF2_UInt)arg_cnt - num_points );
+
+ known_othersubr_result_cnt = (FT_Int)num_points;
+ break;
+ }
+
+ case 19:
+ /* <idx> 1 19 callothersubr */
+ /* ==> replace elements starting from index */
+ /* cvi( <idx> ) of BuildCharArray with */
+ /* WeightVector */
+ {
+ FT_Int idx;
+ PS_Blend blend = decoder->blend;
+
+
+ if ( arg_cnt != 1 || !blend )
+ goto Unexpected_OtherSubr;
+
+ idx = cf2_stack_popInt( opStack );
+
+ if ( idx < 0 ||
+ (FT_UInt)idx + blend->num_designs >
+ decoder->len_buildchar )
+ goto Unexpected_OtherSubr;
+
+ ft_memcpy( &decoder->buildchar[idx],
+ blend->weight_vector,
+ blend->num_designs *
+ sizeof ( blend->weight_vector[0] ) );
+ }
+ break;
+
+ case 20:
+ /* <arg1> <arg2> 2 20 callothersubr pop */
+ /* ==> push <arg1> + <arg2> onto T1 stack */
+ {
+ CF2_F16Dot16 summand1;
+ CF2_F16Dot16 summand2;
+
+
+ if ( arg_cnt != 2 )
+ goto Unexpected_OtherSubr;
+
+ summand2 = cf2_stack_popFixed( opStack );
+ summand1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ ADD_INT32( summand1,
+ summand2 ) );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ case 21:
+ /* <arg1> <arg2> 2 21 callothersubr pop */
+ /* ==> push <arg1> - <arg2> onto T1 stack */
+ {
+ CF2_F16Dot16 minuend;
+ CF2_F16Dot16 subtrahend;
+
+
+ if ( arg_cnt != 2 )
+ goto Unexpected_OtherSubr;
+
+ subtrahend = cf2_stack_popFixed( opStack );
+ minuend = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ SUB_INT32( minuend,
+ subtrahend ) );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ case 22:
+ /* <arg1> <arg2> 2 22 callothersubr pop */
+ /* ==> push <arg1> * <arg2> onto T1 stack */
+ {
+ CF2_F16Dot16 factor1;
+ CF2_F16Dot16 factor2;
+
+
+ if ( arg_cnt != 2 )
+ goto Unexpected_OtherSubr;
+
+ factor2 = cf2_stack_popFixed( opStack );
+ factor1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ FT_MulFix( factor1, factor2 ) );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ case 23:
+ /* <arg1> <arg2> 2 23 callothersubr pop */
+ /* ==> push <arg1> / <arg2> onto T1 stack */
+ {
+ CF2_F16Dot16 dividend;
+ CF2_F16Dot16 divisor;
+
+
+ if ( arg_cnt != 2 )
+ goto Unexpected_OtherSubr;
+
+ divisor = cf2_stack_popFixed( opStack );
+ dividend = cf2_stack_popFixed( opStack );
+
+ if ( divisor == 0 )
+ goto Unexpected_OtherSubr;
+
+ cf2_stack_pushFixed( opStack,
+ FT_DivFix( dividend,
+ divisor ) );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ case 24:
+ /* <val> <idx> 2 24 callothersubr */
+ /* ==> set BuildCharArray[cvi( <idx> )] = <val> */
+ {
+ CF2_Int idx;
+ PS_Blend blend = decoder->blend;
+
+
+ if ( arg_cnt != 2 || !blend )
+ goto Unexpected_OtherSubr;
+
+ idx = cf2_stack_popInt( opStack );
+
+ if ( idx < 0 ||
+ (FT_UInt)idx >= decoder->len_buildchar )
+ goto Unexpected_OtherSubr;
+
+ decoder->buildchar[idx] =
+ cf2_stack_popFixed( opStack );
+ }
+ break;
+
+ case 25:
+ /* <idx> 1 25 callothersubr pop */
+ /* ==> push BuildCharArray[cvi( idx )] */
+ /* onto T1 stack */
+ {
+ CF2_Int idx;
+ PS_Blend blend = decoder->blend;
+
+
+ if ( arg_cnt != 1 || !blend )
+ goto Unexpected_OtherSubr;
+
+ idx = cf2_stack_popInt( opStack );
+
+ if ( idx < 0 ||
+ (FT_UInt)idx >= decoder->len_buildchar )
+ goto Unexpected_OtherSubr;
+
+ cf2_stack_pushFixed( opStack,
+ decoder->buildchar[idx] );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+#if 0
+ case 26:
+ /* <val> mark <idx> */
+ /* ==> set BuildCharArray[cvi( <idx> )] = <val>, */
+ /* leave mark on T1 stack */
+ /* <val> <idx> */
+ /* ==> set BuildCharArray[cvi( <idx> )] = <val> */
+ XXX which routine has left its mark on the
+ XXX (PostScript) stack?;
+ break;
+#endif
+
+ case 27:
+ /* <res1> <res2> <val1> <val2> 4 27 callothersubr pop */
+ /* ==> push <res1> onto T1 stack if <val1> <= <val2>, */
+ /* otherwise push <res2> */
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+ CF2_F16Dot16 cond1;
+ CF2_F16Dot16 cond2;
+
+
+ if ( arg_cnt != 4 )
+ goto Unexpected_OtherSubr;
+
+ cond2 = cf2_stack_popFixed( opStack );
+ cond1 = cf2_stack_popFixed( opStack );
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ cond1 <= cond2 ? arg1 : arg2 );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ case 28:
+ /* 0 28 callothersubr pop */
+ /* ==> push random value from interval [0, 1) */
+ /* onto stack */
+ {
+ CF2_F16Dot16 r;
+
+
+ if ( arg_cnt != 0 )
+ goto Unexpected_OtherSubr;
+
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ r = (CF2_F16Dot16)
+ ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
+
+ decoder->current_subfont->random =
+ cff_random( decoder->current_subfont->random );
+
+ cf2_stack_pushFixed( opStack, r );
+ known_othersubr_result_cnt = 1;
+ }
+ break;
+
+ default:
+ if ( arg_cnt >= 0 && subr_no >= 0 )
+ {
+ FT_Int i;
+
+
+ FT_ERROR((
+ "cf2_interpT2CharString (Type 1 mode):"
+ " unknown othersubr [%d %d], wish me luck\n",
+ arg_cnt, subr_no ));
+
+ /* store the unused args */
+ /* for this unhandled OtherSubr */
+
+ if ( arg_cnt > PS_STORAGE_SIZE )
+ arg_cnt = PS_STORAGE_SIZE;
+ result_cnt = arg_cnt;
+
+ for ( i = 1; i <= arg_cnt; i++ )
+ results[result_cnt - i] =
+ cf2_stack_popFixed( opStack );
+
+ break;
+ }
+ /* fall through */
+
+ Unexpected_OtherSubr:
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " invalid othersubr [%d %d]\n",
+ arg_cnt, subr_no ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escPOP:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ FT_TRACE4(( " pop" ));
+
+ if ( known_othersubr_result_cnt > 0 )
+ {
+ known_othersubr_result_cnt--;
+ /* ignore, we pushed the operands ourselves */
+ continue;
+ }
+
+ if ( result_cnt == 0 )
+ {
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " no more operands for othersubr\n" ));
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit;
+ }
+
+ result_cnt--;
+ cf2_stack_pushFixed( opStack, results[result_cnt] );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escDROP:
+ FT_TRACE4(( " drop\n" ));
+
+ (void)cf2_stack_popFixed( opStack );
+ continue; /* do not clear the stack */
+
+ case cf2_escPUT:
+ {
+ CF2_F16Dot16 val;
+ CF2_Int idx;
+
+
+ FT_TRACE4(( " put\n" ));
+
+ idx = cf2_stack_popInt( opStack );
+ val = cf2_stack_popFixed( opStack );
+
+ if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
+ storage[idx] = val;
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escGET:
+ {
+ CF2_Int idx;
+
+
+ FT_TRACE4(( " get\n" ));
+
+ idx = cf2_stack_popInt( opStack );
+
+ if ( idx >= 0 && idx < CF2_STORAGE_SIZE )
+ cf2_stack_pushFixed( opStack, storage[idx] );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escIFELSE:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+ CF2_F16Dot16 cond1;
+ CF2_F16Dot16 cond2;
+
+
+ FT_TRACE4(( " ifelse\n" ));
+
+ cond2 = cf2_stack_popFixed( opStack );
+ cond1 = cf2_stack_popFixed( opStack );
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ cond1 <= cond2 ? arg1 : arg2 );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escRANDOM: /* in spec */
+ {
+ CF2_F16Dot16 r;
+
+
+ FT_TRACE4(( " random\n" ));
+
+ /* only use the lower 16 bits of `random' */
+ /* to generate a number in the range (0;1] */
+ r = (CF2_F16Dot16)
+ ( ( decoder->current_subfont->random & 0xFFFF ) + 1 );
+
+ decoder->current_subfont->random =
+ cff_random( decoder->current_subfont->random );
+
+ cf2_stack_pushFixed( opStack, r );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escMUL:
+ {
+ CF2_F16Dot16 factor1;
+ CF2_F16Dot16 factor2;
+
+
+ FT_TRACE4(( " mul\n" ));
+
+ factor2 = cf2_stack_popFixed( opStack );
+ factor1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack,
+ FT_MulFix( factor1, factor2 ) );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escSQRT:
+ {
+ CF2_F16Dot16 arg;
+
+
+ FT_TRACE4(( " sqrt\n" ));
+
+ arg = cf2_stack_popFixed( opStack );
+ if ( arg > 0 )
+ {
+ /* use a start value that doesn't make */
+ /* the algorithm's addition overflow */
+ FT_Fixed root = arg < 10 ? arg : arg >> 1;
+ FT_Fixed new_root;
+
+
+ /* Babylonian method */
+ for (;;)
+ {
+ new_root = ( root + FT_DivFix( arg, root ) + 1 ) >> 1;
+ if ( new_root == root )
+ break;
+ root = new_root;
+ }
+ arg = new_root;
+ }
+ else
+ arg = 0;
+
+ cf2_stack_pushFixed( opStack, arg );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escDUP:
+ {
+ CF2_F16Dot16 arg;
+
+
+ FT_TRACE4(( " dup\n" ));
+
+ arg = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack, arg );
+ cf2_stack_pushFixed( opStack, arg );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escEXCH:
+ {
+ CF2_F16Dot16 arg1;
+ CF2_F16Dot16 arg2;
+
+
+ FT_TRACE4(( " exch\n" ));
+
+ arg2 = cf2_stack_popFixed( opStack );
+ arg1 = cf2_stack_popFixed( opStack );
+
+ cf2_stack_pushFixed( opStack, arg2 );
+ cf2_stack_pushFixed( opStack, arg1 );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escINDEX:
+ {
+ CF2_Int idx;
+ CF2_UInt size;
+
+
+ FT_TRACE4(( " index\n" ));
+
+ idx = cf2_stack_popInt( opStack );
+ size = cf2_stack_count( opStack );
+
+ if ( size > 0 )
+ {
+ /* for `cf2_stack_getReal', */
+ /* index 0 is bottom of stack */
+ CF2_UInt gr_idx;
+
+
+ if ( idx < 0 )
+ gr_idx = size - 1;
+ else if ( (CF2_UInt)idx >= size )
+ gr_idx = 0;
+ else
+ gr_idx = size - 1 - (CF2_UInt)idx;
+
+ cf2_stack_pushFixed( opStack,
+ cf2_stack_getReal( opStack,
+ gr_idx ) );
+ }
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escROLL:
+ {
+ CF2_Int idx;
+ CF2_Int count;
+
+
+ FT_TRACE4(( " roll\n" ));
+
+ idx = cf2_stack_popInt( opStack );
+ count = cf2_stack_popInt( opStack );
+
+ cf2_stack_roll( opStack, count, idx );
+ }
+ continue; /* do not clear the stack */
+
+ case cf2_escSETCURRENTPT:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (12, %d)\n", op2 ));
+ else
+ {
+ FT_TRACE4(( " setcurrentpoint" ));
+
+ if ( !initial_map_ready )
+ break;
+
+ /* From the T1 specification, section 6.4: */
+ /* */
+ /* The setcurrentpoint command is used only in */
+ /* conjunction with results from OtherSubrs */
+ /* procedures. */
+
+ /* known_othersubr_result_cnt != 0 is already handled */
+ /* above. */
+
+ /* Note, however, that both Ghostscript and Adobe */
+ /* Distiller handle this situation by silently */
+ /* ignoring the inappropriate `setcurrentpoint' */
+ /* instruction. So we do the same. */
+#if 0
+
+ if ( decoder->flex_state != 1 )
+ {
+ FT_ERROR(( "cf2_interpT2CharString:"
+ " unexpected `setcurrentpoint'\n" ));
+ goto Syntax_Error;
+ }
+ else
+ ...
+#endif
+
+ curY = cf2_stack_popFixed( opStack );
+ curX = cf2_stack_popFixed( opStack );
+
+ decoder->flex_state = 0;
+ }
+ break;
+
+ } /* end of 2nd switch checking op2 */
+ }
+ }
+ } /* end of 1st switch checking op2 */
+ } /* case cf2_cmdESC */
+
+ break;
+
+ case cf2_cmdHSBW:
+ if ( !font->isT1 )
+ FT_TRACE4(( " unknown op (%d)\n", op1 ));
+ else
+ {
+ CF2_Fixed lsb_x;
+ PS_Builder* builder;
+
+
+ FT_TRACE4(( " hsbw" ));
+
+ builder = &decoder->builder;
+
+ builder->advance->x = cf2_stack_popFixed( opStack );
+ builder->advance->y = 0;
+
+ lsb_x = cf2_stack_popFixed( opStack );
+
+ builder->left_bearing->x = ADD_INT32( builder->left_bearing->x,
+ lsb_x );
+
+ haveWidth = TRUE;
+
+ /* the `metrics_only' indicates that we only want to compute */
+ /* the glyph's metrics (lsb + advance width), not load the */
+ /* rest of it; so exit immediately */
+ if ( builder->metrics_only )
+ goto exit;
+
+ if ( initial_map_ready )
+ curX = ADD_INT32( curX, lsb_x );
+ }
+ break;
+
+ case cf2_cmdENDCHAR:
+ FT_TRACE4(( " endchar\n" ));
+
+ if ( font->isT1 && !initial_map_ready )
+ {
+ FT_TRACE5(( "cf2_interpT2CharString (Type 1 mode): "
+ "Build initial hintmap, rewinding...\n" ));
+
+ /* trigger initial hintmap build */
+ cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+ initial_map_ready = TRUE;
+
+ /* change hints routine - clear for rewind */
+ cf2_arrstack_clear( &vStemHintArray );
+ cf2_arrstack_clear( &hStemHintArray );
+
+ cf2_hintmask_init( &hintMask, error );
+ hintMask.isValid = FALSE;
+ hintMask.isNew = TRUE;
+
+ /* rewind charstring */
+ /* some charstrings use endchar from a final subroutine call */
+ /* without returning, detect these and exit to the top level */
+ /* charstring */
+ while ( charstringIndex > 0 )
+ {
+ FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
+
+ /* restore position in previous charstring */
+ charstring = (CF2_Buffer)
+ cf2_arrstack_getPointer(
+ &subrStack,
+ (CF2_UInt)--charstringIndex );
+ }
+ charstring->ptr = charstring->start;
+
+ break;
+ }
+
+ if ( cf2_stack_count( opStack ) == 1 ||
+ cf2_stack_count( opStack ) == 5 )
+ {
+ if ( !haveWidth )
+ *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
+ nominalWidthX );
+ }
+
+ /* width is defined or default after this */
+ haveWidth = TRUE;
+
+ if ( decoder->width_only )
+ goto exit;
+
+ /* close path if still open */
+ cf2_glyphpath_closeOpenPath( &glyphPath );
+
+ /* disable seac for CFF2 and Type1 */
+ /* (charstring ending with args on stack) */
+ if ( !font->isCFF2 && !font->isT1 && cf2_stack_count( opStack ) > 1 )
+ {
+ /* must be either 4 or 5 -- */
+ /* this is a (deprecated) implied `seac' operator */
+
+ CF2_Int achar;
+ CF2_Int bchar;
+ CF2_BufferRec component;
+ CF2_Fixed dummyWidth; /* ignore component width */
+ FT_Error error2;
+
+
+ if ( doingSeac )
+ {
+ lastError = FT_THROW( Invalid_Glyph_Format );
+ goto exit; /* nested seac */
+ }
+
+ achar = cf2_stack_popInt( opStack );
+ bchar = cf2_stack_popInt( opStack );
+
+ curY = cf2_stack_popFixed( opStack );
+ curX = cf2_stack_popFixed( opStack );
+
+ error2 = cf2_getSeacComponent( decoder, achar, &component );
+ if ( error2 )
+ {
+ lastError = error2; /* pass FreeType error through */
+ goto exit;
+ }
+ cf2_interpT2CharString( font,
+ &component,
+ callbacks,
+ translation,
+ TRUE,
+ curX,
+ curY,
+ &dummyWidth );
+ cf2_freeSeacComponent( decoder, &component );
+
+ error2 = cf2_getSeacComponent( decoder, bchar, &component );
+ if ( error2 )
+ {
+ lastError = error2; /* pass FreeType error through */
+ goto exit;
+ }
+ cf2_interpT2CharString( font,
+ &component,
+ callbacks,
+ translation,
+ TRUE,
+ 0,
+ 0,
+ &dummyWidth );
+ cf2_freeSeacComponent( decoder, &component );
+ }
+ goto exit;
+
+ case cf2_cmdCNTRMASK:
+ case cf2_cmdHINTMASK:
+ /* the final \n in the tracing message gets added in */
+ /* `cf2_hintmask_read' (which also traces the mask bytes) */
+ FT_TRACE4(( op1 == cf2_cmdCNTRMASK ? " cntrmask" : " hintmask" ));
+
+ /* never add hints after the mask is computed */
+ if ( cf2_stack_count( opStack ) > 1 &&
+ cf2_hintmask_isValid( &hintMask ) )
+ {
+ FT_TRACE4(( "cf2_interpT2CharString: invalid hint mask\n" ));
+ break;
+ }
+
+ /* if there are arguments on the stack, there this is an */
+ /* implied cf2_cmdVSTEMHM */
+ cf2_doStems( font,
+ opStack,
+ &vStemHintArray,
+ width,
+ &haveWidth,
+ 0 );
+
+ if ( decoder->width_only )
+ goto exit;
+
+ if ( op1 == cf2_cmdHINTMASK )
+ {
+ /* consume the hint mask bytes which follow the operator */
+ cf2_hintmask_read( &hintMask,
+ charstring,
+ cf2_arrstack_size( &hStemHintArray ) +
+ cf2_arrstack_size( &vStemHintArray ) );
+ }
+ else
+ {
+ /*
+ * Consume the counter mask bytes which follow the operator:
+ * Build a temporary hint map, just to place and lock those
+ * stems participating in the counter mask. These are most
+ * likely the dominant hstems, and are grouped together in a
+ * few counter groups, not necessarily in correspondence
+ * with the hint groups. This reduces the chances of
+ * conflicts between hstems that are initially placed in
+ * separate hint groups and then brought together. The
+ * positions are copied back to `hStemHintArray', so we can
+ * discard `counterMask' and `counterHintMap'.
+ *
+ */
+ CF2_HintMapRec counterHintMap;
+ CF2_HintMaskRec counterMask;
+
+
+ cf2_hintmap_init( &counterHintMap,
+ font,
+ &glyphPath.initialHintMap,
+ &glyphPath.hintMoves,
+ scaleY );
+ cf2_hintmask_init( &counterMask, error );
+
+ cf2_hintmask_read( &counterMask,
+ charstring,
+ cf2_arrstack_size( &hStemHintArray ) +
+ cf2_arrstack_size( &vStemHintArray ) );
+ cf2_hintmap_build( &counterHintMap,
+ &hStemHintArray,
+ &vStemHintArray,
+ &counterMask,
+ 0,
+ FALSE );
+ }
+ break;
+
+ case cf2_cmdRMOVETO:
+ FT_TRACE4(( " rmoveto\n" ));
+
+ if ( font->isT1 && !decoder->flex_state && !haveWidth )
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " No width. Use hsbw/sbw as first op\n" ));
+
+ if ( cf2_stack_count( opStack ) > 2 && !haveWidth )
+ *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
+ nominalWidthX );
+
+ /* width is defined or default after this */
+ haveWidth = TRUE;
+
+ if ( decoder->width_only )
+ goto exit;
+
+ curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) );
+ curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) );
+
+ if ( !decoder->flex_state )
+ cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+ break;
+
+ case cf2_cmdHMOVETO:
+ FT_TRACE4(( " hmoveto\n" ));
+
+ if ( font->isT1 && !decoder->flex_state && !haveWidth )
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " No width. Use hsbw/sbw as first op\n" ));
+
+ if ( cf2_stack_count( opStack ) > 1 && !haveWidth )
+ *width = ADD_INT32( cf2_stack_getReal( opStack, 0 ),
+ nominalWidthX );
+
+ /* width is defined or default after this */
+ haveWidth = TRUE;
+
+ if ( decoder->width_only )
+ goto exit;
+
+ curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) );
+
+ if ( !decoder->flex_state )
+ cf2_glyphpath_moveTo( &glyphPath, curX, curY );
+
+ break;
+
+ case cf2_cmdRLINECURVE:
+ {
+ CF2_UInt count = cf2_stack_count( opStack );
+ CF2_UInt idx = 0;
+
+
+ FT_TRACE4(( " rlinecurve\n" ));
+
+ while ( idx + 6 < count )
+ {
+ curX = ADD_INT32( curX, cf2_stack_getReal( opStack,
+ idx + 0 ) );
+ curY = ADD_INT32( curY, cf2_stack_getReal( opStack,
+ idx + 1 ) );
+
+ cf2_glyphpath_lineTo( &glyphPath, curX, curY );
+ idx += 2;
+ }
+
+ while ( idx < count )
+ {
+ CF2_Fixed x1, y1, x2, y2, x3, y3;
+
+
+ x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
+ y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), curY );
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y1 );
+ x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
+ y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 5 ), y2 );
+
+ cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+ curX = x3;
+ curY = y3;
+ idx += 6;
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdVVCURVETO:
+ {
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
+ CF2_UInt idx = 0;
+
+
+ /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ idx += count1 - count;
+
+ FT_TRACE4(( " vvcurveto\n" ));
+
+ while ( idx < count )
+ {
+ CF2_Fixed x1, y1, x2, y2, x3, y3;
+
+
+ if ( ( count - idx ) & 1 )
+ {
+ x1 = ADD_INT32( cf2_stack_getReal( opStack, idx ), curX );
+
+ idx++;
+ }
+ else
+ x1 = curX;
+
+ y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curY );
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
+ x3 = x2;
+ y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y2 );
+
+ cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+ curX = x3;
+ curY = y3;
+ idx += 4;
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdHHCURVETO:
+ {
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
+ CF2_UInt idx = 0;
+
+
+ /* if `cf2_stack_count' isn't of the form 4n or 4n+1, */
+ /* we enforce it by clearing the second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ idx += count1 - count;
+
+ FT_TRACE4(( " hhcurveto\n" ));
+
+ while ( idx < count )
+ {
+ CF2_Fixed x1, y1, x2, y2, x3, y3;
+
+
+ if ( ( count - idx ) & 1 )
+ {
+ y1 = ADD_INT32( cf2_stack_getReal( opStack, idx ), curY );
+
+ idx++;
+ }
+ else
+ y1 = curY;
+
+ x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
+ x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), x2 );
+ y3 = y2;
+
+ cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+ curX = x3;
+ curY = y3;
+ idx += 4;
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdVHCURVETO:
+ case cf2_cmdHVCURVETO:
+ {
+ CF2_UInt count, count1 = cf2_stack_count( opStack );
+ CF2_UInt idx = 0;
+
+ FT_Bool alternate = FT_BOOL( op1 == cf2_cmdHVCURVETO );
+
+
+ /* if `cf2_stack_count' isn't of the form 8n, 8n+1, */
+ /* 8n+4, or 8n+5, we enforce it by clearing the */
+ /* second bit */
+ /* (and sorting the stack indexing to suit) */
+ count = count1 & ~2U;
+ idx += count1 - count;
+
+ FT_TRACE4(( alternate ? " hvcurveto\n" : " vhcurveto\n" ));
+
+ while ( idx < count )
+ {
+ CF2_Fixed x1, x2, x3, y1, y2, y3;
+
+
+ if ( alternate )
+ {
+ x1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curX );
+ y1 = curY;
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
+ y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), y2 );
+
+ if ( count - idx == 5 )
+ {
+ x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), x2 );
+
+ idx++;
+ }
+ else
+ x3 = x2;
+
+ alternate = FALSE;
+ }
+ else
+ {
+ x1 = curX;
+ y1 = ADD_INT32( cf2_stack_getReal( opStack, idx + 0 ), curY );
+ x2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 1 ), x1 );
+ y2 = ADD_INT32( cf2_stack_getReal( opStack, idx + 2 ), y1 );
+ x3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 3 ), x2 );
+
+ if ( count - idx == 5 )
+ {
+ y3 = ADD_INT32( cf2_stack_getReal( opStack, idx + 4 ), y2 );
+
+ idx++;
+ }
+ else
+ y3 = y2;
+
+ alternate = TRUE;
+ }
+
+ cf2_glyphpath_curveTo( &glyphPath, x1, y1, x2, y2, x3, y3 );
+
+ curX = x3;
+ curY = y3;
+ idx += 4;
+ }
+
+ cf2_stack_clear( opStack );
+ }
+ continue; /* no need to clear stack again */
+
+ case cf2_cmdEXTENDEDNMBR:
+ {
+ CF2_Int v;
+
+ CF2_Int byte1 = cf2_buf_readByte( charstring );
+ CF2_Int byte2 = cf2_buf_readByte( charstring );
+
+
+ v = (FT_Short)( ( byte1 << 8 ) |
+ byte2 );
+
+ FT_TRACE4(( " %d", v ));
+
+ cf2_stack_pushInt( opStack, v );
+ }
+ continue;
+
+ default:
+ /* numbers */
+ {
+ if ( /* op1 >= 32 && */ op1 <= 246 )
+ {
+ CF2_Int v;
+
+
+ v = op1 - 139;
+
+ FT_TRACE4(( " %d", v ));
+
+ /* -107 .. 107 */
+ cf2_stack_pushInt( opStack, v );
+ }
+
+ else if ( /* op1 >= 247 && */ op1 <= 250 )
+ {
+ CF2_Int v;
+
+
+ v = op1;
+ v -= 247;
+ v *= 256;
+ v += cf2_buf_readByte( charstring );
+ v += 108;
+
+ FT_TRACE4(( " %d", v ));
+
+ /* 108 .. 1131 */
+ cf2_stack_pushInt( opStack, v );
+ }
+
+ else if ( /* op1 >= 251 && */ op1 <= 254 )
+ {
+ CF2_Int v;
+
+
+ v = op1;
+ v -= 251;
+ v *= 256;
+ v += cf2_buf_readByte( charstring );
+ v = -v - 108;
+
+ FT_TRACE4(( " %d", v ));
+
+ /* -1131 .. -108 */
+ cf2_stack_pushInt( opStack, v );
+ }
+
+ else /* op1 == 255 */
+ {
+ CF2_Fixed v;
+
+ FT_UInt32 byte1 = (FT_UInt32)cf2_buf_readByte( charstring );
+ FT_UInt32 byte2 = (FT_UInt32)cf2_buf_readByte( charstring );
+ FT_UInt32 byte3 = (FT_UInt32)cf2_buf_readByte( charstring );
+ FT_UInt32 byte4 = (FT_UInt32)cf2_buf_readByte( charstring );
+
+
+ v = (CF2_Fixed)( ( byte1 << 24 ) |
+ ( byte2 << 16 ) |
+ ( byte3 << 8 ) |
+ byte4 );
+
+ /*
+ * For Type 1:
+ *
+ * According to the specification, values > 32000 or < -32000
+ * must be followed by a `div' operator to make the result be
+ * in the range [-32000;32000]. We expect that the second
+ * argument of `div' is not a large number. Additionally, we
+ * don't handle stuff like `<large1> <large2> <num> div <num>
+ * div' or <large1> <large2> <num> div div'. This is probably
+ * not allowed anyway.
+ *
+ * <large> <num> <num>+ div is not checked but should not be
+ * allowed as the large value remains untouched.
+ *
+ */
+ if ( font->isT1 )
+ {
+ if ( v > 32000 || v < -32000 )
+ {
+ if ( large_int )
+ FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):"
+ " no `div' after large integer\n" ));
+ else
+ large_int = TRUE;
+ }
+
+ FT_TRACE4(( " %d", v ));
+
+ cf2_stack_pushInt( opStack, (CF2_Int)v );
+ }
+ else
+ {
+ FT_TRACE4(( " %.5fF", v / 65536.0 ));
+
+ cf2_stack_pushFixed( opStack, v );
+ }
+ }
+ }
+ continue; /* don't clear stack */
+
+ } /* end of switch statement checking `op1' */
+
+ cf2_stack_clear( opStack );
+
+ } /* end of main interpreter loop */
+
+ /* we get here if the charstring ends without cf2_cmdENDCHAR */
+ FT_TRACE4(( "cf2_interpT2CharString:"
+ " charstring ends without ENDCHAR\n" ));
+
+ exit:
+ /* check whether last error seen is also the first one */
+ cf2_setError( error, lastError );
+
+ if ( *error )
+ FT_TRACE4(( "charstring error %d\n", *error ));
+
+ /* free resources from objects we've used */
+ cf2_glyphpath_finalize( &glyphPath );
+ cf2_arrstack_finalize( &vStemHintArray );
+ cf2_arrstack_finalize( &hStemHintArray );
+ cf2_arrstack_finalize( &subrStack );
+ cf2_stack_free( opStack );
+
+ FT_TRACE4(( "\n" ));
+
+ return;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psintrp.h b/thirdparty/freetype/src/psaux/psintrp.h
new file mode 100644
index 0000000000..4790aaa302
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psintrp.h
@@ -0,0 +1,83 @@
+/***************************************************************************/
+/* */
+/* psintrp.h */
+/* */
+/* Adobe's CFF Interpreter (specification). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSINTRP_H_
+#define PSINTRP_H_
+
+
+#include "psft.h"
+#include "pshints.h"
+
+
+FT_BEGIN_HEADER
+
+
+ FT_LOCAL( void )
+ cf2_hintmask_init( CF2_HintMask hintmask,
+ FT_Error* error );
+ FT_LOCAL( FT_Bool )
+ cf2_hintmask_isValid( const CF2_HintMask hintmask );
+ FT_LOCAL( FT_Bool )
+ cf2_hintmask_isNew( const CF2_HintMask hintmask );
+ FT_LOCAL( void )
+ cf2_hintmask_setNew( CF2_HintMask hintmask,
+ FT_Bool val );
+ FT_LOCAL( FT_Byte* )
+ cf2_hintmask_getMaskPtr( CF2_HintMask hintmask );
+ FT_LOCAL( void )
+ cf2_hintmask_setAll( CF2_HintMask hintmask,
+ size_t bitCount );
+
+ FT_LOCAL( void )
+ cf2_interpT2CharString( CF2_Font font,
+ CF2_Buffer charstring,
+ CF2_OutlineCallbacks callbacks,
+ const FT_Vector* translation,
+ FT_Bool doingSeac,
+ CF2_Fixed curX,
+ CF2_Fixed curY,
+ CF2_Fixed* width );
+
+
+FT_END_HEADER
+
+
+#endif /* PSINTRP_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psobjs.c b/thirdparty/freetype/src/psaux/psobjs.c
index f04edea411..f54bc7e416 100644
--- a/thirdparty/freetype/src/psaux/psobjs.c
+++ b/thirdparty/freetype/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -20,11 +20,13 @@
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_CALC_H
+#include FT_DRIVER_H
#include "psobjs.h"
#include "psconv.h"
#include "psauxerr.h"
+#include "psauxmod.h"
/*************************************************************************/
@@ -1761,11 +1763,748 @@
/*************************************************************************/
/*************************************************************************/
/***** *****/
+ /***** CFF BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* cff_builder_init */
+ /* */
+ /* <Description> */
+ /* Initializes a given glyph builder. */
+ /* */
+ /* <InOut> */
+ /* builder :: A pointer to the glyph builder to initialize. */
+ /* */
+ /* <Input> */
+ /* face :: The current face object. */
+ /* */
+ /* size :: The current size object. */
+ /* */
+ /* glyph :: The current glyph object. */
+ /* */
+ /* hinting :: Whether hinting is active. */
+ /* */
+ FT_LOCAL_DEF( void )
+ cff_builder_init( CFF_Builder* builder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot glyph,
+ FT_Bool hinting )
+ {
+ builder->path_begun = 0;
+ builder->load_points = 1;
+
+ builder->face = face;
+ builder->glyph = glyph;
+ builder->memory = face->root.memory;
+
+ if ( glyph )
+ {
+ FT_GlyphLoader loader = glyph->root.internal->loader;
+
+
+ builder->loader = loader;
+ builder->base = &loader->base.outline;
+ builder->current = &loader->current.outline;
+ FT_GlyphLoader_Rewind( loader );
+
+ builder->hints_globals = NULL;
+ builder->hints_funcs = NULL;
+
+ if ( hinting && size )
+ {
+ FT_Size ftsize = FT_SIZE( size );
+ CFF_Internal internal = (CFF_Internal)ftsize->internal->module_data;
+
+ if ( internal )
+ {
+ builder->hints_globals = (void *)internal->topfont;
+ builder->hints_funcs = glyph->root.internal->glyph_hints;
+ }
+ }
+ }
+
+ builder->pos_x = 0;
+ builder->pos_y = 0;
+
+ builder->left_bearing.x = 0;
+ builder->left_bearing.y = 0;
+ builder->advance.x = 0;
+ builder->advance.y = 0;
+
+ builder->funcs = cff_builder_funcs;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* cff_builder_done */
+ /* */
+ /* <Description> */
+ /* Finalizes a given glyph builder. Its contents can still be used */
+ /* after the call, but the function saves important information */
+ /* within the corresponding glyph slot. */
+ /* */
+ /* <Input> */
+ /* builder :: A pointer to the glyph builder to finalize. */
+ /* */
+ FT_LOCAL_DEF( void )
+ cff_builder_done( CFF_Builder* builder )
+ {
+ CFF_GlyphSlot glyph = builder->glyph;
+
+
+ if ( glyph )
+ glyph->root.outline = *builder->base;
+ }
+
+
+ /* check that there is enough space for `count' more points */
+ FT_LOCAL_DEF( FT_Error )
+ cff_check_points( CFF_Builder* builder,
+ FT_Int count )
+ {
+ return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );
+ }
+
+
+ /* add a new point, do not check space */
+ FT_LOCAL_DEF( void )
+ cff_builder_add_point( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag )
+ {
+ FT_Outline* outline = builder->current;
+
+
+ if ( builder->load_points )
+ {
+ FT_Vector* point = outline->points + outline->n_points;
+ FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points;
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face );
+
+
+ if ( driver->hinting_engine == FT_HINTING_FREETYPE )
+ {
+ point->x = x >> 16;
+ point->y = y >> 16;
+ }
+ else
+#endif
+ {
+ /* cf2_decoder_parse_charstrings uses 16.16 coordinates */
+ point->x = x >> 10;
+ point->y = y >> 10;
+ }
+ *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );
+ }
+
+ outline->n_points++;
+ }
+
+
+ /* check space for a new on-curve point, then add it */
+ FT_LOCAL_DEF( FT_Error )
+ cff_builder_add_point1( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y )
+ {
+ FT_Error error;
+
+
+ error = cff_check_points( builder, 1 );
+ if ( !error )
+ cff_builder_add_point( builder, x, y, 1 );
+
+ return error;
+ }
+
+
+ /* check space for a new contour, then add it */
+ FT_LOCAL_DEF( FT_Error )
+ cff_builder_add_contour( CFF_Builder* builder )
+ {
+ FT_Outline* outline = builder->current;
+ FT_Error error;
+
+
+ if ( !builder->load_points )
+ {
+ outline->n_contours++;
+ return FT_Err_Ok;
+ }
+
+ error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
+ if ( !error )
+ {
+ if ( outline->n_contours > 0 )
+ outline->contours[outline->n_contours - 1] =
+ (short)( outline->n_points - 1 );
+
+ outline->n_contours++;
+ }
+
+ return error;
+ }
+
+
+ /* if a path was begun, add its first on-curve point */
+ FT_LOCAL_DEF( FT_Error )
+ cff_builder_start_point( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ /* test whether we are building a new contour */
+ if ( !builder->path_begun )
+ {
+ builder->path_begun = 1;
+ error = cff_builder_add_contour( builder );
+ if ( !error )
+ error = cff_builder_add_point1( builder, x, y );
+ }
+
+ return error;
+ }
+
+
+ /* close the current contour */
+ FT_LOCAL_DEF( void )
+ cff_builder_close_contour( CFF_Builder* builder )
+ {
+ FT_Outline* outline = builder->current;
+ FT_Int first;
+
+
+ if ( !outline )
+ return;
+
+ first = outline->n_contours <= 1
+ ? 0 : outline->contours[outline->n_contours - 2] + 1;
+
+ /* We must not include the last point in the path if it */
+ /* is located on the first point. */
+ if ( outline->n_points > 1 )
+ {
+ FT_Vector* p1 = outline->points + first;
+ FT_Vector* p2 = outline->points + outline->n_points - 1;
+ FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1;
+
+
+ /* `delete' last point only if it coincides with the first */
+ /* point and if it is not a control point (which can happen). */
+ if ( p1->x == p2->x && p1->y == p2->y )
+ if ( *control == FT_CURVE_TAG_ON )
+ outline->n_points--;
+ }
+
+ if ( outline->n_contours > 0 )
+ {
+ /* Don't add contours only consisting of one point, i.e., */
+ /* check whether begin point and last point are the same. */
+ if ( first == outline->n_points - 1 )
+ {
+ outline->n_contours--;
+ outline->n_points--;
+ }
+ else
+ outline->contours[outline->n_contours - 1] =
+ (short)( outline->n_points - 1 );
+ }
+ }
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PS BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ps_builder_init */
+ /* */
+ /* <Description> */
+ /* Initializes a given glyph builder. */
+ /* */
+ /* <InOut> */
+ /* builder :: A pointer to the glyph builder to initialize. */
+ /* */
+ /* <Input> */
+ /* face :: The current face object. */
+ /* */
+ /* size :: The current size object. */
+ /* */
+ /* glyph :: The current glyph object. */
+ /* */
+ /* hinting :: Whether hinting should be applied. */
+ /* */
+ FT_LOCAL_DEF( void )
+ ps_builder_init( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 )
+ {
+ FT_ZERO( ps_builder );
+
+ if ( is_t1 )
+ {
+ T1_Builder t1builder = (T1_Builder)builder;
+
+
+ ps_builder->memory = t1builder->memory;
+ ps_builder->face = (FT_Face)t1builder->face;
+ ps_builder->glyph = (CFF_GlyphSlot)t1builder->glyph;
+ ps_builder->loader = t1builder->loader;
+ ps_builder->base = t1builder->base;
+ ps_builder->current = t1builder->current;
+
+ ps_builder->pos_x = &t1builder->pos_x;
+ ps_builder->pos_y = &t1builder->pos_y;
+
+ ps_builder->left_bearing = &t1builder->left_bearing;
+ ps_builder->advance = &t1builder->advance;
+
+ ps_builder->bbox = &t1builder->bbox;
+ ps_builder->path_begun = 0;
+ ps_builder->load_points = t1builder->load_points;
+ ps_builder->no_recurse = t1builder->no_recurse;
+
+ ps_builder->metrics_only = t1builder->metrics_only;
+ }
+ else
+ {
+ CFF_Builder* cffbuilder = (CFF_Builder*)builder;
+
+
+ ps_builder->memory = cffbuilder->memory;
+ ps_builder->face = (FT_Face)cffbuilder->face;
+ ps_builder->glyph = cffbuilder->glyph;
+ ps_builder->loader = cffbuilder->loader;
+ ps_builder->base = cffbuilder->base;
+ ps_builder->current = cffbuilder->current;
+
+ ps_builder->pos_x = &cffbuilder->pos_x;
+ ps_builder->pos_y = &cffbuilder->pos_y;
+
+ ps_builder->left_bearing = &cffbuilder->left_bearing;
+ ps_builder->advance = &cffbuilder->advance;
+
+ ps_builder->bbox = &cffbuilder->bbox;
+ ps_builder->path_begun = cffbuilder->path_begun;
+ ps_builder->load_points = cffbuilder->load_points;
+ ps_builder->no_recurse = cffbuilder->no_recurse;
+
+ ps_builder->metrics_only = cffbuilder->metrics_only;
+ }
+
+ ps_builder->is_t1 = is_t1;
+ ps_builder->funcs = ps_builder_funcs;
+ }
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ps_builder_done */
+ /* */
+ /* <Description> */
+ /* Finalizes a given glyph builder. Its contents can still be used */
+ /* after the call, but the function saves important information */
+ /* within the corresponding glyph slot. */
+ /* */
+ /* <Input> */
+ /* builder :: A pointer to the glyph builder to finalize. */
+ /* */
+ FT_LOCAL_DEF( void )
+ ps_builder_done( PS_Builder* builder )
+ {
+ CFF_GlyphSlot glyph = builder->glyph;
+
+
+ if ( glyph )
+ glyph->root.outline = *builder->base;
+ }
+
+
+ /* check that there is enough space for `count' more points */
+ FT_LOCAL_DEF( FT_Error )
+ ps_builder_check_points( PS_Builder* builder,
+ FT_Int count )
+ {
+ return FT_GLYPHLOADER_CHECK_POINTS( builder->loader, count, 0 );
+ }
+
+
+ /* add a new point, do not check space */
+ FT_LOCAL_DEF( void )
+ ps_builder_add_point( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag )
+ {
+ FT_Outline* outline = builder->current;
+
+
+ if ( builder->load_points )
+ {
+ FT_Vector* point = outline->points + outline->n_points;
+ FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points;
+
+#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face );
+
+
+ if ( !builder->is_t1 &&
+ driver->hinting_engine == FT_HINTING_FREETYPE )
+ {
+ point->x = x >> 16;
+ point->y = y >> 16;
+ }
+ else
+#endif
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( builder->face );
+#endif
+ if ( builder->is_t1 &&
+ driver->hinting_engine == FT_HINTING_FREETYPE )
+ {
+ point->x = FIXED_TO_INT( x );
+ point->y = FIXED_TO_INT( y );
+ }
+ else
+#endif
+ {
+ /* cf2_decoder_parse_charstrings uses 16.16 coordinates */
+ point->x = x >> 10;
+ point->y = y >> 10;
+ }
+ *control = (FT_Byte)( flag ? FT_CURVE_TAG_ON : FT_CURVE_TAG_CUBIC );
+ }
+ outline->n_points++;
+ }
+
+
+ /* check space for a new on-curve point, then add it */
+ FT_LOCAL_DEF( FT_Error )
+ ps_builder_add_point1( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y )
+ {
+ FT_Error error;
+
+
+ error = ps_builder_check_points( builder, 1 );
+ if ( !error )
+ ps_builder_add_point( builder, x, y, 1 );
+
+ return error;
+ }
+
+
+ /* check space for a new contour, then add it */
+ FT_LOCAL_DEF( FT_Error )
+ ps_builder_add_contour( PS_Builder* builder )
+ {
+ FT_Outline* outline = builder->current;
+ FT_Error error;
+
+
+ /* this might happen in invalid fonts */
+ if ( !outline )
+ {
+ FT_ERROR(( "ps_builder_add_contour: no outline to add points to\n" ));
+ return FT_THROW( Invalid_File_Format );
+ }
+
+ if ( !builder->load_points )
+ {
+ outline->n_contours++;
+ return FT_Err_Ok;
+ }
+
+ error = FT_GLYPHLOADER_CHECK_POINTS( builder->loader, 0, 1 );
+ if ( !error )
+ {
+ if ( outline->n_contours > 0 )
+ outline->contours[outline->n_contours - 1] =
+ (short)( outline->n_points - 1 );
+
+ outline->n_contours++;
+ }
+
+ return error;
+ }
+
+
+ /* if a path was begun, add its first on-curve point */
+ FT_LOCAL_DEF( FT_Error )
+ ps_builder_start_point( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ /* test whether we are building a new contour */
+ if ( !builder->path_begun )
+ {
+ builder->path_begun = 1;
+ error = ps_builder_add_contour( builder );
+ if ( !error )
+ error = ps_builder_add_point1( builder, x, y );
+ }
+
+ return error;
+ }
+
+
+ /* close the current contour */
+ FT_LOCAL_DEF( void )
+ ps_builder_close_contour( PS_Builder* builder )
+ {
+ FT_Outline* outline = builder->current;
+ FT_Int first;
+
+
+ if ( !outline )
+ return;
+
+ first = outline->n_contours <= 1
+ ? 0 : outline->contours[outline->n_contours - 2] + 1;
+
+ /* in malformed fonts it can happen that a contour was started */
+ /* but no points were added */
+ if ( outline->n_contours && first == outline->n_points )
+ {
+ outline->n_contours--;
+ return;
+ }
+
+ /* We must not include the last point in the path if it */
+ /* is located on the first point. */
+ if ( outline->n_points > 1 )
+ {
+ FT_Vector* p1 = outline->points + first;
+ FT_Vector* p2 = outline->points + outline->n_points - 1;
+ FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1;
+
+
+ /* `delete' last point only if it coincides with the first */
+ /* point and it is not a control point (which can happen). */
+ if ( p1->x == p2->x && p1->y == p2->y )
+ if ( *control == FT_CURVE_TAG_ON )
+ outline->n_points--;
+ }
+
+ if ( outline->n_contours > 0 )
+ {
+ /* Don't add contours only consisting of one point, i.e., */
+ /* check whether the first and the last point is the same. */
+ if ( first == outline->n_points - 1 )
+ {
+ outline->n_contours--;
+ outline->n_points--;
+ }
+ else
+ outline->contours[outline->n_contours - 1] =
+ (short)( outline->n_points - 1 );
+ }
+ }
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
/***** OTHER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* ps_decoder_init */
+ /* */
+ /* <Description> */
+ /* Creates a wrapper decoder for use in the combined */
+ /* Type 1 / CFF interpreter. */
+ /* */
+ /* <InOut> */
+ /* ps_decoder :: A pointer to the decoder to initialize. */
+ /* */
+ /* <Input> */
+ /* decoder :: A pointer to the original decoder. */
+ /* */
+ /* is_t1 :: Flag indicating Type 1 or CFF */
+ /* */
+ FT_LOCAL_DEF( void )
+ ps_decoder_init( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 )
+ {
+ FT_ZERO( ps_decoder );
+
+ if ( is_t1 )
+ {
+ T1_Decoder t1_decoder = (T1_Decoder)decoder;
+
+
+ ps_builder_init( &ps_decoder->builder,
+ &t1_decoder->builder,
+ is_t1 );
+
+ ps_decoder->cf2_instance = &t1_decoder->cf2_instance;
+ ps_decoder->psnames = t1_decoder->psnames;
+
+ ps_decoder->num_glyphs = t1_decoder->num_glyphs;
+ ps_decoder->glyph_names = t1_decoder->glyph_names;
+ ps_decoder->hint_mode = t1_decoder->hint_mode;
+ ps_decoder->blend = t1_decoder->blend;
+
+ ps_decoder->num_locals = (FT_UInt)t1_decoder->num_subrs;
+ ps_decoder->locals = t1_decoder->subrs;
+ ps_decoder->locals_len = t1_decoder->subrs_len;
+ ps_decoder->locals_hash = t1_decoder->subrs_hash;
+
+ ps_decoder->buildchar = t1_decoder->buildchar;
+ ps_decoder->len_buildchar = t1_decoder->len_buildchar;
+
+ ps_decoder->lenIV = t1_decoder->lenIV;
+ }
+ else
+ {
+ CFF_Decoder* cff_decoder = (CFF_Decoder*)decoder;
+
+
+ ps_builder_init( &ps_decoder->builder,
+ &cff_decoder->builder,
+ is_t1 );
+
+ ps_decoder->cff = cff_decoder->cff;
+ ps_decoder->cf2_instance = &cff_decoder->cff->cf2_instance;
+ ps_decoder->current_subfont = cff_decoder->current_subfont;
+
+ ps_decoder->num_globals = cff_decoder->num_globals;
+ ps_decoder->globals = cff_decoder->globals;
+ ps_decoder->globals_bias = cff_decoder->globals_bias;
+ ps_decoder->num_locals = cff_decoder->num_locals;
+ ps_decoder->locals = cff_decoder->locals;
+ ps_decoder->locals_bias = cff_decoder->locals_bias;
+
+ ps_decoder->glyph_width = &cff_decoder->glyph_width;
+ ps_decoder->width_only = cff_decoder->width_only;
+
+ ps_decoder->hint_mode = cff_decoder->hint_mode;
+
+ ps_decoder->get_glyph_callback = cff_decoder->get_glyph_callback;
+ ps_decoder->free_glyph_callback = cff_decoder->free_glyph_callback;
+ }
+ }
+
+
+ /* Synthesize a SubFont object for Type 1 fonts, for use in the */
+ /* new interpreter to access Private dict data. */
+ FT_LOCAL_DEF( void )
+ t1_make_subfont( FT_Face face,
+ PS_Private priv,
+ CFF_SubFont subfont )
+ {
+ CFF_Private cpriv = &subfont->private_dict;
+ FT_UInt n, count;
+
+
+ FT_ZERO( subfont );
+ FT_ZERO( cpriv );
+
+ count = cpriv->num_blue_values = priv->num_blue_values;
+ for ( n = 0; n < count; n++ )
+ cpriv->blue_values[n] = (FT_Pos)priv->blue_values[n];
+
+ count = cpriv->num_other_blues = priv->num_other_blues;
+ for ( n = 0; n < count; n++ )
+ cpriv->other_blues[n] = (FT_Pos)priv->other_blues[n];
+
+ count = cpriv->num_family_blues = priv->num_family_blues;
+ for ( n = 0; n < count; n++ )
+ cpriv->family_blues[n] = (FT_Pos)priv->family_blues[n];
+
+ count = cpriv->num_family_other_blues = priv->num_family_other_blues;
+ for ( n = 0; n < count; n++ )
+ cpriv->family_other_blues[n] = (FT_Pos)priv->family_other_blues[n];
+
+ cpriv->blue_scale = priv->blue_scale;
+ cpriv->blue_shift = (FT_Pos)priv->blue_shift;
+ cpriv->blue_fuzz = (FT_Pos)priv->blue_fuzz;
+
+ cpriv->standard_width = (FT_Pos)priv->standard_width[0];
+ cpriv->standard_height = (FT_Pos)priv->standard_height[0];
+
+ count = cpriv->num_snap_widths = priv->num_snap_widths;
+ for ( n = 0; n < count; n++ )
+ cpriv->snap_widths[n] = (FT_Pos)priv->snap_widths[n];
+
+ count = cpriv->num_snap_heights = priv->num_snap_heights;
+ for ( n = 0; n < count; n++ )
+ cpriv->snap_heights[n] = (FT_Pos)priv->snap_heights[n];
+
+ cpriv->force_bold = priv->force_bold;
+ cpriv->lenIV = priv->lenIV;
+ cpriv->language_group = priv->language_group;
+ cpriv->expansion_factor = priv->expansion_factor;
+
+ cpriv->subfont = subfont;
+
+
+ /* Initialize the random number generator. */
+ if ( face->internal->random_seed != -1 )
+ {
+ /* If we have a face-specific seed, use it. */
+ /* If non-zero, update it to a positive value. */
+ subfont->random = (FT_UInt32)face->internal->random_seed;
+ if ( face->internal->random_seed )
+ {
+ do
+ {
+ face->internal->random_seed = (FT_Int32)cff_random(
+ (FT_UInt32)face->internal->random_seed );
+
+ } while ( face->internal->random_seed < 0 );
+ }
+ }
+ if ( !subfont->random )
+ {
+ FT_UInt32 seed;
+
+
+ /* compute random seed from some memory addresses */
+ seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&face ^
+ (FT_Offset)(char*)&subfont );
+ seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
+ if ( seed == 0 )
+ seed = 0x7384;
+
+ subfont->random = seed;
+ }
+ }
+
+
FT_LOCAL_DEF( void )
t1_decrypt( FT_Byte* buffer,
FT_Offset length,
@@ -1779,4 +2518,16 @@
}
+ FT_LOCAL_DEF( FT_UInt32 )
+ cff_random( FT_UInt32 r )
+ {
+ /* a 32bit version of the `xorshift' algorithm */
+ r ^= r << 13;
+ r ^= r >> 17;
+ r ^= r << 5;
+
+ return r;
+ }
+
+
/* END */
diff --git a/thirdparty/freetype/src/psaux/psobjs.h b/thirdparty/freetype/src/psaux/psobjs.h
index 202e5b2416..8e0fe5fa4c 100644
--- a/thirdparty/freetype/src/psaux/psobjs.h
+++ b/thirdparty/freetype/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,7 @@
#include <ft2build.h>
#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_CFF_OBJECTS_TYPES_H
FT_BEGIN_HEADER
@@ -193,17 +194,117 @@ FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/***** *****/
+ /***** CFF BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ FT_LOCAL( void )
+ cff_builder_init( CFF_Builder* builder,
+ TT_Face face,
+ CFF_Size size,
+ CFF_GlyphSlot glyph,
+ FT_Bool hinting );
+
+ FT_LOCAL( void )
+ cff_builder_done( CFF_Builder* builder );
+
+ FT_LOCAL( FT_Error )
+ cff_check_points( CFF_Builder* builder,
+ FT_Int count );
+
+ FT_LOCAL( void )
+ cff_builder_add_point( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag );
+ FT_LOCAL( FT_Error )
+ cff_builder_add_point1( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+ FT_LOCAL( FT_Error )
+ cff_builder_start_point( CFF_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+ FT_LOCAL( void )
+ cff_builder_close_contour( CFF_Builder* builder );
+
+ FT_LOCAL( FT_Error )
+ cff_builder_add_contour( CFF_Builder* builder );
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** PS BUILDER *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ FT_LOCAL( void )
+ ps_builder_init( PS_Builder* ps_builder,
+ void* builder,
+ FT_Bool is_t1 );
+
+
+ FT_LOCAL( void )
+ ps_builder_done( PS_Builder* builder );
+
+ FT_LOCAL( FT_Error )
+ ps_builder_check_points( PS_Builder* builder,
+ FT_Int count );
+
+ FT_LOCAL( void )
+ ps_builder_add_point( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y,
+ FT_Byte flag );
+
+ FT_LOCAL( FT_Error )
+ ps_builder_add_point1( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+
+ FT_LOCAL( FT_Error )
+ ps_builder_add_contour( PS_Builder* builder );
+
+ FT_LOCAL( FT_Error )
+ ps_builder_start_point( PS_Builder* builder,
+ FT_Pos x,
+ FT_Pos y );
+
+ FT_LOCAL( void )
+ ps_builder_close_contour( PS_Builder* builder );
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
/***** OTHER *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
FT_LOCAL( void )
+ ps_decoder_init( PS_Decoder* ps_decoder,
+ void* decoder,
+ FT_Bool is_t1 );
+
+ FT_LOCAL( void )
+ t1_make_subfont( FT_Face face,
+ PS_Private priv,
+ CFF_SubFont subfont );
+
+ FT_LOCAL( void )
t1_decrypt( FT_Byte* buffer,
FT_Offset length,
FT_UShort seed );
+ FT_LOCAL( FT_UInt32 )
+ cff_random( FT_UInt32 r );
+
+
FT_END_HEADER
#endif /* PSOBJS_H_ */
diff --git a/thirdparty/freetype/src/psaux/psread.c b/thirdparty/freetype/src/psaux/psread.c
new file mode 100644
index 0000000000..719863ce17
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psread.c
@@ -0,0 +1,112 @@
+/***************************************************************************/
+/* */
+/* psread.c */
+/* */
+/* Adobe's code for stream handling (body). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psglue.h"
+
+#include "pserror.h"
+
+
+ /* Define CF2_IO_FAIL as 1 to enable random errors and random */
+ /* value errors in I/O. */
+#define CF2_IO_FAIL 0
+
+
+#if CF2_IO_FAIL
+
+ /* set the .00 value to a nonzero probability */
+ static int
+ randomError2( void )
+ {
+ /* for region buffer ReadByte (interp) function */
+ return (double)rand() / RAND_MAX < .00;
+ }
+
+ /* set the .00 value to a nonzero probability */
+ static CF2_Int
+ randomValue()
+ {
+ return (double)rand() / RAND_MAX < .00 ? rand() : 0;
+ }
+
+#endif /* CF2_IO_FAIL */
+
+
+ /* Region Buffer */
+ /* */
+ /* Can be constructed from a copied buffer managed by */
+ /* `FCM_getDatablock'. */
+ /* Reads bytes with check for end of buffer. */
+
+ /* reading past the end of the buffer sets error and returns zero */
+ FT_LOCAL_DEF( CF2_Int )
+ cf2_buf_readByte( CF2_Buffer buf )
+ {
+ if ( buf->ptr < buf->end )
+ {
+#if CF2_IO_FAIL
+ if ( randomError2() )
+ {
+ CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
+ return 0;
+ }
+
+ return *(buf->ptr)++ + randomValue();
+#else
+ return *(buf->ptr)++;
+#endif
+ }
+ else
+ {
+ CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
+ return 0;
+ }
+ }
+
+
+ /* note: end condition can occur without error */
+ FT_LOCAL_DEF( FT_Bool )
+ cf2_buf_isEnd( CF2_Buffer buf )
+ {
+ return (FT_Bool)( buf->ptr >= buf->end );
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psread.h b/thirdparty/freetype/src/psaux/psread.h
new file mode 100644
index 0000000000..464b29ba74
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psread.h
@@ -0,0 +1,68 @@
+/***************************************************************************/
+/* */
+/* psread.h */
+/* */
+/* Adobe's code for stream handling (specification). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSREAD_H_
+#define PSREAD_H_
+
+
+FT_BEGIN_HEADER
+
+
+ typedef struct CF2_BufferRec_
+ {
+ FT_Error* error;
+ const FT_Byte* start;
+ const FT_Byte* end;
+ const FT_Byte* ptr;
+
+ } CF2_BufferRec, *CF2_Buffer;
+
+
+ FT_LOCAL( CF2_Int )
+ cf2_buf_readByte( CF2_Buffer buf );
+ FT_LOCAL( FT_Bool )
+ cf2_buf_isEnd( CF2_Buffer buf );
+
+
+FT_END_HEADER
+
+
+#endif /* PSREAD_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psstack.c b/thirdparty/freetype/src/psaux/psstack.c
new file mode 100644
index 0000000000..69d063349a
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psstack.c
@@ -0,0 +1,328 @@
+/***************************************************************************/
+/* */
+/* psstack.c */
+/* */
+/* Adobe's code for emulating a CFF stack (body). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#include "psft.h"
+#include FT_INTERNAL_DEBUG_H
+
+#include "psglue.h"
+#include "psfont.h"
+#include "psstack.h"
+
+#include "pserror.h"
+
+
+ /* Allocate and initialize an instance of CF2_Stack. */
+ /* Note: This function returns NULL on error (does not set */
+ /* `error'). */
+ FT_LOCAL_DEF( CF2_Stack )
+ cf2_stack_init( FT_Memory memory,
+ FT_Error* e,
+ FT_UInt stackSize )
+ {
+ FT_Error error = FT_Err_Ok; /* for FT_NEW */
+
+ CF2_Stack stack = NULL;
+
+
+ if ( !FT_NEW( stack ) )
+ {
+ /* initialize the structure; FT_NEW zeroes it */
+ stack->memory = memory;
+ stack->error = e;
+ }
+
+ /* allocate the stack buffer */
+ if ( FT_NEW_ARRAY( stack->buffer, stackSize ) )
+ {
+ FT_FREE( stack );
+ return NULL;
+ }
+
+ stack->stackSize = stackSize;
+ stack->top = stack->buffer; /* empty stack */
+
+ return stack;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_stack_free( CF2_Stack stack )
+ {
+ if ( stack )
+ {
+ FT_Memory memory = stack->memory;
+
+ /* free the buffer */
+ FT_FREE( stack->buffer );
+
+ /* free the main structure */
+ FT_FREE( stack );
+ }
+ }
+
+
+ FT_LOCAL_DEF( CF2_UInt )
+ cf2_stack_count( CF2_Stack stack )
+ {
+ return (CF2_UInt)( stack->top - stack->buffer );
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_stack_pushInt( CF2_Stack stack,
+ CF2_Int val )
+ {
+ if ( stack->top == stack->buffer + stack->stackSize )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return; /* stack overflow */
+ }
+
+ stack->top->u.i = val;
+ stack->top->type = CF2_NumberInt;
+ stack->top++;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_stack_pushFixed( CF2_Stack stack,
+ CF2_Fixed val )
+ {
+ if ( stack->top == stack->buffer + stack->stackSize )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return; /* stack overflow */
+ }
+
+ stack->top->u.r = val;
+ stack->top->type = CF2_NumberFixed;
+ stack->top++;
+ }
+
+
+ /* this function is only allowed to pop an integer type */
+ FT_LOCAL_DEF( CF2_Int )
+ cf2_stack_popInt( CF2_Stack stack )
+ {
+ if ( stack->top == stack->buffer )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Underflow );
+ return 0; /* underflow */
+ }
+ if ( stack->top[-1].type != CF2_NumberInt )
+ {
+ CF2_SET_ERROR( stack->error, Syntax_Error );
+ return 0; /* type mismatch */
+ }
+
+ stack->top--;
+
+ return stack->top->u.i;
+ }
+
+
+ /* Note: type mismatch is silently cast */
+ /* TODO: check this */
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_stack_popFixed( CF2_Stack stack )
+ {
+ if ( stack->top == stack->buffer )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Underflow );
+ return cf2_intToFixed( 0 ); /* underflow */
+ }
+
+ stack->top--;
+
+ switch ( stack->top->type )
+ {
+ case CF2_NumberInt:
+ return cf2_intToFixed( stack->top->u.i );
+ case CF2_NumberFrac:
+ return cf2_fracToFixed( stack->top->u.f );
+ default:
+ return stack->top->u.r;
+ }
+ }
+
+
+ /* Note: type mismatch is silently cast */
+ /* TODO: check this */
+ FT_LOCAL_DEF( CF2_Fixed )
+ cf2_stack_getReal( CF2_Stack stack,
+ CF2_UInt idx )
+ {
+ FT_ASSERT( cf2_stack_count( stack ) <= stack->stackSize );
+
+ if ( idx >= cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return cf2_intToFixed( 0 ); /* bounds error */
+ }
+
+ switch ( stack->buffer[idx].type )
+ {
+ case CF2_NumberInt:
+ return cf2_intToFixed( stack->buffer[idx].u.i );
+ case CF2_NumberFrac:
+ return cf2_fracToFixed( stack->buffer[idx].u.f );
+ default:
+ return stack->buffer[idx].u.r;
+ }
+ }
+
+
+ /* provide random access to stack */
+ FT_LOCAL_DEF( void )
+ cf2_stack_setReal( CF2_Stack stack,
+ CF2_UInt idx,
+ CF2_Fixed val )
+ {
+ if ( idx > cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return;
+ }
+
+ stack->buffer[idx].u.r = val;
+ stack->buffer[idx].type = CF2_NumberFixed;
+ }
+
+
+ /* discard (pop) num values from stack */
+ FT_LOCAL_DEF( void )
+ cf2_stack_pop( CF2_Stack stack,
+ CF2_UInt num )
+ {
+ if ( num > cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Underflow );
+ return;
+ }
+ stack->top -= num;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_stack_roll( CF2_Stack stack,
+ CF2_Int count,
+ CF2_Int shift )
+ {
+ /* we initialize this variable to avoid compiler warnings */
+ CF2_StackNumber last = { { 0 }, CF2_NumberInt };
+
+ CF2_Int start_idx, idx, i;
+
+
+ if ( count < 2 )
+ return; /* nothing to do (values 0 and 1), or undefined value */
+
+ if ( (CF2_UInt)count > cf2_stack_count( stack ) )
+ {
+ CF2_SET_ERROR( stack->error, Stack_Overflow );
+ return;
+ }
+
+ if ( shift < 0 )
+ shift = -( ( -shift ) % count );
+ else
+ shift %= count;
+
+ if ( shift == 0 )
+ return; /* nothing to do */
+
+ /* We use the following algorithm to do the rolling, */
+ /* which needs two temporary variables only. */
+ /* */
+ /* Example: */
+ /* */
+ /* count = 8 */
+ /* shift = 2 */
+ /* */
+ /* stack indices before roll: 7 6 5 4 3 2 1 0 */
+ /* stack indices after roll: 1 0 7 6 5 4 3 2 */
+ /* */
+ /* The value of index 0 gets moved to index 2, while */
+ /* the old value of index 2 gets moved to index 4, */
+ /* and so on. We thus have the following copying */
+ /* chains for shift value 2. */
+ /* */
+ /* 0 -> 2 -> 4 -> 6 -> 0 */
+ /* 1 -> 3 -> 5 -> 7 -> 1 */
+ /* */
+ /* If `count' and `shift' are incommensurable, we */
+ /* have a single chain only. Otherwise, increase */
+ /* the start index by 1 after the first chain, then */
+ /* do the next chain until all elements in all */
+ /* chains are handled. */
+
+ start_idx = -1;
+ idx = -1;
+ for ( i = 0; i < count; i++ )
+ {
+ CF2_StackNumber tmp;
+
+
+ if ( start_idx == idx )
+ {
+ start_idx++;
+ idx = start_idx;
+ last = stack->buffer[idx];
+ }
+
+ idx += shift;
+ if ( idx >= count )
+ idx -= count;
+ else if ( idx < 0 )
+ idx += count;
+
+ tmp = stack->buffer[idx];
+ stack->buffer[idx] = last;
+ last = tmp;
+ }
+ }
+
+
+ FT_LOCAL_DEF( void )
+ cf2_stack_clear( CF2_Stack stack )
+ {
+ stack->top = stack->buffer;
+ }
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/psstack.h b/thirdparty/freetype/src/psaux/psstack.h
new file mode 100644
index 0000000000..38f7b41c68
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/psstack.h
@@ -0,0 +1,121 @@
+/***************************************************************************/
+/* */
+/* psstack.h */
+/* */
+/* Adobe's code for emulating a CFF stack (specification). */
+/* */
+/* Copyright 2007-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSSTACK_H_
+#define PSSTACK_H_
+
+
+FT_BEGIN_HEADER
+
+
+ /* CFF operand stack; specified maximum of 48 or 192 values */
+ typedef struct CF2_StackNumber_
+ {
+ union
+ {
+ CF2_Fixed r; /* 16.16 fixed point */
+ CF2_Frac f; /* 2.30 fixed point (for font matrix) */
+ CF2_Int i;
+ } u;
+
+ CF2_NumberType type;
+
+ } CF2_StackNumber;
+
+
+ typedef struct CF2_StackRec_
+ {
+ FT_Memory memory;
+ FT_Error* error;
+ CF2_StackNumber* buffer;
+ CF2_StackNumber* top;
+ FT_UInt stackSize;
+
+ } CF2_StackRec, *CF2_Stack;
+
+
+ FT_LOCAL( CF2_Stack )
+ cf2_stack_init( FT_Memory memory,
+ FT_Error* error,
+ FT_UInt stackSize );
+ FT_LOCAL( void )
+ cf2_stack_free( CF2_Stack stack );
+
+ FT_LOCAL( CF2_UInt )
+ cf2_stack_count( CF2_Stack stack );
+
+ FT_LOCAL( void )
+ cf2_stack_pushInt( CF2_Stack stack,
+ CF2_Int val );
+ FT_LOCAL( void )
+ cf2_stack_pushFixed( CF2_Stack stack,
+ CF2_Fixed val );
+
+ FT_LOCAL( CF2_Int )
+ cf2_stack_popInt( CF2_Stack stack );
+ FT_LOCAL( CF2_Fixed )
+ cf2_stack_popFixed( CF2_Stack stack );
+
+ FT_LOCAL( CF2_Fixed )
+ cf2_stack_getReal( CF2_Stack stack,
+ CF2_UInt idx );
+ FT_LOCAL( void )
+ cf2_stack_setReal( CF2_Stack stack,
+ CF2_UInt idx,
+ CF2_Fixed val );
+
+ FT_LOCAL( void )
+ cf2_stack_pop( CF2_Stack stack,
+ CF2_UInt num );
+
+ FT_LOCAL( void )
+ cf2_stack_roll( CF2_Stack stack,
+ CF2_Int count,
+ CF2_Int idx );
+
+ FT_LOCAL( void )
+ cf2_stack_clear( CF2_Stack stack );
+
+
+FT_END_HEADER
+
+
+#endif /* PSSTACK_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/pstypes.h b/thirdparty/freetype/src/psaux/pstypes.h
new file mode 100644
index 0000000000..dfbaa3d475
--- /dev/null
+++ b/thirdparty/freetype/src/psaux/pstypes.h
@@ -0,0 +1,78 @@
+/***************************************************************************/
+/* */
+/* pstypes.h */
+/* */
+/* Adobe's code for defining data types (specification only). */
+/* */
+/* Copyright 2011-2013 Adobe Systems Incorporated. */
+/* */
+/* This software, and all works of authorship, whether in source or */
+/* object code form as indicated by the copyright notice(s) included */
+/* herein (collectively, the "Work") is made available, and may only be */
+/* used, modified, and distributed under the FreeType Project License, */
+/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
+/* FreeType Project License, each contributor to the Work hereby grants */
+/* to any individual or legal entity exercising permissions granted by */
+/* the FreeType Project License and this section (hereafter, "You" or */
+/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
+/* royalty-free, irrevocable (except as stated in this section) patent */
+/* license to make, have made, use, offer to sell, sell, import, and */
+/* otherwise transfer the Work, where such license applies only to those */
+/* patent claims licensable by such contributor that are necessarily */
+/* infringed by their contribution(s) alone or by combination of their */
+/* contribution(s) with the Work to which such contribution(s) was */
+/* submitted. If You institute patent litigation against any entity */
+/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
+/* the Work or a contribution incorporated within the Work constitutes */
+/* direct or contributory patent infringement, then any patent licenses */
+/* granted to You under this License for that Work shall terminate as of */
+/* the date such litigation is filed. */
+/* */
+/* By using, modifying, or distributing the Work you indicate that you */
+/* have read and understood the terms and conditions of the */
+/* FreeType Project License as well as those provided in this section, */
+/* and you accept them fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef PSTYPES_H_
+#define PSTYPES_H_
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*
+ * The data models that we expect to support are as follows:
+ *
+ * name char short int long long-long pointer example
+ * -----------------------------------------------------
+ * ILP32 8 16 32 32 64* 32 32-bit MacOS, x86
+ * LLP64 8 16 32 32 64 64 x64
+ * LP64 8 16 32 64 64 64 64-bit MacOS
+ *
+ * *) type may be supported by emulation on a 32-bit architecture
+ *
+ */
+
+
+ /* integers at least 32 bits wide */
+#define CF2_UInt FT_UFast
+#define CF2_Int FT_Fast
+
+
+ /* fixed-float numbers */
+ typedef FT_Int32 CF2_F16Dot16;
+
+
+FT_END_HEADER
+
+
+#endif /* PSTYPES_H_ */
+
+
+/* END */
diff --git a/thirdparty/freetype/src/psaux/rules.mk b/thirdparty/freetype/src/psaux/rules.mk
index 542ae12d2b..a87bfe9687 100644
--- a/thirdparty/freetype/src/psaux/rules.mk
+++ b/thirdparty/freetype/src/psaux/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -33,12 +33,25 @@ PSAUX_DRV_SRC := $(PSAUX_DIR)/psobjs.c \
$(PSAUX_DIR)/t1cmap.c \
$(PSAUX_DIR)/afmparse.c \
$(PSAUX_DIR)/psconv.c \
- $(PSAUX_DIR)/psauxmod.c
+ $(PSAUX_DIR)/psauxmod.c \
+ $(PSAUX_DIR)/psarrst.c \
+ $(PSAUX_DIR)/psblues.c \
+ $(PSAUX_DIR)/pserror.c \
+ $(PSAUX_DIR)/psfont.c \
+ $(PSAUX_DIR)/psft.c \
+ $(PSAUX_DIR)/pshints.c \
+ $(PSAUX_DIR)/psintrp.c \
+ $(PSAUX_DIR)/psread.c \
+ $(PSAUX_DIR)/psstack.c \
+ $(PSAUX_DIR)/cffdecode.c
# PSAUX driver headers
#
PSAUX_DRV_H := $(PSAUX_DRV_SRC:%c=%h) \
- $(PSAUX_DIR)/psauxerr.h
+ $(PSAUX_DIR)/psauxerr.h \
+ $(PSAUX_DIR)/psfixed.h \
+ $(PSAUX_DIR)/psglue.h \
+ $(PSAUX_DIR)/pstypes.h
# PSAUX driver object(s)
diff --git a/thirdparty/freetype/src/psaux/t1cmap.c b/thirdparty/freetype/src/psaux/t1cmap.c
index 45b713eb7b..112a7892ba 100644
--- a/thirdparty/freetype/src/psaux/t1cmap.c
+++ b/thirdparty/freetype/src/psaux/t1cmap.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/t1cmap.h b/thirdparty/freetype/src/psaux/t1cmap.h
index 7870245a3a..4308e31d2d 100644
--- a/thirdparty/freetype/src/psaux/t1cmap.h
+++ b/thirdparty/freetype/src/psaux/t1cmap.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 character map support (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psaux/t1decode.c b/thirdparty/freetype/src/psaux/t1decode.c
index 1250b53f5d..6ad145661f 100644
--- a/thirdparty/freetype/src/psaux/t1decode.c
+++ b/thirdparty/freetype/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -112,6 +112,56 @@
/*************************************************************************/
/* */
/* <Function> */
+ /* t1_lookup_glyph_by_stdcharcode_ps */
+ /* */
+ /* <Description> */
+ /* Looks up a given glyph by its StandardEncoding charcode. Used to */
+ /* implement the SEAC Type 1 operator in the Adobe engine */
+ /* */
+ /* <Input> */
+ /* face :: The current face object. */
+ /* */
+ /* charcode :: The character code to look for. */
+ /* */
+ /* <Return> */
+ /* A glyph index in the font face. Returns -1 if the corresponding */
+ /* glyph wasn't found. */
+ /* */
+ FT_LOCAL_DEF( FT_Int )
+ t1_lookup_glyph_by_stdcharcode_ps( PS_Decoder* decoder,
+ FT_Int charcode )
+ {
+ FT_UInt n;
+ const FT_String* glyph_name;
+ FT_Service_PsCMaps psnames = decoder->psnames;
+
+
+ /* check range of standard char code */
+ if ( charcode < 0 || charcode > 255 )
+ return -1;
+
+ glyph_name = psnames->adobe_std_strings(
+ psnames->adobe_std_encoding[charcode]);
+
+ for ( n = 0; n < decoder->num_glyphs; n++ )
+ {
+ FT_String* name = (FT_String*)decoder->glyph_names[n];
+
+
+ if ( name &&
+ name[0] == glyph_name[0] &&
+ ft_strcmp( name, glyph_name ) == 0 )
+ return (FT_Int)n;
+ }
+
+ return -1;
+ }
+
+
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ /*************************************************************************/
+ /* */
+ /* <Function> */
/* t1_lookup_glyph_by_stdcharcode */
/* */
/* <Description> */
@@ -158,6 +208,15 @@
}
+ /* parse a single Type 1 glyph */
+ FT_LOCAL_DEF( FT_Error )
+ t1_decoder_parse_glyph( T1_Decoder decoder,
+ FT_UInt glyph )
+ {
+ return decoder->parse_callback( decoder, glyph );
+ }
+
+
/*************************************************************************/
/* */
/* <Function> */
@@ -1579,14 +1638,286 @@
return FT_THROW( Stack_Underflow );
}
+#else /* T1_CONFIG_OPTION_OLD_ENGINE */
- /* parse a single Type 1 glyph */
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* t1_decoder_parse_metrics */
+ /* */
+ /* <Description> */
+ /* Parses a given Type 1 charstrings program to extract width */
+ /* */
+ /* <Input> */
+ /* decoder :: The current Type 1 decoder. */
+ /* */
+ /* charstring_base :: The base address of the charstring stream. */
+ /* */
+ /* charstring_len :: The length in bytes of the charstring stream. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
FT_LOCAL_DEF( FT_Error )
- t1_decoder_parse_glyph( T1_Decoder decoder,
- FT_UInt glyph )
+ t1_decoder_parse_metrics( T1_Decoder decoder,
+ FT_Byte* charstring_base,
+ FT_UInt charstring_len )
{
- return decoder->parse_callback( decoder, glyph );
+ T1_Decoder_Zone zone;
+ FT_Byte* ip;
+ FT_Byte* limit;
+ T1_Builder builder = &decoder->builder;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_Bool bol = TRUE;
+#endif
+
+
+ /* First of all, initialize the decoder */
+ decoder->top = decoder->stack;
+ decoder->zone = decoder->zones;
+ zone = decoder->zones;
+
+ builder->parse_state = T1_Parse_Start;
+
+ FT_TRACE4(( "\n"
+ "Start charstring: get width\n" ));
+
+ zone->base = charstring_base;
+ limit = zone->limit = charstring_base + charstring_len;
+ ip = zone->cursor = zone->base;
+
+ /* now, execute loop */
+ while ( ip < limit )
+ {
+ FT_Long* top = decoder->top;
+ T1_Operator op = op_none;
+ FT_Int32 value = 0;
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( bol )
+ {
+ FT_TRACE5(( " (%d)", decoder->top - decoder->stack ));
+ bol = FALSE;
+ }
+#endif
+
+ /*********************************************************************/
+ /* */
+ /* Decode operator or operand */
+ /* */
+ /* */
+
+ /* first of all, decompress operator or value */
+ switch ( *ip++ )
+ {
+ case 1:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 14:
+ case 15:
+ case 21:
+ case 22:
+ case 30:
+ case 31:
+ goto No_Width;
+
+ case 13:
+ op = op_hsbw;
+ break;
+
+ case 12:
+ if ( ip >= limit )
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " invalid escape (12+EOF)\n" ));
+ goto Syntax_Error;
+ }
+
+ switch ( *ip++ )
+ {
+ case 7:
+ op = op_sbw;
+ break;
+
+ default:
+ goto No_Width;
+ }
+ break;
+
+ case 255: /* four bytes integer */
+ if ( ip + 4 > limit )
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " unexpected EOF in integer\n" ));
+ goto Syntax_Error;
+ }
+
+ value = (FT_Int32)( ( (FT_UInt32)ip[0] << 24 ) |
+ ( (FT_UInt32)ip[1] << 16 ) |
+ ( (FT_UInt32)ip[2] << 8 ) |
+ (FT_UInt32)ip[3] );
+ ip += 4;
+
+ /* According to the specification, values > 32000 or < -32000 must */
+ /* be followed by a `div' operator to make the result be in the */
+ /* range [-32000;32000]. We expect that the second argument of */
+ /* `div' is not a large number. Additionally, we don't handle */
+ /* stuff like `<large1> <large2> <num> div <num> div' or */
+ /* <large1> <large2> <num> div div'. This is probably not allowed */
+ /* anyway. */
+ if ( value > 32000 || value < -32000 )
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " large integer found for width\n" ));
+ goto Syntax_Error;
+ }
+ else
+ {
+ value = (FT_Int32)( (FT_UInt32)value << 16 );
+ }
+
+ break;
+
+ default:
+ if ( ip[-1] >= 32 )
+ {
+ if ( ip[-1] < 247 )
+ value = (FT_Int32)ip[-1] - 139;
+ else
+ {
+ if ( ++ip > limit )
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " unexpected EOF in integer\n" ));
+ goto Syntax_Error;
+ }
+
+ if ( ip[-2] < 251 )
+ value = ( ( ip[-2] - 247 ) * 256 ) + ip[-1] + 108;
+ else
+ value = -( ( ( ip[-2] - 251 ) * 256 ) + ip[-1] + 108 );
+ }
+
+ value = (FT_Int32)( (FT_UInt32)value << 16 );
+ }
+ else
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " invalid byte (%d)\n", ip[-1] ));
+ goto Syntax_Error;
+ }
+ }
+
+ /*********************************************************************/
+ /* */
+ /* Push value on stack, or process operator */
+ /* */
+ /* */
+ if ( op == op_none )
+ {
+ if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS )
+ {
+ FT_ERROR(( "t1_decoder_parse_metrics: stack overflow\n" ));
+ goto Syntax_Error;
+ }
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ FT_TRACE4(( " %d", value / 65536 ));
+#endif
+
+ *top++ = value;
+ decoder->top = top;
+ }
+ else /* general operator */
+ {
+ FT_Int num_args = t1_args_count[op];
+
+
+ FT_ASSERT( num_args >= 0 );
+
+ if ( top - decoder->stack < num_args )
+ goto Stack_Underflow;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+ if ( top - decoder->stack != num_args )
+ FT_TRACE0(( "t1_decoder_parse_metrics:"
+ " too much operands on the stack"
+ " (seen %d, expected %d)\n",
+ top - decoder->stack, num_args ));
+
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+ top -= num_args;
+
+ switch ( op )
+ {
+ case op_hsbw:
+ FT_TRACE4(( " hsbw" ));
+
+ builder->parse_state = T1_Parse_Have_Width;
+
+ builder->left_bearing.x = ADD_LONG( builder->left_bearing.x,
+ top[0] );
+
+ builder->advance.x = top[1];
+ builder->advance.y = 0;
+
+ /* we only want to compute the glyph's metrics */
+ /* (lsb + advance width), not load the rest of */
+ /* it; so exit immediately */
+ return FT_Err_Ok;
+
+ case op_sbw:
+ FT_TRACE4(( " sbw" ));
+
+ builder->parse_state = T1_Parse_Have_Width;
+
+ builder->left_bearing.x = ADD_LONG( builder->left_bearing.x,
+ top[0] );
+ builder->left_bearing.y = ADD_LONG( builder->left_bearing.y,
+ top[1] );
+
+ builder->advance.x = top[2];
+ builder->advance.y = top[3];
+
+ /* we only want to compute the glyph's metrics */
+ /* (lsb + advance width), not load the rest of */
+ /* it; so exit immediately */
+ return FT_Err_Ok;
+
+ default:
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " unhandled opcode %d\n", op ));
+ goto Syntax_Error;
+ }
+
+ } /* general operator processing */
+
+ } /* while ip < limit */
+
+ FT_TRACE4(( "..end..\n\n" ));
+
+ No_Width:
+ FT_ERROR(( "t1_decoder_parse_metrics:"
+ " no width, found op %d instead\n",
+ ip[-1] ));
+ Syntax_Error:
+ return FT_THROW( Syntax_Error );
+
+ Stack_Underflow:
+ return FT_THROW( Stack_Underflow );
}
+#endif /* T1_CONFIG_OPTION_OLD_ENGINE */
/* initialize T1 decoder */
@@ -1641,7 +1972,16 @@
FT_LOCAL_DEF( void )
t1_decoder_done( T1_Decoder decoder )
{
+ FT_Memory memory = decoder->builder.memory;
+
+
t1_builder_done( &decoder->builder );
+
+ if ( decoder->cf2_instance.finalizer )
+ {
+ decoder->cf2_instance.finalizer( decoder->cf2_instance.data );
+ FT_FREE( decoder->cf2_instance.data );
+ }
}
diff --git a/thirdparty/freetype/src/psaux/t1decode.h b/thirdparty/freetype/src/psaux/t1decode.h
index 12c27de775..1d9718d678 100644
--- a/thirdparty/freetype/src/psaux/t1decode.h
+++ b/thirdparty/freetype/src/psaux/t1decode.h
@@ -4,7 +4,7 @@
/* */
/* PostScript Type 1 decoding routines (specification). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,7 +31,11 @@ FT_BEGIN_HEADER
FT_CALLBACK_TABLE
const T1_Decoder_FuncsRec t1_decoder_funcs;
+ FT_LOCAL( FT_Int )
+ t1_lookup_glyph_by_stdcharcode_ps( PS_Decoder* decoder,
+ FT_Int charcode );
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
FT_LOCAL( FT_Error )
t1_decoder_parse_glyph( T1_Decoder decoder,
FT_UInt glyph_index );
@@ -40,6 +44,12 @@ FT_BEGIN_HEADER
t1_decoder_parse_charstrings( T1_Decoder decoder,
FT_Byte* base,
FT_UInt len );
+#else
+ FT_LOCAL( FT_Error )
+ t1_decoder_parse_metrics( T1_Decoder decoder,
+ FT_Byte* charstring_base,
+ FT_UInt charstring_len );
+#endif
FT_LOCAL( FT_Error )
t1_decoder_init( T1_Decoder decoder,
diff --git a/thirdparty/freetype/src/pshinter/module.mk b/thirdparty/freetype/src/pshinter/module.mk
index 77e35c4c10..06707be3b4 100644
--- a/thirdparty/freetype/src/pshinter/module.mk
+++ b/thirdparty/freetype/src/pshinter/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/pshinter/pshalgo.c b/thirdparty/freetype/src/pshinter/pshalgo.c
index 9ad1a3a02a..b98077c62e 100644
--- a/thirdparty/freetype/src/pshinter/pshalgo.c
+++ b/thirdparty/freetype/src/pshinter/pshalgo.c
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (body). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -26,7 +26,7 @@
#undef FT_COMPONENT
-#define FT_COMPONENT trace_pshalgo2
+#define FT_COMPONENT trace_pshalgo
#ifdef DEBUG_HINTER
diff --git a/thirdparty/freetype/src/pshinter/pshalgo.h b/thirdparty/freetype/src/pshinter/pshalgo.h
index 62e97d152b..c50683fbec 100644
--- a/thirdparty/freetype/src/pshinter/pshalgo.h
+++ b/thirdparty/freetype/src/pshinter/pshalgo.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinting algorithm (specification). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshglob.c b/thirdparty/freetype/src/pshinter/pshglob.c
index c68770c73a..accc04921d 100644
--- a/thirdparty/freetype/src/pshinter/pshglob.c
+++ b/thirdparty/freetype/src/pshinter/pshglob.c
@@ -5,7 +5,7 @@
/* PostScript hinter global hinting management (body). */
/* Inspired by the new auto-hinter module. */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@@ -227,8 +227,8 @@
}
- /* Re-read blue zones from the original fonts and store them into out */
- /* private structure. This function re-orders, sanitizes and */
+ /* Re-read blue zones from the original fonts and store them into our */
+ /* private structure. This function re-orders, sanitizes, and */
/* fuzz-expands the zones as well. */
static void
psh_blues_set_zones( PSH_Blues target,
diff --git a/thirdparty/freetype/src/pshinter/pshglob.h b/thirdparty/freetype/src/pshinter/pshglob.h
index 8801cbada4..cf80bf40e6 100644
--- a/thirdparty/freetype/src/pshinter/pshglob.h
+++ b/thirdparty/freetype/src/pshinter/pshglob.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter global hinting management. */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshinter.c b/thirdparty/freetype/src/pshinter/pshinter.c
index 13e07e1485..0eedac452d 100644
--- a/thirdparty/freetype/src/pshinter/pshinter.c
+++ b/thirdparty/freetype/src/pshinter/pshinter.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript Hinting module */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshmod.c b/thirdparty/freetype/src/pshinter/pshmod.c
index 860dc0ae82..0b8f6f99b8 100644
--- a/thirdparty/freetype/src/pshinter/pshmod.c
+++ b/thirdparty/freetype/src/pshinter/pshmod.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hinter module implementation (body). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshmod.h b/thirdparty/freetype/src/pshinter/pshmod.h
index 1d2b40fa13..556de2fbc0 100644
--- a/thirdparty/freetype/src/pshinter/pshmod.h
+++ b/thirdparty/freetype/src/pshinter/pshmod.h
@@ -4,7 +4,7 @@
/* */
/* PostScript hinter module interface (specification). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshnterr.h b/thirdparty/freetype/src/pshinter/pshnterr.h
index 73d144e34c..b9d02d2956 100644
--- a/thirdparty/freetype/src/pshinter/pshnterr.h
+++ b/thirdparty/freetype/src/pshinter/pshnterr.h
@@ -4,7 +4,7 @@
/* */
/* PS Hinter error codes (specification only). */
/* */
-/* Copyright 2003-2017 by */
+/* Copyright 2003-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshpic.c b/thirdparty/freetype/src/pshinter/pshpic.c
index c0d3a64f29..465ad31885 100644
--- a/thirdparty/freetype/src/pshinter/pshpic.c
+++ b/thirdparty/freetype/src/pshinter/pshpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshpic.h b/thirdparty/freetype/src/pshinter/pshpic.h
index 8d9a01c9c5..4469ba87c8 100644
--- a/thirdparty/freetype/src/pshinter/pshpic.h
+++ b/thirdparty/freetype/src/pshinter/pshpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for pshinter module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshrec.c b/thirdparty/freetype/src/pshinter/pshrec.c
index fff6d34250..6648d13d60 100644
--- a/thirdparty/freetype/src/pshinter/pshrec.c
+++ b/thirdparty/freetype/src/pshinter/pshrec.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PostScript hints recorder (body). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/pshrec.h b/thirdparty/freetype/src/pshinter/pshrec.h
index e10bc2b120..7e3dfe0d53 100644
--- a/thirdparty/freetype/src/pshinter/pshrec.h
+++ b/thirdparty/freetype/src/pshinter/pshrec.h
@@ -4,7 +4,7 @@
/* */
/* Postscript (Type1/Type2) hints recorder (specification). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/pshinter/rules.mk b/thirdparty/freetype/src/pshinter/rules.mk
index 2be6404380..966690efc2 100644
--- a/thirdparty/freetype/src/pshinter/rules.mk
+++ b/thirdparty/freetype/src/pshinter/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2001-2017 by
+# Copyright 2001-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psnames/module.mk b/thirdparty/freetype/src/psnames/module.mk
index ddd22960c1..410f48a191 100644
--- a/thirdparty/freetype/src/psnames/module.mk
+++ b/thirdparty/freetype/src/psnames/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/psnames/psmodule.c b/thirdparty/freetype/src/psnames/psmodule.c
index 44ba9ec6ab..8929ebe751 100644
--- a/thirdparty/freetype/src/psnames/psmodule.c
+++ b/thirdparty/freetype/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/psmodule.h b/thirdparty/freetype/src/psnames/psmodule.h
index 6983b79234..3e94f8b437 100644
--- a/thirdparty/freetype/src/psnames/psmodule.h
+++ b/thirdparty/freetype/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
/* */
/* High-level PSNames module interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/psnamerr.h b/thirdparty/freetype/src/psnames/psnamerr.h
index f90bf5ea43..14eb76c99c 100644
--- a/thirdparty/freetype/src/psnames/psnamerr.h
+++ b/thirdparty/freetype/src/psnames/psnamerr.h
@@ -4,7 +4,7 @@
/* */
/* PS names module error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/psnames.c b/thirdparty/freetype/src/psnames/psnames.c
index 22466d6230..febb80d594 100644
--- a/thirdparty/freetype/src/psnames/psnames.c
+++ b/thirdparty/freetype/src/psnames/psnames.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PSNames module component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/pspic.c b/thirdparty/freetype/src/psnames/pspic.c
index 8b9003439b..85a06f3603 100644
--- a/thirdparty/freetype/src/psnames/pspic.c
+++ b/thirdparty/freetype/src/psnames/pspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/pspic.h b/thirdparty/freetype/src/psnames/pspic.h
index 14497e73fa..889780cc03 100644
--- a/thirdparty/freetype/src/psnames/pspic.h
+++ b/thirdparty/freetype/src/psnames/pspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for psnames module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/pstables.h b/thirdparty/freetype/src/psnames/pstables.h
index 2a2b717d8f..79545ee039 100644
--- a/thirdparty/freetype/src/psnames/pstables.h
+++ b/thirdparty/freetype/src/psnames/pstables.h
@@ -4,7 +4,7 @@
/* */
/* PostScript glyph names. */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/psnames/rules.mk b/thirdparty/freetype/src/psnames/rules.mk
index 69fa732200..4d629d841c 100644
--- a/thirdparty/freetype/src/psnames/rules.mk
+++ b/thirdparty/freetype/src/psnames/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/raster/ftmisc.h b/thirdparty/freetype/src/raster/ftmisc.h
index d1e6627ab4..7e40119071 100644
--- a/thirdparty/freetype/src/raster/ftmisc.h
+++ b/thirdparty/freetype/src/raster/ftmisc.h
@@ -5,7 +5,7 @@
/* Miscellaneous macros for stand-alone rasterizer (specification */
/* only). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/raster/ftraster.c b/thirdparty/freetype/src/raster/ftraster.c
index c5643f6334..4354730d54 100644
--- a/thirdparty/freetype/src/raster/ftraster.c
+++ b/thirdparty/freetype/src/raster/ftraster.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/ftraster.h b/thirdparty/freetype/src/raster/ftraster.h
index 6b3050cb3d..40b5d6d321 100644
--- a/thirdparty/freetype/src/raster/ftraster.h
+++ b/thirdparty/freetype/src/raster/ftraster.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
diff --git a/thirdparty/freetype/src/raster/ftrend1.c b/thirdparty/freetype/src/raster/ftrend1.c
index 185a7f6fc2..a7ce9731d7 100644
--- a/thirdparty/freetype/src/raster/ftrend1.c
+++ b/thirdparty/freetype/src/raster/ftrend1.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -97,12 +97,12 @@
FT_Render_Mode mode,
const FT_Vector* origin )
{
- FT_Error error;
- FT_Outline* outline;
- FT_BBox cbox, cbox0;
- FT_UInt width, height, pitch;
- FT_Bitmap* bitmap;
- FT_Memory memory;
+ FT_Error error = FT_Err_Ok;
+ FT_Outline* outline = &slot->outline;
+ FT_Bitmap* bitmap = &slot->bitmap;
+ FT_Memory memory = render->root.memory;
+ FT_Pos x_shift = 0;
+ FT_Pos y_shift = 0;
FT_Raster_Params params;
@@ -121,60 +121,6 @@
return FT_THROW( Cannot_Render_Glyph );
}
- outline = &slot->outline;
-
- /* translate the outline to the new origin if needed */
- if ( origin )
- FT_Outline_Translate( outline, origin->x, origin->y );
-
- /* compute the control box, and grid fit it */
- FT_Outline_Get_CBox( outline, &cbox0 );
-
- /* undocumented but confirmed: bbox values get rounded */
-#if 1
- cbox.xMin = FT_PIX_ROUND( cbox0.xMin );
- cbox.yMin = FT_PIX_ROUND( cbox0.yMin );
- cbox.xMax = FT_PIX_ROUND( cbox0.xMax );
- cbox.yMax = FT_PIX_ROUND( cbox0.yMax );
-#else
- cbox.xMin = FT_PIX_FLOOR( cbox.xMin );
- cbox.yMin = FT_PIX_FLOOR( cbox.yMin );
- cbox.xMax = FT_PIX_CEIL( cbox.xMax );
- cbox.yMax = FT_PIX_CEIL( cbox.yMax );
-#endif
-
- /* If either `width' or `height' round to 0, try */
- /* explicitly rounding up/down. In the case of */
- /* glyphs containing only one very narrow feature, */
- /* this gives the drop-out compensation in the scan */
- /* conversion code a chance to do its stuff. */
- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
- if ( width == 0 )
- {
- cbox.xMin = FT_PIX_FLOOR( cbox0.xMin );
- cbox.xMax = FT_PIX_CEIL( cbox0.xMax );
-
- width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
- }
-
- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
- if ( height == 0 )
- {
- cbox.yMin = FT_PIX_FLOOR( cbox0.yMin );
- cbox.yMax = FT_PIX_CEIL( cbox0.yMax );
-
- height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
- }
-
- if ( width > FT_USHORT_MAX || height > FT_USHORT_MAX )
- {
- error = FT_THROW( Invalid_Argument );
- goto Exit;
- }
-
- bitmap = &slot->bitmap;
- memory = render->root.memory;
-
/* release old bitmap buffer */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
@@ -182,39 +128,48 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
- pitch = ( ( width + 15 ) >> 4 ) << 1;
- bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
-
- bitmap->width = width;
- bitmap->rows = height;
- bitmap->pitch = (int)pitch;
+ ft_glyphslot_preset_bitmap( slot, mode, origin );
- if ( FT_ALLOC_MULT( bitmap->buffer, height, pitch ) )
+ /* allocate new one */
+ if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
goto Exit;
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+ x_shift = -slot->bitmap_left * 64;
+ y_shift = ( (FT_Int)bitmap->rows - slot->bitmap_top ) * 64;
+
+ if ( origin )
+ {
+ x_shift += origin->x;
+ y_shift += origin->y;
+ }
+
/* translate outline to render it into the bitmap */
- FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin );
+ if ( x_shift || y_shift )
+ FT_Outline_Translate( outline, x_shift, y_shift );
/* set up parameters */
params.target = bitmap;
params.source = outline;
- params.flags = 0;
+ params.flags = FT_RASTER_FLAG_DEFAULT;
/* render outline into the bitmap */
error = render->raster_render( render->raster, &params );
- FT_Outline_Translate( outline, cbox.xMin, cbox.yMin );
-
- if ( error )
- goto Exit;
+ Exit:
+ if ( !error )
+ /* everything is fine; the glyph is now officially a bitmap */
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
+ else if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+ {
+ FT_FREE( bitmap->buffer );
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+ }
- slot->format = FT_GLYPH_FORMAT_BITMAP;
- slot->bitmap_left = (FT_Int)( cbox.xMin >> 6 );
- slot->bitmap_top = (FT_Int)( cbox.yMax >> 6 );
+ if ( x_shift || y_shift )
+ FT_Outline_Translate( outline, -x_shift, -y_shift );
- Exit:
return error;
}
diff --git a/thirdparty/freetype/src/raster/ftrend1.h b/thirdparty/freetype/src/raster/ftrend1.h
index cff702d140..2abdf2d703 100644
--- a/thirdparty/freetype/src/raster/ftrend1.h
+++ b/thirdparty/freetype/src/raster/ftrend1.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph rasterizer interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/module.mk b/thirdparty/freetype/src/raster/module.mk
index aad39cb56a..b115f416b2 100644
--- a/thirdparty/freetype/src/raster/module.mk
+++ b/thirdparty/freetype/src/raster/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/raster/raster.c b/thirdparty/freetype/src/raster/raster.c
index 46a6690b17..76edd21e1e 100644
--- a/thirdparty/freetype/src/raster/raster.c
+++ b/thirdparty/freetype/src/raster/raster.c
@@ -4,7 +4,7 @@
/* */
/* FreeType monochrome rasterer module component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rasterrs.h b/thirdparty/freetype/src/raster/rasterrs.h
index 0d646908ad..22a3e15340 100644
--- a/thirdparty/freetype/src/raster/rasterrs.h
+++ b/thirdparty/freetype/src/raster/rasterrs.h
@@ -4,7 +4,7 @@
/* */
/* monochrome renderer error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rastpic.c b/thirdparty/freetype/src/raster/rastpic.c
index 7085339b7b..1dc8981b8a 100644
--- a/thirdparty/freetype/src/raster/rastpic.c
+++ b/thirdparty/freetype/src/raster/rastpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rastpic.h b/thirdparty/freetype/src/raster/rastpic.h
index dcd691310d..6d0877c423 100644
--- a/thirdparty/freetype/src/raster/rastpic.h
+++ b/thirdparty/freetype/src/raster/rastpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for raster module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/raster/rules.mk b/thirdparty/freetype/src/raster/rules.mk
index 0462c93177..9aef1f0bab 100644
--- a/thirdparty/freetype/src/raster/rules.mk
+++ b/thirdparty/freetype/src/raster/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/module.mk b/thirdparty/freetype/src/sfnt/module.mk
index 81dea17de0..51ca67e784 100644
--- a/thirdparty/freetype/src/sfnt/module.mk
+++ b/thirdparty/freetype/src/sfnt/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/pngshim.c b/thirdparty/freetype/src/sfnt/pngshim.c
index 560db4835a..16020266af 100644
--- a/thirdparty/freetype/src/sfnt/pngshim.c
+++ b/thirdparty/freetype/src/sfnt/pngshim.c
@@ -4,7 +4,7 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
@@ -82,42 +82,45 @@
typedef unsigned short v82 __attribute__(( vector_size( 16 ) ));
- /* process blocks of 16 bytes in one rush, which gives a nice speed-up */
- limit = row_info->rowbytes - 16 + 1;
- for ( ; i < limit; i += 16 )
+ if ( row_info->rowbytes > 15 )
{
- unsigned char* base = &data[i];
+ /* process blocks of 16 bytes in one rush, which gives a nice speed-up */
+ limit = row_info->rowbytes - 16 + 1;
+ for ( ; i < limit; i += 16 )
+ {
+ unsigned char* base = &data[i];
- v82 s, s0, s1, a;
+ v82 s, s0, s1, a;
- /* clang <= 3.9 can't apply scalar values to vectors */
- /* (or rather, it needs a different syntax) */
- v82 n0x80 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
- v82 n0xFF = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
- v82 n8 = { 8, 8, 8, 8, 8, 8, 8, 8 };
+ /* clang <= 3.9 can't apply scalar values to vectors */
+ /* (or rather, it needs a different syntax) */
+ v82 n0x80 = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
+ v82 n0xFF = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+ v82 n8 = { 8, 8, 8, 8, 8, 8, 8, 8 };
- v82 ma = { 1, 1, 3, 3, 5, 5, 7, 7 };
- v82 o1 = { 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF };
- v82 m0 = { 1, 0, 3, 2, 5, 4, 7, 6 };
+ v82 ma = { 1, 1, 3, 3, 5, 5, 7, 7 };
+ v82 o1 = { 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF };
+ v82 m0 = { 1, 0, 3, 2, 5, 4, 7, 6 };
- memcpy( &s, base, 16 ); /* RGBA RGBA RGBA RGBA */
- s0 = s & n0xFF; /* R B R B R B R B */
- s1 = s >> n8; /* G A G A G A G A */
+ ft_memcpy( &s, base, 16 ); /* RGBA RGBA RGBA RGBA */
+ s0 = s & n0xFF; /* R B R B R B R B */
+ s1 = s >> n8; /* G A G A G A G A */
- a = vector_shuffle( s1, ma ); /* A A A A A A A A */
- s1 |= o1; /* G 1 G 1 G 1 G 1 */
- s0 = vector_shuffle( s0, m0 ); /* B R B R B R B R */
+ a = vector_shuffle( s1, ma ); /* A A A A A A A A */
+ s1 |= o1; /* G 1 G 1 G 1 G 1 */
+ s0 = vector_shuffle( s0, m0 ); /* B R B R B R B R */
- s0 *= a;
- s1 *= a;
- s0 += n0x80;
- s1 += n0x80;
- s0 = ( s0 + ( s0 >> n8 ) ) >> n8;
- s1 = ( s1 + ( s1 >> n8 ) ) >> n8;
+ s0 *= a;
+ s1 *= a;
+ s0 += n0x80;
+ s1 += n0x80;
+ s0 = ( s0 + ( s0 >> n8 ) ) >> n8;
+ s1 = ( s1 + ( s1 >> n8 ) ) >> n8;
- s = s0 | ( s1 << n8 );
- memcpy( base, &s, 16 );
+ s = s0 | ( s1 << n8 );
+ ft_memcpy( base, &s, 16 );
+ }
}
#endif /* use `vector_size' */
@@ -234,7 +237,7 @@
return;
}
- memcpy( data, stream->cursor, length );
+ ft_memcpy( data, stream->cursor, length );
FT_FRAME_EXIT();
}
diff --git a/thirdparty/freetype/src/sfnt/pngshim.h b/thirdparty/freetype/src/sfnt/pngshim.h
index 344eceac12..194238c3a2 100644
--- a/thirdparty/freetype/src/sfnt/pngshim.h
+++ b/thirdparty/freetype/src/sfnt/pngshim.h
@@ -4,7 +4,7 @@
/* */
/* PNG Bitmap glyph support. */
/* */
-/* Copyright 2013-2017 by */
+/* Copyright 2013-2018 by */
/* Google, Inc. */
/* Written by Stuart Gill and Behdad Esfahbod. */
/* */
diff --git a/thirdparty/freetype/src/sfnt/rules.mk b/thirdparty/freetype/src/sfnt/rules.mk
index 230d56c946..83acc66a8f 100644
--- a/thirdparty/freetype/src/sfnt/rules.mk
+++ b/thirdparty/freetype/src/sfnt/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/sfnt/sfdriver.c b/thirdparty/freetype/src/sfnt/sfdriver.c
index 991433ee4c..303e1ca9f1 100644
--- a/thirdparty/freetype/src/sfnt/sfdriver.c
+++ b/thirdparty/freetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -862,7 +862,8 @@
NULL,
&mm_var );
- if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) &&
+ !FT_IS_VARIATION( FT_FACE( face ) ) )
{
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
@@ -1029,7 +1030,9 @@
return face->postscript_name;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( face->blend )
+ if ( face->blend &&
+ ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ||
+ FT_IS_VARIATION( FT_FACE( face ) ) ) )
{
face->postscript_name = sfnt_get_var_ps_name( face );
return face->postscript_name;
diff --git a/thirdparty/freetype/src/sfnt/sfdriver.h b/thirdparty/freetype/src/sfnt/sfdriver.h
index 38710b60f2..81c22d2887 100644
--- a/thirdparty/freetype/src/sfnt/sfdriver.h
+++ b/thirdparty/freetype/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sferrors.h b/thirdparty/freetype/src/sfnt/sferrors.h
index 3cf73d725d..74003d4b38 100644
--- a/thirdparty/freetype/src/sfnt/sferrors.h
+++ b/thirdparty/freetype/src/sfnt/sferrors.h
@@ -4,7 +4,7 @@
/* */
/* SFNT error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfnt.c b/thirdparty/freetype/src/sfnt/sfnt.c
index 6cf8c9ef30..8b9a6b345d 100644
--- a/thirdparty/freetype/src/sfnt/sfnt.c
+++ b/thirdparty/freetype/src/sfnt/sfnt.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfntpic.c b/thirdparty/freetype/src/sfnt/sfntpic.c
index 8eadd601fd..db2d816ce6 100644
--- a/thirdparty/freetype/src/sfnt/sfntpic.c
+++ b/thirdparty/freetype/src/sfnt/sfntpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfntpic.h b/thirdparty/freetype/src/sfnt/sfntpic.h
index 3afb668db0..8f43122d81 100644
--- a/thirdparty/freetype/src/sfnt/sfntpic.h
+++ b/thirdparty/freetype/src/sfnt/sfntpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for sfnt module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/sfobjs.c b/thirdparty/freetype/src/sfnt/sfobjs.c
index 69bf0a5c3d..6ba8509f56 100644
--- a/thirdparty/freetype/src/sfnt/sfobjs.c
+++ b/thirdparty/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -962,8 +962,6 @@
FT_Byte* instance_values = NULL;
- face->is_default_instance = 1;
-
instance_index = FT_ABS( face_instance_index ) >> 16;
/* test whether current face is a GX font with named instances */
@@ -1146,6 +1144,8 @@
FT_Bool has_outline;
FT_Bool is_apple_sbit;
FT_Bool is_apple_sbix;
+ FT_Bool has_CBLC;
+ FT_Bool has_CBDT;
FT_Bool ignore_typographic_family = FALSE;
FT_Bool ignore_typographic_subfamily = FALSE;
@@ -1226,6 +1226,13 @@
goto Exit;
}
+ has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
+ has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
+
+ /* Ignore outlines for CBLC/CBDT fonts. */
+ if ( has_CBLC || has_CBDT )
+ has_outline = FALSE;
+
/* OpenType 1.8.2 introduced limits to this value; */
/* however, they make sense for older SFNT fonts also */
if ( face->header.Units_Per_EM < 16 ||
@@ -1686,9 +1693,9 @@
(FT_Short)( face->vertical_info ? face->vertical.advance_Height_Max
: root->height );
- /* See http://www.microsoft.com/OpenType/OTSpec/post.htm -- */
- /* Adjust underline position from top edge to centre of */
- /* stroke to convert TrueType meaning to FreeType meaning. */
+ /* See https://www.microsoft.com/typography/otspec/post.htm -- */
+ /* Adjust underline position from top edge to centre of */
+ /* stroke to convert TrueType meaning to FreeType meaning. */
root->underline_position = face->postscript.underlinePosition -
face->postscript.underlineThickness / 2;
root->underline_thickness = face->postscript.underlineThickness;
diff --git a/thirdparty/freetype/src/sfnt/sfobjs.h b/thirdparty/freetype/src/sfnt/sfobjs.h
index 705381459a..1b8d1be5b1 100644
--- a/thirdparty/freetype/src/sfnt/sfobjs.h
+++ b/thirdparty/freetype/src/sfnt/sfobjs.h
@@ -4,7 +4,7 @@
/* */
/* SFNT object management (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttbdf.c b/thirdparty/freetype/src/sfnt/ttbdf.c
index 2196e3791e..534201f229 100644
--- a/thirdparty/freetype/src/sfnt/ttbdf.c
+++ b/thirdparty/freetype/src/sfnt/ttbdf.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (body). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttbdf.h b/thirdparty/freetype/src/sfnt/ttbdf.h
index 398b620600..809a663001 100644
--- a/thirdparty/freetype/src/sfnt/ttbdf.h
+++ b/thirdparty/freetype/src/sfnt/ttbdf.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded BDF properties (specification). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -28,6 +28,8 @@
FT_BEGIN_HEADER
+#ifdef TT_CONFIG_OPTION_BDF
+
FT_LOCAL( void )
tt_face_free_bdf_props( TT_Face face );
@@ -37,6 +39,8 @@ FT_BEGIN_HEADER
const char* property_name,
BDF_PropertyRec *aprop );
+#endif /* TT_CONFIG_OPTION_BDF */
+
FT_END_HEADER
diff --git a/thirdparty/freetype/src/sfnt/ttcmap.c b/thirdparty/freetype/src/sfnt/ttcmap.c
index b995e5c050..996e66485f 100644
--- a/thirdparty/freetype/src/sfnt/ttcmap.c
+++ b/thirdparty/freetype/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -222,10 +222,10 @@
/***** The following charmap lookup and iteration functions all *****/
/***** assume that the value `charcode' fulfills the following. *****/
/***** *****/
- /***** - For one byte characters, `charcode' is simply the *****/
+ /***** - For one-byte characters, `charcode' is simply the *****/
/***** character code. *****/
/***** *****/
- /***** - For two byte characters, `charcode' is the 2-byte *****/
+ /***** - For two-byte characters, `charcode' is the 2-byte *****/
/***** character code in big endian format. More precisely: *****/
/***** *****/
/***** (charcode >> 8) is the first byte value *****/
@@ -252,11 +252,11 @@
/* subs 518 SUBHEAD[NSUBS] sub-headers array */
/* glyph_ids 518+NSUB*8 USHORT[] glyph ID array */
/* */
- /* The `keys' table is used to map charcode high-bytes to sub-headers. */
+ /* The `keys' table is used to map charcode high bytes to sub-headers. */
/* The value of `NSUBS' is the number of sub-headers defined in the */
/* table and is computed by finding the maximum of the `keys' table. */
/* */
- /* Note that for any n, `keys[n]' is a byte offset within the `subs' */
+ /* Note that for any `n', `keys[n]' is a byte offset within the `subs' */
/* table, i.e., it is the corresponding sub-header index multiplied */
/* by 8. */
/* */
@@ -269,8 +269,8 @@
/* delta 4 SHORT see below */
/* offset 6 USHORT see below */
/* */
- /* A sub-header defines, for each high-byte, the range of valid */
- /* low-bytes within the charmap. Note that the range defined by `first' */
+ /* A sub-header defines, for each high byte, the range of valid */
+ /* low bytes within the charmap. Note that the range defined by `first' */
/* and `count' must be completely included in the interval [0..255] */
/* according to the specification. */
/* */
@@ -360,7 +360,7 @@
/* check range within 0..255 */
if ( valid->level >= FT_VALIDATE_PARANOID )
{
- if ( first_code >= 256 || first_code + code_count > 256 )
+ if ( first_code >= 256 || code_count > 256 - first_code )
FT_INVALID_DATA;
}
@@ -412,7 +412,7 @@
{
FT_UInt char_lo = (FT_UInt)( char_code & 0xFF );
FT_UInt char_hi = (FT_UInt)( char_code >> 8 );
- FT_Byte* p = table + 6; /* keys table */
+ FT_Byte* p = table + 6; /* keys table */
FT_Byte* subs = table + 518; /* subheaders table */
FT_Byte* sub;
@@ -425,8 +425,8 @@
sub = subs; /* jump to first sub-header */
/* check that the sub-header for this byte is 0, which */
- /* indicates that it is really a valid one-byte value */
- /* Otherwise, return 0 */
+ /* indicates that it is really a valid one-byte value; */
+ /* otherwise, return 0 */
/* */
p += char_lo * 2;
if ( TT_PEEK_USHORT( p ) != 0 )
@@ -445,6 +445,7 @@
if ( sub == subs )
goto Exit;
}
+
result = sub;
}
@@ -517,8 +518,19 @@
FT_UInt pos, idx;
+ if ( char_lo >= start + count && charcode <= 0xFF )
+ {
+ /* this happens only for a malformed cmap */
+ charcode = 0x100;
+ continue;
+ }
+
if ( offset == 0 )
+ {
+ if ( charcode == 0x100 )
+ goto Exit; /* this happens only for a malformed cmap */
goto Next_SubHeader;
+ }
if ( char_lo < start )
{
@@ -545,11 +557,20 @@
}
}
}
+
+ /* if unsuccessful, avoid `charcode' leaving */
+ /* the current 256-character block */
+ if ( count )
+ charcode--;
}
- /* jump to next sub-header, i.e. higher byte value */
+ /* If `charcode' is <= 0xFF, retry with `charcode + 1'. */
+ /* Otherwise jump to the next 256-character block and retry. */
Next_SubHeader:
- charcode = FT_PAD_FLOOR( charcode, 256 ) + 256;
+ if ( charcode <= 0xFF )
+ charcode++;
+ else
+ charcode = FT_PAD_FLOOR( charcode, 0x100 ) + 0x100;
}
Exit:
diff --git a/thirdparty/freetype/src/sfnt/ttcmap.h b/thirdparty/freetype/src/sfnt/ttcmap.h
index f7de0437b0..d264d99d2c 100644
--- a/thirdparty/freetype/src/sfnt/ttcmap.h
+++ b/thirdparty/freetype/src/sfnt/ttcmap.h
@@ -4,7 +4,7 @@
/* */
/* TrueType character mapping table (cmap) support (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttcmapc.h b/thirdparty/freetype/src/sfnt/ttcmapc.h
index 9a5e70825e..4980e9dd3d 100644
--- a/thirdparty/freetype/src/sfnt/ttcmapc.h
+++ b/thirdparty/freetype/src/sfnt/ttcmapc.h
@@ -4,7 +4,7 @@
/* */
/* TT CMAP classes definitions (specification only). */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttkern.c b/thirdparty/freetype/src/sfnt/ttkern.c
index 53d2436ae5..68f15a2010 100644
--- a/thirdparty/freetype/src/sfnt/ttkern.c
+++ b/thirdparty/freetype/src/sfnt/ttkern.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttkern.h b/thirdparty/freetype/src/sfnt/ttkern.h
index db1a30bdb0..4e45d0964b 100644
--- a/thirdparty/freetype/src/sfnt/ttkern.h
+++ b/thirdparty/freetype/src/sfnt/ttkern.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType kerning table. This doesn't handle */
/* kerning data within the GPOS table at the moment. */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttload.c b/thirdparty/freetype/src/sfnt/ttload.c
index df99baa53e..a86a546c3d 100644
--- a/thirdparty/freetype/src/sfnt/ttload.c
+++ b/thirdparty/freetype/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -338,7 +338,7 @@
SFNT_HeaderRec sfnt;
FT_Error error;
FT_Memory memory = stream->memory;
- FT_UShort nn, valid_entries;
+ FT_UShort nn, valid_entries = 0;
static const FT_Frame_Field offset_table_fields[] =
{
diff --git a/thirdparty/freetype/src/sfnt/ttload.h b/thirdparty/freetype/src/sfnt/ttload.h
index 296da86ed3..f94be8b7bd 100644
--- a/thirdparty/freetype/src/sfnt/ttload.h
+++ b/thirdparty/freetype/src/sfnt/ttload.h
@@ -5,7 +5,7 @@
/* Load the basic TrueType tables, i.e., tables that can be either in */
/* TTF or OTF fonts (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttmtx.c b/thirdparty/freetype/src/sfnt/ttmtx.c
index 394c6db85c..6ddda95b56 100644
--- a/thirdparty/freetype/src/sfnt/ttmtx.c
+++ b/thirdparty/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (body). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttmtx.h b/thirdparty/freetype/src/sfnt/ttmtx.h
index 2b93ab2f0e..ab00acd795 100644
--- a/thirdparty/freetype/src/sfnt/ttmtx.h
+++ b/thirdparty/freetype/src/sfnt/ttmtx.h
@@ -4,7 +4,7 @@
/* */
/* Load the metrics tables common to TTF and OTF fonts (specification). */
/* */
-/* Copyright 2006-2017 by */
+/* Copyright 2006-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttpost.c b/thirdparty/freetype/src/sfnt/ttpost.c
index 69929c8d45..6de99ef977 100644
--- a/thirdparty/freetype/src/sfnt/ttpost.c
+++ b/thirdparty/freetype/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
/* PostScript name table processing for TrueType and OpenType fonts */
/* (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -473,8 +473,8 @@
/* idx :: The glyph index. */
/* */
/* <InOut> */
- /* PSname :: The address of a string pointer. Will be NULL in case */
- /* of error, otherwise it is a pointer to the glyph name. */
+ /* PSname :: The address of a string pointer. Undefined in case of */
+ /* error, otherwise it is a pointer to the glyph name. */
/* */
/* You must not modify the returned string! */
/* */
diff --git a/thirdparty/freetype/src/sfnt/ttpost.h b/thirdparty/freetype/src/sfnt/ttpost.h
index 722485e32d..3bec07e445 100644
--- a/thirdparty/freetype/src/sfnt/ttpost.h
+++ b/thirdparty/freetype/src/sfnt/ttpost.h
@@ -5,7 +5,7 @@
/* PostScript name table processing for TrueType and OpenType fonts */
/* (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/sfnt/ttsbit.c b/thirdparty/freetype/src/sfnt/ttsbit.c
index f41847b0af..33b8640bc3 100644
--- a/thirdparty/freetype/src/sfnt/ttsbit.c
+++ b/thirdparty/freetype/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (body). */
/* */
-/* Copyright 2005-2017 by */
+/* Copyright 2005-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* Copyright 2013 by Google, Inc. */
@@ -1007,8 +1007,9 @@
goto Fail;
}
- FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d components\n",
- num_components ));
+ FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d component%s\n",
+ num_components,
+ num_components == 1 ? "" : "s" ));
for ( nn = 0; nn < num_components; nn++ )
{
@@ -1513,7 +1514,7 @@
FT_FRAME_EXIT();
if ( glyph_start == glyph_end )
- return FT_THROW( Invalid_Argument );
+ return FT_THROW( Missing_Bitmap );
if ( glyph_start > glyph_end ||
glyph_end - glyph_start < 8 ||
face->ebdt_size - strike_offset < glyph_end )
diff --git a/thirdparty/freetype/src/sfnt/ttsbit.h b/thirdparty/freetype/src/sfnt/ttsbit.h
index e859ddda45..ce2af3c162 100644
--- a/thirdparty/freetype/src/sfnt/ttsbit.h
+++ b/thirdparty/freetype/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftgrays.c b/thirdparty/freetype/src/smooth/ftgrays.c
index df645e66c9..803a19e415 100644
--- a/thirdparty/freetype/src/smooth/ftgrays.c
+++ b/thirdparty/freetype/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
/* */
/* A new `perfect' anti-aliasing renderer (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -370,7 +370,7 @@ typedef ptrdiff_t FT_PtrDist;
/* optimize a division and modulo operation on the same parameters */
/* into a single call to `__aeabi_idivmod'. See */
/* */
- /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 */
+ /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 */
#undef FT_DIV_MOD
#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \
FT_BEGIN_STMNT \
@@ -404,7 +404,7 @@ typedef ptrdiff_t FT_PtrDist;
/* need to define them to "float" or "double" when experimenting with */
/* new algorithms */
- typedef long TPos; /* sub-pixel coordinate */
+ typedef long TPos; /* subpixel coordinate */
typedef int TCoord; /* integer scanline/pixel coordinate */
typedef int TArea; /* cell areas, coordinate products */
@@ -582,8 +582,8 @@ typedef ptrdiff_t FT_PtrDist;
if ( ex < ras.min_ex )
ex = ras.min_ex - 1;
- /* record the current one if it is valid */
- if ( !ras.invalid )
+ /* record the current one if it is valid and substantial */
+ if ( !ras.invalid && ( ras.area || ras.cover ) )
gray_record_cell( RAS_VAR );
ras.area = 0;
@@ -1300,8 +1300,6 @@ typedef ptrdiff_t FT_PtrDist;
int y;
- FT_TRACE7(( "gray_sweep: start\n" ));
-
for ( y = ras.min_ey; y < ras.max_ey; y++ )
{
PCell cell = ras.ycells[y - ras.min_ey];
@@ -1327,8 +1325,6 @@ typedef ptrdiff_t FT_PtrDist;
if ( cover != 0 )
gray_hline( RAS_VAR_ x, y, cover, ras.max_ex - x );
}
-
- FT_TRACE7(( "gray_sweep: end\n" ));
}
@@ -1722,8 +1718,11 @@ typedef ptrdiff_t FT_PtrDist;
if ( !ras.invalid )
gray_record_cell( RAS_VAR );
- FT_TRACE7(( "band [%d..%d]: %d cells\n",
- ras.min_ey, ras.max_ey, ras.num_cells ));
+ FT_TRACE7(( "band [%d..%d]: %d cell%s\n",
+ ras.min_ey,
+ ras.max_ey,
+ ras.num_cells,
+ ras.num_cells == 1 ? "" : "s" ));
}
else
{
@@ -1740,35 +1739,43 @@ typedef ptrdiff_t FT_PtrDist;
static int
gray_convert_glyph( RAS_ARG )
{
+ const TCoord yMin = ras.min_ey;
+ const TCoord yMax = ras.max_ey;
+ const TCoord xMin = ras.min_ex;
+ const TCoord xMax = ras.max_ex;
+
TCell buffer[FT_MAX_GRAY_POOL];
- TCoord band_size = FT_MAX_GRAY_POOL / 8;
- TCoord count = ras.max_ey - ras.min_ey;
- int num_bands;
- TCoord min, max, max_y;
+ size_t height = (size_t)( yMax - yMin );
+ size_t n = FT_MAX_GRAY_POOL / 8;
+ TCoord y;
TCoord bands[32]; /* enough to accommodate bisections */
TCoord* band;
/* set up vertical bands */
- if ( count > band_size )
+ if ( height > n )
{
/* two divisions rounded up */
- num_bands = (int)( ( count + band_size - 1) / band_size );
- band_size = ( count + num_bands - 1 ) / num_bands;
+ n = ( height + n - 1 ) / n;
+ height = ( height + n - 1 ) / n;
}
- min = ras.min_ey;
- max_y = ras.max_ey;
+ /* memory management */
+ n = ( height * sizeof ( PCell ) + sizeof ( TCell ) - 1 ) / sizeof ( TCell );
- for ( ; min < max_y; min = max )
+ ras.cells = buffer + n;
+ ras.max_cells = (FT_PtrDist)( FT_MAX_GRAY_POOL - n );
+ ras.ycells = (PCell*)buffer;
+
+ for ( y = yMin; y < yMax; )
{
- max = min + band_size;
- if ( max > max_y )
- max = max_y;
+ ras.min_ey = y;
+ y += height;
+ ras.max_ey = FT_MIN( y, yMax );
band = bands;
- band[1] = min;
- band[0] = max;
+ band[1] = xMin;
+ band[0] = xMax;
do
{
@@ -1776,27 +1783,12 @@ typedef ptrdiff_t FT_PtrDist;
int error;
- /* memory management */
- {
- size_t ycount = (size_t)width;
- size_t cell_start;
-
-
- cell_start = ( ycount * sizeof ( PCell ) + sizeof ( TCell ) - 1 ) /
- sizeof ( TCell );
-
- ras.cells = buffer + cell_start;
- ras.max_cells = (FT_PtrDist)( FT_MAX_GRAY_POOL - cell_start );
- ras.num_cells = 0;
-
- ras.ycells = (PCell*)buffer;
- while ( ycount )
- ras.ycells[--ycount] = NULL;
- }
+ FT_MEM_ZERO( ras.ycells, height * sizeof ( PCell ) );
+ ras.num_cells = 0;
ras.invalid = 1;
- ras.min_ey = band[1];
- ras.max_ey = band[0];
+ ras.min_ex = band[1];
+ ras.max_ex = band[0];
error = gray_convert_glyph_inner( RAS_VAR );
@@ -1812,8 +1804,7 @@ typedef ptrdiff_t FT_PtrDist;
/* render pool overflow; we will reduce the render band by half */
width >>= 1;
- /* This is too complex for a single scanline; there must */
- /* be some problems. */
+ /* this should never happen even with tiny rendering pool */
if ( width == 0 )
{
FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" ));
diff --git a/thirdparty/freetype/src/smooth/ftgrays.h b/thirdparty/freetype/src/smooth/ftgrays.h
index a5447da1a9..9e11ca675e 100644
--- a/thirdparty/freetype/src/smooth/ftgrays.h
+++ b/thirdparty/freetype/src/smooth/ftgrays.h
@@ -4,7 +4,7 @@
/* */
/* FreeType smooth renderer declaration */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftsmerrs.h b/thirdparty/freetype/src/smooth/ftsmerrs.h
index a528c61832..226dc1b001 100644
--- a/thirdparty/freetype/src/smooth/ftsmerrs.h
+++ b/thirdparty/freetype/src/smooth/ftsmerrs.h
@@ -4,7 +4,7 @@
/* */
/* smooth renderer error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftsmooth.c b/thirdparty/freetype/src/smooth/ftsmooth.c
index 963435de15..ef176bdf1e 100644
--- a/thirdparty/freetype/src/smooth/ftsmooth.c
+++ b/thirdparty/freetype/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2017 by */
+/* Copyright 2000-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -97,74 +97,17 @@
const FT_Vector* origin,
FT_Render_Mode required_mode )
{
- FT_Error error;
+ FT_Error error = FT_Err_Ok;
FT_Outline* outline = &slot->outline;
FT_Bitmap* bitmap = &slot->bitmap;
FT_Memory memory = render->root.memory;
- FT_BBox cbox;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
- FT_Pos x_left, y_top;
- FT_Pos width, height, pitch;
FT_Int hmul = ( mode == FT_RENDER_MODE_LCD );
FT_Int vmul = ( mode == FT_RENDER_MODE_LCD_V );
FT_Raster_Params params;
- FT_Bool have_outline_shifted = FALSE;
- FT_Bool have_buffer = FALSE;
-
-#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
- FT_LcdFiveTapFilter lcd_weights = { 0 };
- FT_Bool have_custom_weight = FALSE;
- FT_Bitmap_LcdFilterFunc lcd_filter_func = NULL;
-
-
- if ( slot->face )
- {
- FT_Char i;
-
-
- for ( i = 0; i < FT_LCD_FILTER_FIVE_TAPS; i++ )
- if ( slot->face->internal->lcd_weights[i] != 0 )
- {
- have_custom_weight = TRUE;
- break;
- }
- }
-
- /*
- * The LCD filter can be set library-wide and per-face. Face overrides
- * library. If the face filter weights are all zero (the default), it
- * means that the library default should be used.
- */
- if ( have_custom_weight )
- {
- /*
- * A per-font filter is set. It always uses the default 5-tap
- * in-place FIR filter.
- */
- ft_memcpy( lcd_weights,
- slot->face->internal->lcd_weights,
- FT_LCD_FILTER_FIVE_TAPS );
- lcd_filter_func = ft_lcd_filter_fir;
- }
- else
- {
- /*
- * The face's lcd_weights is {0, 0, 0, 0, 0}, meaning `use library
- * default'. If the library is set to use no LCD filtering
- * (lcd_filter_func == NULL), `lcd_filter_func' here is also set to
- * NULL and the tests further below pass over the filtering process.
- */
- ft_memcpy( lcd_weights,
- slot->library->lcd_weights,
- FT_LCD_FILTER_FIVE_TAPS );
- lcd_filter_func = slot->library->lcd_filter_func;
- }
-
-#endif /*FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
/* check glyph image format */
if ( slot->format != render->glyph_format )
@@ -180,100 +123,6 @@
goto Exit;
}
- if ( origin )
- {
- x_shift = origin->x;
- y_shift = origin->y;
- }
-
- /* compute the control box, and grid fit it */
- /* taking into account the origin shift */
- FT_Outline_Get_CBox( outline, &cbox );
-
-#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
- /* add minimal padding for LCD rendering */
- if ( hmul )
- {
- cbox.xMax += 21;
- cbox.xMin -= 21;
- }
-
- if ( vmul )
- {
- cbox.yMax += 21;
- cbox.yMin -= 21;
- }
-
-#else /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
- /* add minimal padding for LCD filter depending on specific weights */
- if ( lcd_filter_func )
- {
- if ( hmul )
- {
- cbox.xMax += lcd_weights[4] ? 43
- : lcd_weights[3] ? 22 : 0;
- cbox.xMin -= lcd_weights[0] ? 43
- : lcd_weights[1] ? 22 : 0;
- }
-
- if ( vmul )
- {
- cbox.yMax += lcd_weights[4] ? 43
- : lcd_weights[3] ? 22 : 0;
- cbox.yMin -= lcd_weights[0] ? 43
- : lcd_weights[1] ? 22 : 0;
- }
- }
-
-#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-
- cbox.xMin = FT_PIX_FLOOR( cbox.xMin + x_shift );
- cbox.yMin = FT_PIX_FLOOR( cbox.yMin + y_shift );
- cbox.xMax = FT_PIX_CEIL( cbox.xMax + x_shift );
- cbox.yMax = FT_PIX_CEIL( cbox.yMax + y_shift );
-
- x_shift -= cbox.xMin;
- y_shift -= cbox.yMin;
-
- x_left = cbox.xMin >> 6;
- y_top = cbox.yMax >> 6;
-
- width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;
- height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;
-
- pitch = width;
- if ( hmul )
- {
- width *= 3;
- pitch = FT_PAD_CEIL( width, 4 );
- }
-
- if ( vmul )
- height *= 3;
-
- /*
- * XXX: on 16bit system, we return an error for huge bitmap
- * to prevent an overflow.
- */
- if ( x_left > FT_INT_MAX || y_top > FT_INT_MAX ||
- x_left < FT_INT_MIN || y_top < FT_INT_MIN )
- {
- error = FT_THROW( Invalid_Pixel_Size );
- goto Exit;
- }
-
- /* Required check is (pitch * height < FT_ULONG_MAX), */
- /* but we care realistic cases only. Always pitch <= width. */
- if ( width > 0x7FFF || height > 0x7FFF )
- {
- FT_ERROR(( "ft_smooth_render_generic: glyph too large: %u x %u\n",
- width, height ));
- error = FT_THROW( Raster_Overflow );
- goto Exit;
- }
-
/* release old bitmap buffer */
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
@@ -281,30 +130,30 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
+ ft_glyphslot_preset_bitmap( slot, mode, origin );
+
/* allocate new one */
- if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
+ if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
goto Exit;
- else
- have_buffer = TRUE;
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
- slot->format = FT_GLYPH_FORMAT_BITMAP;
- slot->bitmap_left = (FT_Int)x_left;
- slot->bitmap_top = (FT_Int)y_top;
+ x_shift = 64 * -slot->bitmap_left;
+ y_shift = 64 * -slot->bitmap_top;
+ if ( bitmap->pixel_mode == FT_PIXEL_MODE_LCD_V )
+ y_shift += 64 * (FT_Int)bitmap->rows / 3;
+ else
+ y_shift += 64 * (FT_Int)bitmap->rows;
- bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
- bitmap->num_grays = 256;
- bitmap->width = (unsigned int)width;
- bitmap->rows = (unsigned int)height;
- bitmap->pitch = pitch;
+ if ( origin )
+ {
+ x_shift += origin->x;
+ y_shift += origin->y;
+ }
/* translate outline to render it into the bitmap */
if ( x_shift || y_shift )
- {
FT_Outline_Translate( outline, x_shift, y_shift );
- have_outline_shifted = TRUE;
- }
/* set up parameters */
params.target = bitmap;
@@ -351,45 +200,68 @@
if ( error )
goto Exit;
- if ( lcd_filter_func )
- lcd_filter_func( bitmap, mode, lcd_weights );
+ /* finally apply filtering */
+ if ( hmul || vmul )
+ {
+ FT_Byte* lcd_weights;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func;
+
+
+ /* Per-face LCD filtering takes priority if set up. */
+ if ( slot->face && slot->face->internal->lcd_filter_func )
+ {
+ lcd_weights = slot->face->internal->lcd_weights;
+ lcd_filter_func = slot->face->internal->lcd_filter_func;
+ }
+ else
+ {
+ lcd_weights = slot->library->lcd_weights;
+ lcd_filter_func = slot->library->lcd_filter_func;
+ }
+
+ if ( lcd_filter_func )
+ lcd_filter_func( bitmap, mode, lcd_weights );
+ }
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
if ( hmul ) /* lcd */
{
FT_Byte* line;
- FT_Byte* temp;
- FT_Int i, j;
+ FT_Byte* temp = NULL;
+ FT_UInt i, j;
+
+ unsigned int height = bitmap->rows;
+ unsigned int width = bitmap->width;
+ int pitch = bitmap->pitch;
/* Render 3 separate monochrome bitmaps, shifting the outline */
/* by 1/3 pixel. */
width /= 3;
- FT_Outline_Translate( outline, 21, 0 );
+ bitmap->buffer += width;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
FT_Outline_Translate( outline, -21, 0 );
+ x_shift -= 21;
bitmap->buffer += width;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, -21, 0 );
- bitmap->buffer += width;
+ FT_Outline_Translate( outline, 42, 0 );
+ x_shift += 42;
+ bitmap->buffer -= 2 * width;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 21, 0 );
- bitmap->buffer -= 2 * width;
-
/* XXX: Rearrange the bytes according to FT_PIXEL_MODE_LCD. */
/* XXX: It is more efficient to render every third byte above. */
@@ -398,7 +270,7 @@
for ( i = 0; i < height; i++ )
{
- line = bitmap->buffer + i * pitch;
+ line = bitmap->buffer + i * (FT_ULong)pitch;
for ( j = 0; j < width; j++ )
{
temp[3 * j ] = line[j];
@@ -412,60 +284,59 @@
}
else if ( vmul ) /* lcd_v */
{
+ int pitch = bitmap->pitch;
+
+
/* Render 3 separate monochrome bitmaps, shifting the outline */
/* by 1/3 pixel. Triple the pitch to render on each third row. */
bitmap->pitch *= 3;
bitmap->rows /= 3;
- FT_Outline_Translate( outline, 0, 21 );
- bitmap->buffer += 2 * pitch;
+ bitmap->buffer += pitch;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 0, -21 );
- bitmap->buffer -= pitch;
+ FT_Outline_Translate( outline, 0, 21 );
+ y_shift += 21;
+ bitmap->buffer += pitch;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 0, -21 );
- bitmap->buffer -= pitch;
+ FT_Outline_Translate( outline, 0, -42 );
+ y_shift -= 42;
+ bitmap->buffer -= 2 * pitch;
error = render->raster_render( render->raster, &params );
if ( error )
goto Exit;
- FT_Outline_Translate( outline, 0, 21 );
-
bitmap->pitch /= 3;
bitmap->rows *= 3;
}
else /* grayscale */
- {
error = render->raster_render( render->raster, &params );
- if ( error )
- goto Exit;
- }
#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
- /* everything is fine; don't deallocate buffer */
- have_buffer = FALSE;
-
- error = FT_Err_Ok;
-
Exit:
- if ( have_outline_shifted )
- FT_Outline_Translate( outline, -x_shift, -y_shift );
- if ( have_buffer )
+ if ( !error )
+ {
+ /* everything is fine; the glyph is now officially a bitmap */
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
+ }
+ else if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_FREE( bitmap->buffer );
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
+ if ( x_shift || y_shift )
+ FT_Outline_Translate( outline, -x_shift, -y_shift );
+
return error;
}
@@ -492,14 +363,8 @@
FT_Render_Mode mode,
const FT_Vector* origin )
{
- FT_Error error;
-
- error = ft_smooth_render_generic( render, slot, mode, origin,
- FT_RENDER_MODE_LCD );
- if ( !error )
- slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD;
-
- return error;
+ return ft_smooth_render_generic( render, slot, mode, origin,
+ FT_RENDER_MODE_LCD );
}
@@ -510,14 +375,8 @@
FT_Render_Mode mode,
const FT_Vector* origin )
{
- FT_Error error;
-
- error = ft_smooth_render_generic( render, slot, mode, origin,
- FT_RENDER_MODE_LCD_V );
- if ( !error )
- slot->bitmap.pixel_mode = FT_PIXEL_MODE_LCD_V;
-
- return error;
+ return ft_smooth_render_generic( render, slot, mode, origin,
+ FT_RENDER_MODE_LCD_V );
}
diff --git a/thirdparty/freetype/src/smooth/ftsmooth.h b/thirdparty/freetype/src/smooth/ftsmooth.h
index 6dfd65726c..c76ffc5034 100644
--- a/thirdparty/freetype/src/smooth/ftsmooth.h
+++ b/thirdparty/freetype/src/smooth/ftsmooth.h
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftspic.c b/thirdparty/freetype/src/smooth/ftspic.c
index fb89be3488..10f04cf4cc 100644
--- a/thirdparty/freetype/src/smooth/ftspic.c
+++ b/thirdparty/freetype/src/smooth/ftspic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/ftspic.h b/thirdparty/freetype/src/smooth/ftspic.h
index 9ddd1c7905..80fb64cff4 100644
--- a/thirdparty/freetype/src/smooth/ftspic.h
+++ b/thirdparty/freetype/src/smooth/ftspic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for smooth module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/smooth/module.mk b/thirdparty/freetype/src/smooth/module.mk
index 804e9b1386..5b8bc3be3b 100644
--- a/thirdparty/freetype/src/smooth/module.mk
+++ b/thirdparty/freetype/src/smooth/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/smooth/rules.mk b/thirdparty/freetype/src/smooth/rules.mk
index dfdc9bc30f..f30824a367 100644
--- a/thirdparty/freetype/src/smooth/rules.mk
+++ b/thirdparty/freetype/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/smooth/smooth.c b/thirdparty/freetype/src/smooth/smooth.c
index e0460d9d46..5249a8931e 100644
--- a/thirdparty/freetype/src/smooth/smooth.c
+++ b/thirdparty/freetype/src/smooth/smooth.c
@@ -4,7 +4,7 @@
/* */
/* FreeType anti-aliasing rasterer module component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/module.mk b/thirdparty/freetype/src/truetype/module.mk
index 563c584e2b..16bc9c8b20 100644
--- a/thirdparty/freetype/src/truetype/module.mk
+++ b/thirdparty/freetype/src/truetype/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/truetype/rules.mk b/thirdparty/freetype/src/truetype/rules.mk
index ad3d007455..e16113f128 100644
--- a/thirdparty/freetype/src/truetype/rules.mk
+++ b/thirdparty/freetype/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/truetype/truetype.c b/thirdparty/freetype/src/truetype/truetype.c
index 301b82ad1c..484370975c 100644
--- a/thirdparty/freetype/src/truetype/truetype.c
+++ b/thirdparty/freetype/src/truetype/truetype.c
@@ -4,7 +4,7 @@
/* */
/* FreeType TrueType driver component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttdriver.c b/thirdparty/freetype/src/truetype/ttdriver.c
index a1653b241c..820cafbb8d 100644
--- a/thirdparty/freetype/src/truetype/ttdriver.c
+++ b/thirdparty/freetype/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
/* */
/* TrueType font driver implementation (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -31,7 +31,7 @@
#include FT_SERVICE_TRUETYPE_ENGINE_H
#include FT_SERVICE_TRUETYPE_GLYF_H
#include FT_SERVICE_PROPERTIES_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include "ttdriver.h"
#include "ttgload.h"
@@ -233,8 +233,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without VVAR table */
- if ( !face->is_default_instance &&
- !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -253,8 +253,8 @@
{
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
/* no fast retrieval for blended MM fonts without HVAR table */
- if ( !face->is_default_instance &&
- !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ if ( ( FT_IS_NAMED_INSTANCE( ttface ) || FT_IS_VARIATION( ttface ) ) &&
+ !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
return FT_THROW( Unimplemented_Feature );
#endif
@@ -498,6 +498,7 @@
(FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
(FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
(FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */
+ (FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
(FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
(FT_Done_Blend_Func) tt_done_blend /* done_blend */
diff --git a/thirdparty/freetype/src/truetype/ttdriver.h b/thirdparty/freetype/src/truetype/ttdriver.h
index 3bcba7f745..707aa68edf 100644
--- a/thirdparty/freetype/src/truetype/ttdriver.h
+++ b/thirdparty/freetype/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
/* */
/* High-level TrueType driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/tterrors.h b/thirdparty/freetype/src/truetype/tterrors.h
index a49f205156..88bca3a04a 100644
--- a/thirdparty/freetype/src/truetype/tterrors.h
+++ b/thirdparty/freetype/src/truetype/tterrors.h
@@ -4,7 +4,7 @@
/* */
/* TrueType error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttgload.c b/thirdparty/freetype/src/truetype/ttgload.c
index 5e102c6151..39d9c3f736 100644
--- a/thirdparty/freetype/src/truetype/ttgload.c
+++ b/thirdparty/freetype/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,7 +24,7 @@
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_TAGS_H
#include FT_OUTLINE_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include FT_LIST_H
#include "ttgload.h"
@@ -664,7 +664,52 @@
} while ( subglyph->flags & MORE_COMPONENTS );
gloader->current.num_subglyphs = num_subglyphs;
- FT_TRACE5(( " %d components\n", num_subglyphs ));
+ FT_TRACE5(( " %d component%s\n",
+ num_subglyphs,
+ num_subglyphs > 1 ? "s" : "" ));
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ FT_UInt i;
+
+
+ subglyph = gloader->current.subglyphs;
+
+ for ( i = 0; i < num_subglyphs; i++ )
+ {
+ if ( num_subglyphs > 1 )
+ FT_TRACE7(( " subglyph %d:\n", i ));
+
+ FT_TRACE7(( " glyph index: %d\n", subglyph->index ));
+
+ if ( subglyph->flags & ARGS_ARE_XY_VALUES )
+ FT_TRACE7(( " offset: x=%d, y=%d\n",
+ subglyph->arg1,
+ subglyph->arg2 ));
+ else
+ FT_TRACE7(( " matching points: base=%d, component=%d\n",
+ subglyph->arg1,
+ subglyph->arg2 ));
+
+ if ( subglyph->flags & WE_HAVE_A_SCALE )
+ FT_TRACE7(( " scaling: %f\n",
+ subglyph->transform.xx / 65536.0 ));
+ else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE )
+ FT_TRACE7(( " scaling: x=%f, y=%f\n",
+ subglyph->transform.xx / 65536.0,
+ subglyph->transform.yy / 65536.0 ));
+ else if ( subglyph->flags & WE_HAVE_A_2X2 )
+ FT_TRACE7(( " scaling: xx=%f, yx=%f\n"
+ " xy=%f, yy=%f\n",
+ subglyph->transform.xx / 65536.0,
+ subglyph->transform.yx / 65536.0,
+ subglyph->transform.xy / 65536.0,
+ subglyph->transform.yy / 65536.0 ));
+
+ subglyph++;
+ }
+ }
+#endif /* FT_DEBUG_LEVEL_TRACE */
#ifdef TT_USE_BYTECODE_INTERPRETER
@@ -756,7 +801,7 @@
{
FT_TRACE1(( "TT_Hint_Glyph: too long instructions" ));
FT_TRACE1(( " (0x%lx byte) is truncated\n",
- loader->glyph->control_len ));
+ loader->glyph->control_len ));
}
n_ins = loader->glyph->control_len;
@@ -889,7 +934,8 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( !loader->face->is_default_instance )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( loader->face ) ) ||
+ FT_IS_VARIATION( FT_FACE( loader->face ) ) )
{
/* Deltas apply to the unscaled data. */
error = TT_Vary_Apply_Glyph_Deltas( loader->face,
@@ -991,9 +1037,24 @@
vec->x = FT_MulFix( vec->x, x_scale );
vec->y = FT_MulFix( vec->y, y_scale );
}
+ }
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* if we have a HVAR table, `pp1' and/or `pp2' are already adjusted */
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ||
+ !IS_HINTED( loader->load_flags ) )
+#endif
+ {
loader->pp1 = outline->points[n_points - 4];
loader->pp2 = outline->points[n_points - 3];
+ }
+
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ /* if we have a VVAR table, `pp3' and/or `pp4' are already adjusted */
+ if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ||
+ !IS_HINTED( loader->load_flags ) )
+#endif
+ {
loader->pp3 = outline->points[n_points - 2];
loader->pp4 = outline->points[n_points - 1];
}
@@ -1145,8 +1206,28 @@
if ( subglyph->flags & ROUND_XY_TO_GRID )
{
- x = FT_PIX_ROUND( x );
- y = FT_PIX_ROUND( y );
+ TT_Face face = loader->face;
+ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
+
+
+ if ( IS_HINTED( loader->load_flags ) )
+ {
+ /*
+ * We round the horizontal offset only if there is hinting along
+ * the x axis; this corresponds to integer advance width values.
+ *
+ * Theoretically, a glyph's bytecode can toggle ClearType's
+ * `backward compatibility' mode, which would allow modification
+ * of the advance width. In reality, however, applications
+ * neither allow nor expect modified advance widths if subpixel
+ * rendering is active.
+ *
+ */
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_35 )
+ x = FT_PIX_ROUND( x );
+
+ y = FT_PIX_ROUND( y );
+ }
}
}
}
@@ -1359,6 +1440,7 @@
TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face );
#endif
+
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
{
@@ -1577,7 +1659,8 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( !loader->face->is_default_instance )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ||
+ FT_IS_VARIATION( FT_FACE( face ) ) )
{
/* a small outline structure with four elements for */
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
@@ -1711,7 +1794,7 @@
/* clear the nodes filled by sibling chains */
node = ft_list_get_node_at( &loader->composites, recurse_count );
for ( node2 = node; node2; node2 = node2->next )
- node2->data = (void*)ULONG_MAX;
+ node2->data = (void*)FT_ULONG_MAX;
/* check whether we already have a composite glyph with this index */
if ( FT_List_Find( &loader->composites,
@@ -1751,7 +1834,8 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( !face->is_default_instance )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ||
+ FT_IS_VARIATION( FT_FACE( face ) ) )
{
short i, limit;
FT_SubGlyph subglyph;
@@ -2609,7 +2693,8 @@
TT_LoaderRec loader;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
-#define IS_DEFAULT_INSTANCE ( ( (TT_Face)glyph->face )->is_default_instance )
+#define IS_DEFAULT_INSTANCE ( !( FT_IS_NAMED_INSTANCE( glyph->face ) || \
+ FT_IS_VARIATION( glyph->face ) ) )
#else
#define IS_DEFAULT_INSTANCE 1
#endif
@@ -2624,6 +2709,10 @@
( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
IS_DEFAULT_INSTANCE )
{
+ FT_Fixed x_scale = size->root.metrics.x_scale;
+ FT_Fixed y_scale = size->root.metrics.y_scale;
+
+
error = load_sbit_image( size, glyph, glyph_index, load_flags );
if ( FT_ERR_EQ( error, Missing_Bitmap ) )
{
@@ -2631,9 +2720,13 @@
/* if we have a bitmap-only font, return an empty glyph */
if ( !FT_IS_SCALABLE( glyph->face ) )
{
- TT_Face face = (TT_Face)glyph->face;
- FT_Short left_bearing = 0, top_bearing = 0;
- FT_UShort advance_width = 0, advance_height = 0;
+ TT_Face face = (TT_Face)glyph->face;
+
+ FT_Short left_bearing = 0;
+ FT_Short top_bearing = 0;
+
+ FT_UShort advance_width = 0;
+ FT_UShort advance_height = 0;
/* to return an empty glyph, however, we need metrics data */
@@ -2659,13 +2752,13 @@
glyph->metrics.width = 0;
glyph->metrics.height = 0;
- glyph->metrics.horiBearingX = left_bearing;
+ glyph->metrics.horiBearingX = FT_MulFix( left_bearing, x_scale );
glyph->metrics.horiBearingY = 0;
- glyph->metrics.horiAdvance = advance_width;
+ glyph->metrics.horiAdvance = FT_MulFix( advance_width, x_scale );
glyph->metrics.vertBearingX = 0;
- glyph->metrics.vertBearingY = top_bearing;
- glyph->metrics.vertAdvance = advance_height;
+ glyph->metrics.vertBearingY = FT_MulFix( top_bearing, y_scale );
+ glyph->metrics.vertAdvance = FT_MulFix( advance_height, y_scale );
glyph->format = FT_GLYPH_FORMAT_BITMAP;
glyph->bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
@@ -2696,13 +2789,11 @@
/* sanity checks: if `xxxAdvance' in the sbit metric */
/* structure isn't set, use `linearXXXAdvance' */
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
- glyph->metrics.horiAdvance =
- FT_MulFix( glyph->linearHoriAdvance,
- size->metrics->x_scale );
+ glyph->metrics.horiAdvance = FT_MulFix( glyph->linearHoriAdvance,
+ x_scale );
if ( !glyph->metrics.vertAdvance && glyph->linearVertAdvance )
- glyph->metrics.vertAdvance =
- FT_MulFix( glyph->linearVertAdvance,
- size->metrics->y_scale );
+ glyph->metrics.vertAdvance = FT_MulFix( glyph->linearVertAdvance,
+ y_scale );
}
return FT_Err_Ok;
diff --git a/thirdparty/freetype/src/truetype/ttgload.h b/thirdparty/freetype/src/truetype/ttgload.h
index 1dd6c841db..d237cfd284 100644
--- a/thirdparty/freetype/src/truetype/ttgload.h
+++ b/thirdparty/freetype/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Glyph Loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttgxvar.c b/thirdparty/freetype/src/truetype/ttgxvar.c
index 49aa53a687..29ab2a4efd 100644
--- a/thirdparty/freetype/src/truetype/ttgxvar.c
+++ b/thirdparty/freetype/src/truetype/ttgxvar.c
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -1043,10 +1043,11 @@
outerIndex,
innerIndex );
- FT_TRACE5(( "%s value %d adjusted by %d units (%s)\n",
+ FT_TRACE5(( "%s value %d adjusted by %d unit%s (%s)\n",
vertical ? "vertical height" : "horizontal width",
*avalue,
delta,
+ delta == 1 ? "" : "s",
vertical ? "VVAR" : "HVAR" ));
*avalue += delta;
@@ -1333,13 +1334,15 @@
if ( p )
{
- FT_TRACE5(( "value %c%c%c%c (%d units) adjusted by %d units (MVAR)\n",
+ FT_TRACE5(( "value %c%c%c%c (%d unit%s) adjusted by %d unit%s (MVAR)\n",
(FT_Char)( value->tag >> 24 ),
(FT_Char)( value->tag >> 16 ),
(FT_Char)( value->tag >> 8 ),
(FT_Char)( value->tag ),
value->unmodified,
- delta ));
+ value->unmodified == 1 ? "" : "s",
+ delta,
+ delta == 1 ? "" : "s" ));
/* since we handle both signed and unsigned values as FT_Short, */
/* ensure proper overflow arithmetic */
@@ -1499,8 +1502,10 @@
blend->gv_glyphcnt = gvar_head.glyphCount;
offsetToData = gvar_start + gvar_head.offsetToData;
- FT_TRACE5(( "gvar: there are %d shared coordinates:\n",
- blend->tuplecount ));
+ FT_TRACE5(( "gvar: there %s %d shared coordinate%s:\n",
+ blend->tuplecount == 1 ? "is" : "are",
+ blend->tuplecount,
+ blend->tuplecount == 1 ? "" : "s" ));
if ( FT_NEW_ARRAY( blend->glyphoffsets, blend->gv_glyphcnt + 1 ) )
goto Exit;
@@ -1728,15 +1733,13 @@
/* based on the [min,def,max] values for the axis to be [-1,0,1]. */
/* Then, if there's an `avar' table, we renormalize this range. */
- FT_TRACE5(( "design coordinates:\n" ));
-
a = mmvar->axis;
for ( i = 0; i < num_coords; i++, a++ )
{
FT_Fixed coord = coords[i];
- FT_TRACE5(( " %.5f\n", coord / 65536.0 ));
+ FT_TRACE5(( " %d: %.5f\n", i, coord / 65536.0 ));
if ( coord > a->maximum || coord < a->minimum )
{
FT_TRACE1((
@@ -1746,17 +1749,17 @@
a->minimum / 65536.0,
a->maximum / 65536.0 ));
- if ( coord > a->maximum)
+ if ( coord > a->maximum )
coord = a->maximum;
else
coord = a->minimum;
}
if ( coord < a->def )
- normalized[i] = -FT_DivFix( coords[i] - a->def,
+ normalized[i] = -FT_DivFix( coord - a->def,
a->minimum - a->def );
else if ( coord > a->def )
- normalized[i] = FT_DivFix( coords[i] - a->def,
+ normalized[i] = FT_DivFix( coord - a->def,
a->maximum - a->def );
else
normalized[i] = 0;
@@ -1822,16 +1825,8 @@
nc = blend->num_axis;
}
- if ( face->doblend )
- {
- for ( i = 0; i < nc; i++ )
- design[i] = coords[i];
- }
- else
- {
- for ( i = 0; i < nc; i++ )
- design[i] = 0;
- }
+ for ( i = 0; i < nc; i++ )
+ design[i] = coords[i];
for ( ; i < num_coords; i++ )
design[i] = 0;
@@ -1940,11 +1935,11 @@
TT_Get_MM_Var( TT_Face face,
FT_MM_Var* *master )
{
- FT_Stream stream = face->root.stream;
- FT_Memory memory = face->root.memory;
+ FT_Stream stream = face->root.stream;
+ FT_Memory memory = face->root.memory;
FT_ULong table_len;
- FT_Error error = FT_Err_Ok;
- FT_ULong fvar_start;
+ FT_Error error = FT_Err_Ok;
+ FT_ULong fvar_start = 0;
FT_UInt i, j;
FT_MM_Var* mmvar = NULL;
FT_Fixed* next_coords;
@@ -1954,10 +1949,20 @@
FT_Fixed* c;
FT_Var_Named_Style* ns;
GX_FVar_Head fvar_head;
- FT_Bool usePsName;
+ FT_Bool usePsName = 0;
FT_UInt num_instances;
+ FT_UInt num_axes;
FT_UShort* axis_flags;
+ FT_Offset mmvar_size;
+ FT_Offset axis_flags_size;
+ FT_Offset axis_size;
+ FT_Offset namedstyle_size;
+ FT_Offset next_coords_size;
+ FT_Offset next_name_size;
+
+ FT_Bool need_init;
+
static const FT_Frame_Field fvar_fields[] =
{
@@ -1995,7 +2000,9 @@
/* read the font data and set up the internal representation */
/* if not already done */
- if ( !face->blend )
+ need_init = !face->blend;
+
+ if ( need_init )
{
FT_TRACE2(( "FVAR " ));
@@ -2032,26 +2039,57 @@
FT_TRACE2(( "loaded\n" ));
- FT_TRACE5(( "number of GX style axes: %d\n", fvar_head.axisCount ));
+ FT_TRACE5(( "%d variation ax%s\n",
+ fvar_head.axisCount,
+ fvar_head.axisCount == 1 ? "is" : "es" ));
if ( FT_NEW( face->blend ) )
goto Exit;
- /* `num_instances' holds the number of all named instances, */
- /* including the default instance which might be missing */
- /* in fvar's table of named instances */
- num_instances = face->root.style_flags >> 16;
-
- /* prepare storage area for MM data; this cannot overflow */
- /* 32-bit arithmetic because of the size limits used in the */
- /* `fvar' table validity check in `sfnt_init_face' */
- face->blend->mmvar_len =
- sizeof ( FT_MM_Var ) +
- fvar_head.axisCount * sizeof ( FT_UShort ) +
- fvar_head.axisCount * sizeof ( FT_Var_Axis ) +
- num_instances * sizeof ( FT_Var_Named_Style ) +
- num_instances * fvar_head.axisCount * sizeof ( FT_Fixed ) +
- fvar_head.axisCount * 5;
+ num_axes = fvar_head.axisCount;
+ face->blend->num_axis = num_axes;
+ }
+ else
+ num_axes = face->blend->num_axis;
+
+ /* `num_instances' holds the number of all named instances, */
+ /* including the default instance which might be missing */
+ /* in fvar's table of named instances */
+ num_instances = (FT_UInt)face->root.style_flags >> 16;
+
+ /* prepare storage area for MM data; this cannot overflow */
+ /* 32-bit arithmetic because of the size limits used in the */
+ /* `fvar' table validity check in `sfnt_init_face' */
+
+ /* the various `*_size' variables, which we also use as */
+ /* offsets into the `mmlen' array, must be multiples of the */
+ /* pointer size (except the last one); without such an */
+ /* alignment there might be runtime errors due to */
+ /* misaligned addresses */
+#undef ALIGN_SIZE
+#define ALIGN_SIZE( n ) \
+ ( ( (n) + sizeof (void*) - 1 ) & ~( sizeof (void*) - 1 ) )
+
+ mmvar_size = ALIGN_SIZE( sizeof ( FT_MM_Var ) );
+ axis_flags_size = ALIGN_SIZE( num_axes *
+ sizeof ( FT_UShort ) );
+ axis_size = ALIGN_SIZE( num_axes *
+ sizeof ( FT_Var_Axis ) );
+ namedstyle_size = ALIGN_SIZE( num_instances *
+ sizeof ( FT_Var_Named_Style ) );
+ next_coords_size = ALIGN_SIZE( num_instances *
+ num_axes *
+ sizeof ( FT_Fixed ) );
+ next_name_size = num_axes * 5;
+
+ if ( need_init )
+ {
+ face->blend->mmvar_len = mmvar_size +
+ axis_flags_size +
+ axis_size +
+ namedstyle_size +
+ next_coords_size +
+ next_name_size;
if ( FT_ALLOC( mmvar, face->blend->mmvar_len ) )
goto Exit;
@@ -2061,7 +2099,7 @@
/* the data gets filled in later on */
mmvar->num_axis =
- fvar_head.axisCount;
+ num_axes;
mmvar->num_designs =
~0U; /* meaningless in this context; each glyph */
/* may have a different number of designs */
@@ -2071,22 +2109,23 @@
/* alas, no public field in `FT_Var_Axis' for axis flags */
axis_flags =
- (FT_UShort*)&( mmvar[1] );
+ (FT_UShort*)( (char*)mmvar + mmvar_size );
mmvar->axis =
- (FT_Var_Axis*)&( axis_flags[fvar_head.axisCount] );
+ (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size );
mmvar->namedstyle =
- (FT_Var_Named_Style*)&( mmvar->axis[fvar_head.axisCount] );
+ (FT_Var_Named_Style*)( (char*)mmvar->axis + axis_size );
- next_coords =
- (FT_Fixed*)&( mmvar->namedstyle[num_instances] );
+ next_coords = (FT_Fixed*)( (char*)mmvar->namedstyle +
+ namedstyle_size );
for ( i = 0; i < num_instances; i++ )
{
mmvar->namedstyle[i].coords = next_coords;
- next_coords += fvar_head.axisCount;
+ next_coords += num_axes;
}
- next_name = (FT_String*)next_coords;
- for ( i = 0; i < fvar_head.axisCount; i++ )
+ next_name = (FT_String*)( (char*)mmvar->namedstyle +
+ namedstyle_size + next_coords_size );
+ for ( i = 0; i < num_axes; i++ )
{
mmvar->axis[i].name = next_name;
next_name += 5;
@@ -2098,10 +2137,14 @@
goto Exit;
a = mmvar->axis;
- for ( i = 0; i < fvar_head.axisCount; i++ )
+ for ( i = 0; i < num_axes; i++ )
{
GX_FVar_Axis axis_rec;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ int invalid = 0;
+#endif
+
if ( FT_STREAM_READ_FIELDS( fvaraxis_fields, &axis_rec ) )
goto Exit;
@@ -2122,22 +2165,31 @@
if ( a->minimum > a->def ||
a->def > a->maximum )
{
- FT_TRACE2(( "TT_Get_MM_Var:"
- " invalid \"%s\" axis record; disabling\n",
- a->name ));
-
a->minimum = a->def;
a->maximum = a->def;
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+ invalid = 1;
+#endif
}
- FT_TRACE5(( " \"%s\":"
- " minimum=%.5f, default=%.5f, maximum=%.5f,"
- " flags=0x%04X\n",
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( i == 0 )
+ FT_TRACE5(( " idx tag "
+ /* " XXX `XXXX'" */
+ " minimum default maximum flags\n" ));
+ /* " XXXX.XXXXX XXXX.XXXXX XXXX.XXXXX 0xXXXX" */
+
+ FT_TRACE5(( " %3d `%s'"
+ " %10.5f %10.5f %10.5f 0x%04X%s\n",
+ i,
a->name,
a->minimum / 65536.0,
a->def / 65536.0,
a->maximum / 65536.0,
- *axis_flags ));
+ *axis_flags,
+ invalid ? " (invalid, disabled)" : "" ));
+#endif
a++;
axis_flags++;
@@ -2148,7 +2200,7 @@
/* named instance coordinates are stored as design coordinates; */
/* we have to convert them to normalized coordinates also */
if ( FT_NEW_ARRAY( face->blend->normalized_stylecoords,
- fvar_head.axisCount * num_instances ) )
+ num_axes * num_instances ) )
goto Exit;
if ( fvar_head.instanceCount && !face->blend->avar_loaded )
@@ -2162,20 +2214,24 @@
goto Exit;
}
+ FT_TRACE5(( "%d instance%s\n",
+ fvar_head.instanceCount,
+ fvar_head.instanceCount == 1 ? "" : "s" ));
+
ns = mmvar->namedstyle;
nsc = face->blend->normalized_stylecoords;
for ( i = 0; i < fvar_head.instanceCount; i++, ns++ )
{
/* PostScript names add 2 bytes to the instance record size */
if ( FT_FRAME_ENTER( ( usePsName ? 6L : 4L ) +
- 4L * fvar_head.axisCount ) )
+ 4L * num_axes ) )
goto Exit;
ns->strid = FT_GET_USHORT();
(void) /* flags = */ FT_GET_USHORT();
c = ns->coords;
- for ( j = 0; j < fvar_head.axisCount; j++, c++ )
+ for ( j = 0; j < num_axes; j++, c++ )
*c = FT_GET_LONG();
/* valid psid values are 6, [256;32767], and 0xFFFF */
@@ -2184,11 +2240,54 @@
else
ns->psid = 0xFFFF;
- ft_var_to_normalized( face,
- fvar_head.axisCount,
- ns->coords,
- nsc );
- nsc += fvar_head.axisCount;
+#ifdef FT_DEBUG_LEVEL_TRACE
+ {
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+
+ FT_String* strname = NULL;
+ FT_String* psname = NULL;
+
+ FT_ULong pos;
+
+
+ pos = FT_STREAM_POS();
+
+ if ( ns->strid != 0xFFFF )
+ {
+ (void)sfnt->get_name( face,
+ (FT_UShort)ns->strid,
+ &strname );
+ if ( strname && !ft_strcmp( strname, ".notdef" ) )
+ strname = NULL;
+ }
+
+ if ( ns->psid != 0xFFFF )
+ {
+ (void)sfnt->get_name( face,
+ (FT_UShort)ns->psid,
+ &psname );
+ if ( psname && !ft_strcmp( psname, ".notdef" ) )
+ psname = NULL;
+ }
+
+ (void)FT_STREAM_SEEK( pos );
+
+ FT_TRACE5(( " instance %d (%s%s%s, %s%s%s)\n",
+ i,
+ strname ? "name: `" : "",
+ strname ? strname : "unnamed",
+ strname ? "'" : "",
+ psname ? "PS name: `" : "",
+ psname ? psname : "no PS name",
+ psname ? "'" : "" ));
+
+ FT_FREE( strname );
+ FT_FREE( psname );
+ }
+#endif /* FT_DEBUG_LEVEL_TRACE */
+
+ ft_var_to_normalized( face, num_axes, ns->coords, nsc );
+ nsc += num_axes;
FT_FRAME_EXIT();
}
@@ -2237,7 +2336,7 @@
a = mmvar->axis;
c = ns->coords;
- for ( j = 0; j < fvar_head.axisCount; j++, a++, c++ )
+ for ( j = 0; j < num_axes; j++, a++, c++ )
*c = a->def;
}
}
@@ -2258,23 +2357,24 @@
FT_MEM_COPY( mmvar, face->blend->mmvar, face->blend->mmvar_len );
axis_flags =
- (FT_UShort*)&( mmvar[1] );
+ (FT_UShort*)( (char*)mmvar + mmvar_size );
mmvar->axis =
- (FT_Var_Axis*)&( axis_flags[mmvar->num_axis] );
+ (FT_Var_Axis*)( (char*)axis_flags + axis_flags_size );
mmvar->namedstyle =
- (FT_Var_Named_Style*)&( mmvar->axis[mmvar->num_axis] );
+ (FT_Var_Named_Style*)( (char*)mmvar->axis+ axis_size );
- next_coords =
- (FT_Fixed*)&( mmvar->namedstyle[mmvar->num_namedstyles] );
+ next_coords = (FT_Fixed*)( (char*)mmvar->namedstyle +
+ namedstyle_size );
for ( n = 0; n < mmvar->num_namedstyles; n++ )
{
mmvar->namedstyle[n].coords = next_coords;
- next_coords += mmvar->num_axis;
+ next_coords += num_axes;
}
a = mmvar->axis;
- next_name = (FT_String*)next_coords;
- for ( n = 0; n < mmvar->num_axis; n++ )
+ next_name = (FT_String*)( (char*)mmvar->namedstyle +
+ namedstyle_size + next_coords_size );
+ for ( n = 0; n < num_axes; n++ )
{
a->name = next_name;
@@ -2309,10 +2409,9 @@
FT_Error error = FT_Err_Ok;
GX_Blend blend;
FT_MM_Var* mmvar;
- FT_UInt i, j;
+ FT_UInt i;
- FT_Bool is_default_instance = TRUE;
- FT_Bool all_design_coords = FALSE;
+ FT_Bool all_design_coords = FALSE;
FT_Memory memory = face->root.memory;
@@ -2344,11 +2443,12 @@
num_coords = mmvar->num_axis;
}
- FT_TRACE5(( "normalized design coordinates:\n" ));
+ FT_TRACE5(( "TT_Set_MM_Blend:\n"
+ " normalized design coordinates:\n" ));
for ( i = 0; i < num_coords; i++ )
{
- FT_TRACE5(( " %.5f\n", coords[i] / 65536.0 ));
+ FT_TRACE5(( " %.5f\n", coords[i] / 65536.0 ));
if ( coords[i] < -0x00010000L || coords[i] > 0x00010000L )
{
FT_TRACE1(( "TT_Set_MM_Blend: normalized design coordinate %.5f\n"
@@ -2357,9 +2457,6 @@
error = FT_THROW( Invalid_Argument );
goto Exit;
}
-
- if ( coords[i] != 0 )
- is_default_instance = FALSE;
}
FT_TRACE5(( "\n" ));
@@ -2390,6 +2487,12 @@
}
else
{
+ FT_Bool have_diff = 0;
+ FT_UInt j;
+ FT_Fixed* c;
+ FT_Fixed* n;
+
+
manageCvt = mcvt_retain;
for ( i = 0; i < num_coords; i++ )
@@ -2397,10 +2500,34 @@
if ( blend->normalizedcoords[i] != coords[i] )
{
manageCvt = mcvt_load;
+ have_diff = 1;
break;
}
}
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
+ {
+ FT_UInt idx = (FT_UInt)face->root.face_index >> 16;
+
+
+ c = blend->normalizedcoords + i;
+ n = blend->normalized_stylecoords + idx * mmvar->num_axis + i;
+ for ( j = i; j < mmvar->num_axis; j++, n++, c++ )
+ if ( *c != *n )
+ have_diff = 1;
+ }
+ else
+ {
+ c = blend->normalizedcoords + i;
+ for ( j = i; j < mmvar->num_axis; j++, c++ )
+ if ( *c != 0 )
+ have_diff = 1;
+ }
+
+ /* return value -1 indicates `no change' */
+ if ( !have_diff )
+ return -1;
+
for ( ; i < mmvar->num_axis; i++ )
{
if ( blend->normalizedcoords[i] != 0 )
@@ -2454,32 +2581,6 @@
}
}
- /* check whether the current variation tuple coincides */
- /* with a named instance */
-
- for ( i = 0; i < blend->mmvar->num_namedstyles; i++ )
- {
- FT_Fixed* nsc = blend->normalized_stylecoords + i * blend->num_axis;
- FT_Fixed* ns = blend->normalizedcoords;
-
-
- for ( j = 0; j < blend->num_axis; j++, nsc++, ns++ )
- {
- if ( *nsc != *ns )
- break;
- }
-
- if ( j == blend->num_axis )
- break;
- }
-
- /* adjust named instance index */
- face->root.face_index &= 0xFFFF;
- if ( i < blend->mmvar->num_namedstyles )
- face->root.face_index |= ( i + 1 ) << 16;
-
- face->is_default_instance = is_default_instance;
-
/* enforce recomputation of the PostScript name; */
FT_FREE( face->postscript_name );
face->postscript_name = NULL;
@@ -2519,7 +2620,19 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- return tt_set_mm_blend( face, num_coords, coords, 1 );
+ FT_Error error;
+
+
+ error = tt_set_mm_blend( face, num_coords, coords, 1 );
+ if ( error )
+ return error;
+
+ if ( num_coords )
+ face->root.face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ return FT_Err_Ok;
}
@@ -2635,11 +2748,12 @@
FT_UInt i;
FT_Memory memory = face->root.memory;
- FT_Var_Axis* a;
- FT_Fixed* c;
-
+ FT_Fixed* c;
+ FT_Fixed* n;
FT_Fixed* normalized = NULL;
+ FT_Bool have_diff = 0;
+
if ( !face->blend )
{
@@ -2664,14 +2778,56 @@
goto Exit;
}
- FT_MEM_COPY( blend->coords,
- coords,
- num_coords * sizeof ( FT_Fixed ) );
+ c = blend->coords;
+ n = coords;
+ for ( i = 0; i < num_coords; i++, n++, c++ )
+ {
+ if ( *c != *n )
+ {
+ *c = *n;
+ have_diff = 1;
+ }
+ }
+
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) )
+ {
+ FT_UInt instance_index;
+ FT_Var_Named_Style* named_style;
+
+
+ instance_index = (FT_UInt)face->root.face_index >> 16;
+ named_style = mmvar->namedstyle + instance_index - 1;
+
+ n = named_style->coords + num_coords;
+ for ( ; i < mmvar->num_axis; i++, n++, c++ )
+ {
+ if ( *c != *n )
+ {
+ *c = *n;
+ have_diff = 1;
+ }
+ }
+ }
+ else
+ {
+ FT_Var_Axis* a;
- a = mmvar->axis + num_coords;
- c = blend->coords + num_coords;
- for ( i = num_coords; i < mmvar->num_axis; i++, a++, c++ )
- *c = a->def;
+
+ a = mmvar->axis + num_coords;
+ for ( ; i < mmvar->num_axis; i++, a++, c++ )
+ {
+ if ( *c != a->def )
+ {
+ *c = a->def;
+ have_diff = 1;
+ }
+ }
+ }
+
+ /* return value -1 indicates `no change'; */
+ /* we can exit early if `normalizedcoords' is already computed */
+ if ( blend->normalizedcoords && !have_diff )
+ return -1;
if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) )
goto Exit;
@@ -2679,9 +2835,18 @@
if ( !face->blend->avar_loaded )
ft_var_load_avar( face );
+ FT_TRACE5(( "TT_Set_Var_Design:\n"
+ " normalized design coordinates:\n" ));
ft_var_to_normalized( face, num_coords, blend->coords, normalized );
error = tt_set_mm_blend( face, mmvar->num_axis, normalized, 0 );
+ if ( error )
+ goto Exit;
+
+ if ( num_coords )
+ face->root.face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
Exit:
FT_FREE( normalized );
@@ -2765,6 +2930,90 @@
/*************************************************************************/
+ /* */
+ /* <Function> */
+ /* TT_Set_Named_Instance */
+ /* */
+ /* <Description> */
+ /* Set the given named instance, also resetting any further */
+ /* variation. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* instance_index :: The instance index, starting with value 1. */
+ /* Value 0 indicates to not use an instance. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0~means success. */
+ /* */
+ FT_LOCAL_DEF( FT_Error )
+ TT_Set_Named_Instance( TT_Face face,
+ FT_UInt instance_index )
+ {
+ FT_Error error = FT_ERR( Invalid_Argument );
+ GX_Blend blend;
+ FT_MM_Var* mmvar;
+
+ FT_UInt num_instances;
+
+
+ if ( !face->blend )
+ {
+ if ( FT_SET_ERROR( TT_Get_MM_Var( face, NULL ) ) )
+ goto Exit;
+ }
+
+ blend = face->blend;
+ mmvar = blend->mmvar;
+
+ num_instances = (FT_UInt)face->root.style_flags >> 16;
+
+ /* `instance_index' starts with value 1, thus `>' */
+ if ( instance_index > num_instances )
+ goto Exit;
+
+ if ( instance_index > 0 && mmvar->namedstyle )
+ {
+ FT_Memory memory = face->root.memory;
+ SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+
+ FT_Var_Named_Style* named_style;
+ FT_String* style_name;
+
+
+ named_style = mmvar->namedstyle + instance_index - 1;
+
+ error = sfnt->get_name( face,
+ (FT_UShort)named_style->strid,
+ &style_name );
+ if ( error )
+ goto Exit;
+
+ /* set (or replace) style name */
+ FT_FREE( face->root.style_name );
+ face->root.style_name = style_name;
+
+ /* finally, select the named instance */
+ error = TT_Set_Var_Design( face,
+ mmvar->num_axis,
+ named_style->coords );
+ if ( error )
+ goto Exit;
+ }
+ else
+ error = TT_Set_Var_Design( face, 0, NULL );
+
+ face->root.face_index = ( instance_index << 16 ) |
+ ( face->root.face_index & 0xFFFFL );
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ Exit:
+ return error;
+ }
+
+
+ /*************************************************************************/
/*************************************************************************/
/***** *****/
/***** GX VAR PARSING ROUTINES *****/
@@ -2810,8 +3059,10 @@
FT_Fixed* im_start_coords = NULL;
FT_Fixed* im_end_coords = NULL;
GX_Blend blend = face->blend;
- FT_UInt point_count;
- FT_UShort* localpoints;
+ FT_UInt point_count, spoint_count = 0;
+ FT_UShort* sharedpoints = NULL;
+ FT_UShort* localpoints = NULL;
+ FT_UShort* points;
FT_Short* deltas;
@@ -2880,11 +3131,24 @@
offsetToData += table_start;
- /* The documentation implies there are flags packed into */
- /* `tupleCount', but John Jenkins says that shared points don't apply */
- /* to `cvar', and no other flags are defined. */
+ if ( tupleCount & GX_TC_TUPLES_SHARE_POINT_NUMBERS )
+ {
+ here = FT_Stream_FTell( stream );
+
+ FT_Stream_SeekSet( stream, offsetToData );
- FT_TRACE5(( "cvar: there are %d tuples:\n", tupleCount & 0xFFF ));
+ sharedpoints = ft_var_readpackedpoints( stream,
+ table_len,
+ &spoint_count );
+ offsetToData = FT_Stream_FTell( stream );
+
+ FT_Stream_SeekSet( stream, here );
+ }
+
+ FT_TRACE5(( "cvar: there %s %d tuple%s:\n",
+ ( tupleCount & 0xFFF ) == 1 ? "is" : "are",
+ tupleCount & 0xFFF,
+ ( tupleCount & 0xFFF ) == 1 ? "" : "s" ));
for ( i = 0; i < ( tupleCount & 0xFFF ); i++ )
{
@@ -2898,26 +3162,25 @@
tupleDataSize = FT_GET_USHORT();
tupleIndex = FT_GET_USHORT();
- /* There is no provision here for a global tuple coordinate section, */
- /* so John says. There are no tuple indices, just embedded tuples. */
-
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
for ( j = 0; j < blend->num_axis; j++ )
tuple_coords[j] = FT_GET_SHORT() * 4; /* convert from */
/* short frac to fixed */
}
- else
+ else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) >= blend->tuplecount )
{
- /* skip this tuple; it makes no sense */
-
- if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
- for ( j = 0; j < 2 * blend->num_axis; j++ )
- (void)FT_GET_SHORT();
+ FT_TRACE2(( "tt_face_vary_cvt:"
+ " invalid tuple index\n" ));
- offsetToData += tupleDataSize;
- continue;
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
}
+ else
+ FT_MEM_COPY(
+ tuple_coords,
+ &blend->tuplecoords[( tupleIndex & 0xFFF ) * blend->num_axis],
+ blend->num_axis * sizeof ( FT_Fixed ) );
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
@@ -2932,11 +3195,8 @@
tuple_coords,
im_start_coords,
im_end_coords );
- if ( /* tuple isn't active for our blend */
- apply == 0 ||
- /* global points not allowed, */
- /* if they aren't local, makes no sense */
- !( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS ) )
+
+ if ( apply == 0 ) /* tuple isn't active for our blend */
{
offsetToData += tupleDataSize;
continue;
@@ -2946,14 +3206,27 @@
FT_Stream_SeekSet( stream, offsetToData );
- localpoints = ft_var_readpackedpoints( stream,
- table_len,
- &point_count );
- deltas = ft_var_readpackeddeltas( stream,
- table_len,
- point_count == 0 ? face->cvt_size
- : point_count );
- if ( !localpoints || !deltas )
+ if ( tupleIndex & GX_TI_PRIVATE_POINT_NUMBERS )
+ {
+ localpoints = ft_var_readpackedpoints( stream,
+ table_len,
+ &point_count );
+ points = localpoints;
+ }
+ else
+ {
+ points = sharedpoints;
+ point_count = spoint_count;
+ }
+
+ deltas = ft_var_readpackeddeltas( stream,
+ table_len,
+ point_count == 0 ? face->cvt_size
+ : point_count );
+
+ if ( !points ||
+ !deltas ||
+ ( localpoints == ALL_POINTS && point_count != face->cvt_size ) )
; /* failure, ignore it */
else if ( localpoints == ALL_POINTS )
@@ -3005,7 +3278,7 @@
FT_Long orig_cvt;
- pindex = localpoints[j];
+ pindex = points[j];
if ( (FT_ULong)pindex >= face->cvt_size )
continue;
@@ -3044,6 +3317,8 @@
FT_FRAME_EXIT();
Exit:
+ if ( sharedpoints != ALL_POINTS )
+ FT_FREE( sharedpoints );
FT_FREE( tuple_coords );
FT_FREE( im_start_coords );
FT_FREE( im_end_coords );
@@ -3330,7 +3605,6 @@
glyph_start = FT_Stream_FTell( stream );
/* each set of glyph variation data is formatted similarly to `cvar' */
- /* (except we get shared points and global tuples) */
if ( FT_NEW_ARRAY( tuple_coords, blend->num_axis ) ||
FT_NEW_ARRAY( im_start_coords, blend->num_axis ) ||
@@ -3367,8 +3641,10 @@
FT_Stream_SeekSet( stream, here );
}
- FT_TRACE5(( "gvar: there are %d tuples:\n",
- tupleCount & GX_TC_TUPLE_COUNT_MASK ));
+ FT_TRACE5(( "gvar: there %s %d tuple%s:\n",
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
+ tupleCount & GX_TC_TUPLE_COUNT_MASK,
+ ( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
for ( j = 0; j < n_points; j++ )
points_org[j] = outline->points[j];
@@ -3470,7 +3746,7 @@
FT_Pos delta_y = FT_MulFix( deltas_y[j], apply );
- if ( j < n_points - 3 )
+ if ( j < n_points - 4 )
{
outline->points[j].x += delta_x;
outline->points[j].y += delta_y;
@@ -3480,25 +3756,25 @@
/* To avoid double adjustment of advance width or height, */
/* adjust phantom points only if there is no HVAR or VVAR */
/* support, respectively. */
- if ( j == ( n_points - 3 ) &&
- !( face->variation_support &
- TT_FACE_FLAG_VAR_HADVANCE ) )
+ if ( j == ( n_points - 4 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_LSB ) )
+ outline->points[j].x += delta_x;
+
+ else if ( j == ( n_points - 3 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_HADVANCE ) )
outline->points[j].x += delta_x;
else if ( j == ( n_points - 2 ) &&
!( face->variation_support &
- TT_FACE_FLAG_VAR_LSB ) )
- outline->points[j].x += delta_x;
+ TT_FACE_FLAG_VAR_TSB ) )
+ outline->points[j].y += delta_y;
else if ( j == ( n_points - 1 ) &&
!( face->variation_support &
TT_FACE_FLAG_VAR_VADVANCE ) )
outline->points[j].y += delta_y;
-
- else if ( j == ( n_points - 0 ) &&
- !( face->variation_support &
- TT_FACE_FLAG_VAR_TSB ) )
- outline->points[j].y += delta_y;
}
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -3565,8 +3841,36 @@
FT_Pos delta_y = points_out[j].y - points_org[j].y;
- outline->points[j].x += delta_x;
- outline->points[j].y += delta_y;
+ if ( j < n_points - 4 )
+ {
+ outline->points[j].x += delta_x;
+ outline->points[j].y += delta_y;
+ }
+ else
+ {
+ /* To avoid double adjustment of advance width or height, */
+ /* adjust phantom points only if there is no HVAR or VVAR */
+ /* support, respectively. */
+ if ( j == ( n_points - 4 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_LSB ) )
+ outline->points[j].x += delta_x;
+
+ else if ( j == ( n_points - 3 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_HADVANCE ) )
+ outline->points[j].x += delta_x;
+
+ else if ( j == ( n_points - 2 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_TSB ) )
+ outline->points[j].y += delta_y;
+
+ else if ( j == ( n_points - 1 ) &&
+ !( face->variation_support &
+ TT_FACE_FLAG_VAR_VADVANCE ) )
+ outline->points[j].y += delta_y;
+ }
#ifdef FT_DEBUG_LEVEL_TRACE
if ( delta_x || delta_y )
diff --git a/thirdparty/freetype/src/truetype/ttgxvar.h b/thirdparty/freetype/src/truetype/ttgxvar.h
index 7e81719a3e..a37bb90266 100644
--- a/thirdparty/freetype/src/truetype/ttgxvar.h
+++ b/thirdparty/freetype/src/truetype/ttgxvar.h
@@ -4,7 +4,7 @@
/* */
/* TrueType GX Font Variation loader (specification) */
/* */
-/* Copyright 2004-2017 by */
+/* Copyright 2004-2018 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and George Williams. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -27,6 +27,8 @@
FT_BEGIN_HEADER
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+
/*************************************************************************/
/* */
/* <Struct> */
@@ -402,6 +404,10 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
FT_LOCAL( FT_Error )
+ TT_Set_Named_Instance( TT_Face face,
+ FT_UInt instance_index );
+
+ FT_LOCAL( FT_Error )
tt_face_vary_cvt( TT_Face face,
FT_Stream stream );
@@ -435,6 +441,8 @@ FT_BEGIN_HEADER
FT_LOCAL( void )
tt_done_blend( TT_Face face );
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
+
FT_END_HEADER
diff --git a/thirdparty/freetype/src/truetype/ttinterp.c b/thirdparty/freetype/src/truetype/ttinterp.c
index ddcc839bb3..da9b595aba 100644
--- a/thirdparty/freetype/src/truetype/ttinterp.c
+++ b/thirdparty/freetype/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,7 +25,7 @@
#include FT_INTERNAL_CALC_H
#include FT_TRIGONOMETRY_H
#include FT_SYSTEM_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include FT_MULTIPLE_MASTERS_H
#include "ttinterp.h"
@@ -2165,7 +2165,7 @@
val = ADD_LONG( distance,
exc->threshold - exc->phase + compensation ) &
-exc->period;
- val += exc->phase;
+ val = ADD_LONG( val, exc->phase );
if ( val < 0 )
val = exc->phase;
}
@@ -2174,7 +2174,7 @@
val = NEG_LONG( SUB_LONG( exc->threshold - exc->phase + compensation,
distance ) &
-exc->period );
- val -= exc->phase;
+ val = SUB_LONG( val, exc->phase );
if ( val > 0 )
val = -exc->phase;
}
@@ -2216,7 +2216,7 @@
val = ( ADD_LONG( distance,
exc->threshold - exc->phase + compensation ) /
exc->period ) * exc->period;
- val += exc->phase;
+ val = ADD_LONG( val, exc->phase );
if ( val < 0 )
val = exc->phase;
}
@@ -2225,7 +2225,7 @@
val = NEG_LONG( ( SUB_LONG( exc->threshold - exc->phase + compensation,
distance ) /
exc->period ) * exc->period );
- val -= exc->phase;
+ val = SUB_LONG( val, exc->phase );
if ( val > 0 )
val = -exc->phase;
}
@@ -2954,7 +2954,7 @@
static void
Ins_CEILING( FT_Long* args )
{
- args[0] = FT_PIX_CEIL( args[0] );
+ args[0] = FT_PIX_CEIL_LONG( args[0] );
}
@@ -3289,7 +3289,10 @@
if ( args[0] < 0 )
exc->error = FT_THROW( Bad_Argument );
else
- exc->GS.loop = args[0];
+ {
+ /* we heuristically limit the number of loops to 16 bits */
+ exc->GS.loop = args[0] > 0xFFFFL ? 0xFFFFL : args[0];
+ }
}
@@ -5690,7 +5693,11 @@
( B1 & 63 ) != 0 &&
( B2 & 63 ) != 0 &&
B1 != B2 )
- Move_Zp2_Point( exc, point, -dx, -dy, TRUE );
+ Move_Zp2_Point( exc,
+ point,
+ NEG_LONG( dx ),
+ NEG_LONG( dy ),
+ TRUE );
}
}
else if ( exc->face->sph_compatibility_mode )
@@ -5722,7 +5729,7 @@
if ( ( B1 & 63 ) == 0 &&
( B2 & 63 ) != 0 &&
B1 != B2 )
- Move_Zp2_Point( exc, point, 0, -dy, TRUE );
+ Move_Zp2_Point( exc, point, 0, NEG_LONG( dy ), TRUE );
}
}
else if ( exc->sph_in_func_flags & SPH_FDEF_TYPEMAN_DIAGENDCTRL )
@@ -5778,6 +5785,7 @@
FT_F26Dot6 distance;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
FT_F26Dot6 control_value_cutin = 0;
+ FT_F26Dot6 delta;
if ( SUBPIXEL_HINTING_INFINALITY )
@@ -5813,11 +5821,15 @@
distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+ delta = SUB_LONG( distance, args[1] );
+ if ( delta < 0 )
+ delta = NEG_LONG( delta );
+
/* subpixel hinting - make MSIRP respect CVT cut-in; */
- if ( SUBPIXEL_HINTING_INFINALITY &&
- exc->ignore_x_mode &&
- exc->GS.freeVector.x != 0 &&
- FT_ABS( SUB_LONG( distance, args[1] ) ) >= control_value_cutin )
+ if ( SUBPIXEL_HINTING_INFINALITY &&
+ exc->ignore_x_mode &&
+ exc->GS.freeVector.x != 0 &&
+ delta >= control_value_cutin )
distance = args[1];
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
@@ -5865,16 +5877,18 @@
if ( SUBPIXEL_HINTING_INFINALITY &&
exc->ignore_x_mode &&
exc->GS.freeVector.x != 0 )
- distance = Round_None(
- exc,
- cur_dist,
- exc->tt_metrics.compensations[0] ) - cur_dist;
+ distance = SUB_LONG(
+ Round_None( exc,
+ cur_dist,
+ exc->tt_metrics.compensations[0] ),
+ cur_dist );
else
#endif
- distance = exc->func_round(
- exc,
- cur_dist,
- exc->tt_metrics.compensations[0] ) - cur_dist;
+ distance = SUB_LONG(
+ exc->func_round( exc,
+ cur_dist,
+ exc->tt_metrics.compensations[0] ),
+ cur_dist );
}
else
distance = 0;
@@ -5974,7 +5988,14 @@
if ( ( exc->opcode & 1 ) != 0 ) /* rounding and control cut-in flag */
{
- if ( FT_ABS( distance - org_dist ) > control_value_cutin )
+ FT_F26Dot6 delta;
+
+
+ delta = SUB_LONG( distance, org_dist );
+ if ( delta < 0 )
+ delta = NEG_LONG( delta );
+
+ if ( delta > control_value_cutin )
distance = org_dist;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
@@ -5991,7 +6012,7 @@
exc->tt_metrics.compensations[0] );
}
- exc->func_move( exc, &exc->zp0, point, distance - org_dist );
+ exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) );
Fail:
exc->GS.rp0 = point;
@@ -6074,8 +6095,12 @@
/* single width cut-in test */
- if ( FT_ABS( org_dist - exc->GS.single_width_value ) <
- exc->GS.single_width_cutin )
+ /* |org_dist - single_width_value| < single_width_cutin */
+ if ( exc->GS.single_width_cutin > 0 &&
+ org_dist < exc->GS.single_width_value +
+ exc->GS.single_width_cutin &&
+ org_dist > exc->GS.single_width_value -
+ exc->GS.single_width_cutin )
{
if ( org_dist >= 0 )
org_dist = exc->GS.single_width_value;
@@ -6168,7 +6193,7 @@
minimum_distance = exc->GS.minimum_distance;
control_value_cutin = exc->GS.control_value_cutin;
point = (FT_UShort)args[0];
- cvtEntry = (FT_ULong)( args[1] + 1 );
+ cvtEntry = (FT_ULong)( ADD_LONG( args[1], 1 ) );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
if ( SUBPIXEL_HINTING_INFINALITY &&
@@ -6251,6 +6276,9 @@
if ( exc->GS.gep0 == exc->GS.gep1 )
{
+ FT_F26Dot6 delta;
+
+
/* XXX: According to Greg Hitchcock, the following wording is */
/* the right one: */
/* */
@@ -6263,7 +6291,11 @@
/* `ttinst2.doc', version 1.66, is thus incorrect since */
/* it implies `>=' instead of `>'. */
- if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
+ delta = SUB_LONG( cvt_dist, org_dist );
+ if ( delta < 0 )
+ delta = NEG_LONG( delta );
+
+ if ( delta > control_value_cutin )
cvt_dist = org_dist;
}
@@ -6281,7 +6313,14 @@
exc->ignore_x_mode &&
exc->GS.gep0 == exc->GS.gep1 )
{
- if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin )
+ FT_F26Dot6 delta;
+
+
+ delta = SUB_LONG( cvt_dist, org_dist );
+ if ( delta < 0 )
+ delta = NEG_LONG( delta );
+
+ if ( delta > control_value_cutin )
cvt_dist = org_dist;
}
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
@@ -7153,7 +7192,7 @@
SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP ) &&
( B1 & 63 ) != 0 &&
( B2 & 63 ) != 0 ) ) )
- exc->func_move( exc, &exc->zp0, A, -B );
+ exc->func_move( exc, &exc->zp0, A, NEG_LONG( B ) );
}
}
else
@@ -7524,8 +7563,16 @@
return;
}
- for ( i = 0; i < num_axes; i++ )
- args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+ if ( coords )
+ {
+ for ( i = 0; i < num_axes; i++ )
+ args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */
+ }
+ else
+ {
+ for ( i = 0; i < num_axes; i++ )
+ args[i] = 0;
+ }
}
@@ -8478,7 +8525,9 @@
} while ( !exc->instruction_trap );
LNo_Error_:
- FT_TRACE4(( " %d instructions executed\n", ins_counter ));
+ FT_TRACE4(( " %d instruction%s executed\n",
+ ins_counter,
+ ins_counter == 1 ? "" : "s" ));
return FT_Err_Ok;
LErrorCodeOverflow_:
diff --git a/thirdparty/freetype/src/truetype/ttinterp.h b/thirdparty/freetype/src/truetype/ttinterp.h
index abbecfcee3..2966439ea2 100644
--- a/thirdparty/freetype/src/truetype/ttinterp.h
+++ b/thirdparty/freetype/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
/* */
/* TrueType bytecode interpreter (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttobjs.c b/thirdparty/freetype/src/truetype/ttobjs.c
index 081fa2f1a5..6685dc8196 100644
--- a/thirdparty/freetype/src/truetype/ttobjs.c
+++ b/thirdparty/freetype/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
/* */
/* Objects manager (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,7 +21,7 @@
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
#include FT_INTERNAL_SFNT_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include "ttgload.h"
#include "ttpload.h"
@@ -147,7 +147,7 @@
{
#define TRICK_NAMES_MAX_CHARACTERS 19
-#define TRICK_NAMES_COUNT 18
+#define TRICK_NAMES_COUNT 26
static const char trick_names[TRICK_NAMES_COUNT]
[TRICK_NAMES_MAX_CHARACTERS + 1] =
@@ -165,9 +165,17 @@
"cpop", /* dftt-p7.ttf; version 1.00, 1992 [DLJGyShoMedium] */
"DFGirl-W6-WIN-BF", /* dftt-h6.ttf; version 1.00, 1993 */
+ "DFGothic-EB", /* DynaLab Inc. 1992-1995 */
+ "DFGyoSho-Lt", /* DynaLab Inc. 1992-1995 */
+ "DFHei-Md-HK-BF", /* maybe DynaLab Inc. */
+ "DFHSGothic-W5", /* DynaLab Inc. 1992-1995 */
+ "DFHSMincho-W3", /* DynaLab Inc. 1992-1995 */
+ "DFHSMincho-W7", /* DynaLab Inc. 1992-1995 */
"DFKaiSho-SB", /* dfkaisb.ttf */
"DFKaiShu",
+ "DFKaiShu-Md-HK-BF", /* maybe DynaLab Inc. */
"DFKai-SB", /* kaiu.ttf; version 3.00, 1998 [DFKaiShu-SB-Estd-BF] */
+ "DFMing-Bd-HK-BF", /* maybe DynaLab Inc. */
"DLC", /* dftt-m7.ttf; version 1.00, 1993 [DLCMingBold] */
/* dftt-f5.ttf; version 1.00, 1993 [DLCFongSung] */
"DLCHayMedium", /* dftt-b5.ttf; version 1.00, 1993 */
@@ -265,7 +273,7 @@
tt_check_trickyness_sfnt_ids( TT_Face face )
{
#define TRICK_SFNT_IDS_PER_FACE 3
-#define TRICK_SFNT_IDS_NUM_FACES 19
+#define TRICK_SFNT_IDS_NUM_FACES 29
static const tt_sfnt_id_rec sfnt_id[TRICK_SFNT_IDS_NUM_FACES]
[TRICK_SFNT_IDS_PER_FACE] = {
@@ -284,6 +292,36 @@
{ 0x28233BF1UL, 0x000087C4UL }, /* fpgm */
{ 0xA344A1EBUL, 0x000001E1UL } /* prep */
},
+ { /* DFGothic-EB */
+ { 0x12C3EBB2UL, 0x00000350UL }, /* cvt */
+ { 0xB680EE64UL, 0x000087A7UL }, /* fpgm */
+ { 0xCE939563UL, 0x00000758UL } /* prep */
+ },
+ { /* DFGyoSho-Lt */
+ { 0x11E5EAD4UL, 0x00000350UL }, /* cvt */
+ { 0xCE5956E9UL, 0x0000BC85UL }, /* fpgm */
+ { 0x8272F416UL, 0x00000045UL } /* prep */
+ },
+ { /* DFHei-Md-HK-BF */
+ { 0x1257EB46UL, 0x00000350UL }, /* cvt */
+ { 0xF699D160UL, 0x0000715FUL }, /* fpgm */
+ { 0xD222F568UL, 0x000003BCUL } /* prep */
+ },
+ { /* DFHSGothic-W5 */
+ { 0x1262EB4EUL, 0x00000350UL }, /* cvt */
+ { 0xE86A5D64UL, 0x00007940UL }, /* fpgm */
+ { 0x7850F729UL, 0x000005FFUL } /* prep */
+ },
+ { /* DFHSMincho-W3 */
+ { 0x122DEB0AUL, 0x00000350UL }, /* cvt */
+ { 0x3D16328AUL, 0x0000859BUL }, /* fpgm */
+ { 0xA93FC33BUL, 0x000002CBUL } /* prep */
+ },
+ { /* DFHSMincho-W7 */
+ { 0x125FEB26UL, 0x00000350UL }, /* cvt */
+ { 0xA5ACC982UL, 0x00007EE1UL }, /* fpgm */
+ { 0x90999196UL, 0x0000041FUL } /* prep */
+ },
{ /* DFKaiShu */
{ 0x11E5EAD4UL, 0x00000350UL }, /* cvt */
{ 0x5A30CA3BUL, 0x00009063UL }, /* fpgm */
@@ -294,6 +332,26 @@
{ 0xA6E78C01UL, 0x00008998UL }, /* fpgm */
{ 0x13A42602UL, 0x0000007EUL } /* prep */
},
+ { /* DFKaiShu-Md-HK-BF */
+ { 0x11E5EAD4UL, 0x00000360UL }, /* cvt */
+ { 0x9DB282B2UL, 0x0000C06EUL }, /* fpgm */
+ { 0x53E6D7CAUL, 0x00000082UL } /* prep */
+ },
+ { /* DFMing-Bd-HK-BF */
+ { 0x1243EB18UL, 0x00000350UL }, /* cvt */
+ { 0xBA0A8C30UL, 0x000074ADUL }, /* fpgm */
+ { 0xF3D83409UL, 0x0000037BUL } /* prep */
+ },
+ { /* DLCLiShu */
+ { 0x07DCF546UL, 0x00000308UL }, /* cvt */
+ { 0x40FE7C90UL, 0x00008E2AUL }, /* fpgm */
+ { 0x608174B5UL, 0x0000007AUL } /* prep */
+ },
+ { /* DLCHayBold */
+ { 0xEB891238UL, 0x00000308UL }, /* cvt */
+ { 0xD2E4DCD4UL, 0x0000676FUL }, /* fpgm */
+ { 0x8EA5F293UL, 0x000003B8UL } /* prep */
+ },
{ /* HuaTianKaiTi */
{ 0xFFFBFFFCUL, 0x00000008UL }, /* cvt */
{ 0x9C9E48B8UL, 0x0000BEA2UL }, /* fpgm */
@@ -657,46 +715,17 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
{
- FT_Int instance_index = face_index >> 16;
+ FT_UInt instance_index = (FT_UInt)face_index >> 16;
if ( FT_HAS_MULTIPLE_MASTERS( ttface ) &&
instance_index > 0 )
{
- error = TT_Get_MM_Var( face, NULL );
+ error = TT_Set_Named_Instance( face, instance_index );
if ( error )
goto Exit;
- if ( face->blend->mmvar->namedstyle )
- {
- FT_Memory memory = ttface->memory;
-
- FT_Var_Named_Style* named_style;
- FT_String* style_name;
-
-
- /* in `face_index', the instance index starts with value 1 */
- named_style = face->blend->mmvar->namedstyle + instance_index - 1;
- error = sfnt->get_name( face,
- (FT_UShort)named_style->strid,
- &style_name );
- if ( error )
- goto Exit;
-
- /* set style name; if already set, replace it */
- if ( face->root.style_name )
- FT_FREE( face->root.style_name );
- face->root.style_name = style_name;
-
- /* finally, select the named instance */
- error = TT_Set_Var_Design( face,
- face->blend->mmvar->num_axis,
- named_style->coords );
- if ( error )
- goto Exit;
-
- tt_apply_mvar( face );
- }
+ tt_apply_mvar( face );
}
}
diff --git a/thirdparty/freetype/src/truetype/ttobjs.h b/thirdparty/freetype/src/truetype/ttobjs.h
index cdacee75e5..38fa30e4e9 100644
--- a/thirdparty/freetype/src/truetype/ttobjs.h
+++ b/thirdparty/freetype/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
/* */
/* Objects manager (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttpic.c b/thirdparty/freetype/src/truetype/ttpic.c
index 66bd7e1934..cdbb80639e 100644
--- a/thirdparty/freetype/src/truetype/ttpic.c
+++ b/thirdparty/freetype/src/truetype/ttpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttpic.h b/thirdparty/freetype/src/truetype/ttpic.h
index 1410cd73c3..df878ae6f1 100644
--- a/thirdparty/freetype/src/truetype/ttpic.h
+++ b/thirdparty/freetype/src/truetype/ttpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for truetype module. */
/* */
-/* Copyright 2009-2017 by */
+/* Copyright 2009-2018 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttpload.c b/thirdparty/freetype/src/truetype/ttpload.c
index bcf6b34f67..d9526ad082 100644
--- a/thirdparty/freetype/src/truetype/ttpload.c
+++ b/thirdparty/freetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttpload.h b/thirdparty/freetype/src/truetype/ttpload.h
index 79079f345a..fa12527247 100644
--- a/thirdparty/freetype/src/truetype/ttpload.h
+++ b/thirdparty/freetype/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
/* */
/* TrueType-specific tables loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/truetype/ttsubpix.c b/thirdparty/freetype/src/truetype/ttsubpix.c
index 1c8cf01109..d94bcc8b50 100644
--- a/thirdparty/freetype/src/truetype/ttsubpix.c
+++ b/thirdparty/freetype/src/truetype/ttsubpix.c
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2017 by */
+/* Copyright 2010-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,7 +22,7 @@
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_TAGS_H
#include FT_OUTLINE_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include "ttsubpix.h"
@@ -753,24 +753,24 @@
/* Does font name match rule family? */
- if ( strcmp( detected_font_name, rule_font_name ) == 0 )
+ if ( ft_strcmp( detected_font_name, rule_font_name ) == 0 )
return TRUE;
/* Is font name a wildcard ""? */
- if ( strcmp( rule_font_name, "" ) == 0 )
+ if ( ft_strcmp( rule_font_name, "" ) == 0 )
return TRUE;
/* Is font name contained in a class list? */
for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )
{
- if ( strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )
{
for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
{
- if ( strcmp( FAMILY_CLASS_Rules[i].member[j], "" ) == 0 )
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j], "" ) == 0 )
continue;
- if ( strcmp( FAMILY_CLASS_Rules[i].member[j],
- detected_font_name ) == 0 )
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j],
+ detected_font_name ) == 0 )
return TRUE;
}
}
@@ -788,24 +788,24 @@
/* Does font style match rule style? */
- if ( strcmp( detected_font_style, rule_font_style ) == 0 )
+ if ( ft_strcmp( detected_font_style, rule_font_style ) == 0 )
return TRUE;
/* Is font style a wildcard ""? */
- if ( strcmp( rule_font_style, "" ) == 0 )
+ if ( ft_strcmp( rule_font_style, "" ) == 0 )
return TRUE;
/* Is font style contained in a class list? */
for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )
{
- if ( strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
{
for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
{
- if ( strcmp( STYLE_CLASS_Rules[i].member[j], "" ) == 0 )
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j], "" ) == 0 )
continue;
- if ( strcmp( STYLE_CLASS_Rules[i].member[j],
- detected_font_style ) == 0 )
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j],
+ detected_font_style ) == 0 )
return TRUE;
}
}
diff --git a/thirdparty/freetype/src/truetype/ttsubpix.h b/thirdparty/freetype/src/truetype/ttsubpix.h
index c68f97ff07..1070bb016f 100644
--- a/thirdparty/freetype/src/truetype/ttsubpix.h
+++ b/thirdparty/freetype/src/truetype/ttsubpix.h
@@ -4,7 +4,7 @@
/* */
/* TrueType Subpixel Hinting. */
/* */
-/* Copyright 2010-2017 by */
+/* Copyright 2010-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/module.mk b/thirdparty/freetype/src/type1/module.mk
index f299d6fe88..3fea5cc16f 100644
--- a/thirdparty/freetype/src/type1/module.mk
+++ b/thirdparty/freetype/src/type1/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type1/rules.mk b/thirdparty/freetype/src/type1/rules.mk
index 97bef288f0..cb1a142860 100644
--- a/thirdparty/freetype/src/type1/rules.mk
+++ b/thirdparty/freetype/src/type1/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type1/t1afm.c b/thirdparty/freetype/src/type1/t1afm.c
index 11a2646fc2..61053d9a64 100644
--- a/thirdparty/freetype/src/type1/t1afm.c
+++ b/thirdparty/freetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1afm.h b/thirdparty/freetype/src/type1/t1afm.h
index 9f62cd013d..cb8d302b4d 100644
--- a/thirdparty/freetype/src/type1/t1afm.h
+++ b/thirdparty/freetype/src/type1/t1afm.h
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1driver.c b/thirdparty/freetype/src/type1/t1driver.c
index c2089947f9..029b410b47 100644
--- a/thirdparty/freetype/src/type1/t1driver.c
+++ b/thirdparty/freetype/src/type1/t1driver.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 driver interface (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,6 +30,8 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_HASH_H
+#include FT_INTERNAL_POSTSCRIPT_PROPS_H
+#include FT_DRIVER_H
#include FT_SERVICE_MULTIPLE_MASTERS_H
#include FT_SERVICE_GLYPH_DICT_H
@@ -37,6 +39,7 @@
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_SERVICE_POSTSCRIPT_INFO_H
+#include FT_SERVICE_PROPERTIES_H
#include FT_SERVICE_KERNING_H
@@ -126,6 +129,7 @@
(FT_Get_MM_Var_Func) T1_Get_MM_Var, /* get_mm_var */
(FT_Set_Var_Design_Func)T1_Set_Var_Design, /* set_var_design */
(FT_Get_Var_Design_Func)T1_Get_Var_Design, /* get_var_design */
+ (FT_Set_Instance_Func) T1_Reset_MM_Blend, /* set_instance */
(FT_Get_Var_Blend_Func) NULL, /* get_var_blend */
(FT_Done_Blend_Func) T1_Done_Blend /* done_blend */
@@ -614,6 +618,18 @@
/*
+ * PROPERTY SERVICE
+ *
+ */
+
+ FT_DEFINE_SERVICE_PROPERTIESREC(
+ t1_service_properties,
+
+ (FT_Properties_SetFunc)ps_property_set, /* set_property */
+ (FT_Properties_GetFunc)ps_property_get ) /* get_property */
+
+
+ /*
* SERVICE LIST
*
*/
@@ -624,6 +640,7 @@
{ FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict },
{ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_TYPE_1 },
{ FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info },
+ { FT_SERVICE_ID_PROPERTIES, &t1_service_properties },
#ifndef T1_CONFIG_OPTION_NO_AFM
{ FT_SERVICE_ID_KERNING, &t1_service_kerning },
@@ -713,7 +730,7 @@
FT_MODULE_DRIVER_SCALABLE |
FT_MODULE_DRIVER_HAS_HINTER,
- sizeof ( FT_DriverRec ),
+ sizeof ( PS_DriverRec ),
"type1",
0x10000L,
diff --git a/thirdparty/freetype/src/type1/t1driver.h b/thirdparty/freetype/src/type1/t1driver.h
index 292786448d..2b1507233d 100644
--- a/thirdparty/freetype/src/type1/t1driver.h
+++ b/thirdparty/freetype/src/type1/t1driver.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type 1 driver interface (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1errors.h b/thirdparty/freetype/src/type1/t1errors.h
index 492dbb4a42..9e0151b957 100644
--- a/thirdparty/freetype/src/type1/t1errors.h
+++ b/thirdparty/freetype/src/type1/t1errors.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1gload.c b/thirdparty/freetype/src/type1/t1gload.c
index aaf19b6dcc..87d40e7566 100644
--- a/thirdparty/freetype/src/type1/t1gload.c
+++ b/thirdparty/freetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -23,6 +23,8 @@
#include FT_INTERNAL_STREAM_H
#include FT_OUTLINE_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
+#include FT_INTERNAL_CFF_TYPES_H
+#include FT_DRIVER_H
#include "t1errors.h"
@@ -37,37 +39,28 @@
#define FT_COMPONENT trace_t1gload
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /********** *********/
- /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/
- /********** *********/
- /********** The following code is in charge of computing *********/
- /********** the maximum advance width of the font. It *********/
- /********** quickly processes each glyph charstring to *********/
- /********** extract the value from either a `sbw' or `seac' *********/
- /********** operator. *********/
- /********** *********/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
static FT_Error
T1_Parse_Glyph_And_Get_Char_String( T1_Decoder decoder,
FT_UInt glyph_index,
- FT_Data* char_string )
+ FT_Data* char_string,
+ FT_Bool* force_scaling )
{
T1_Face face = (T1_Face)decoder->builder.face;
T1_Font type1 = &face->type1;
FT_Error error = FT_Err_Ok;
+ PSAux_Service psaux = (PSAux_Service)face->psaux;
+ const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs;
+ PS_Decoder psdecoder;
+
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_Incremental_InterfaceRec *inc =
face->root.internal->incremental_interface;
#endif
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
+#endif
decoder->font_matrix = type1->font_matrix;
decoder->font_offset = type1->font_offset;
@@ -90,9 +83,56 @@
}
if ( !error )
- error = decoder->funcs.parse_charstrings(
- decoder, (FT_Byte*)char_string->pointer,
- (FT_UInt)char_string->length );
+ {
+ /* choose which renderer to use */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ if ( driver->hinting_engine == FT_HINTING_FREETYPE ||
+ decoder->builder.metrics_only )
+ error = decoder_funcs->parse_charstrings_old(
+ decoder,
+ (FT_Byte*)char_string->pointer,
+ (FT_UInt)char_string->length );
+#else
+ if ( decoder->builder.metrics_only )
+ error = decoder_funcs->parse_metrics(
+ decoder,
+ (FT_Byte*)char_string->pointer,
+ (FT_UInt)char_string->length );
+#endif
+ else
+ {
+ CFF_SubFontRec subfont;
+
+
+ psaux->ps_decoder_init( &psdecoder, decoder, TRUE );
+
+ psaux->t1_make_subfont( FT_FACE( face ),
+ &face->type1.private_dict, &subfont );
+ psdecoder.current_subfont = &subfont;
+
+ error = decoder_funcs->parse_charstrings(
+ &psdecoder,
+ (FT_Byte*)char_string->pointer,
+ (FT_ULong)char_string->length );
+
+ /* Adobe's engine uses 16.16 numbers everywhere; */
+ /* as a consequence, glyphs larger than 2000ppem get rejected */
+ if ( FT_ERR_EQ( error, Glyph_Too_Big ) )
+ {
+ /* this time, we retry unhinted and scale up the glyph later on */
+ /* (the engine uses and sets the hardcoded value 0x10000 / 64 = */
+ /* 0x400 for both `x_scale' and `y_scale' in this case) */
+ ((T1_GlyphSlot)decoder->builder.glyph)->hint = FALSE;
+
+ *force_scaling = TRUE;
+
+ error = decoder_funcs->parse_charstrings(
+ &psdecoder,
+ (FT_Byte*)char_string->pointer,
+ (FT_ULong)char_string->length );
+ }
+ }
+ }
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -126,8 +166,10 @@
FT_UInt glyph_index )
{
FT_Data glyph_data;
- FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
- decoder, glyph_index, &glyph_data );
+ FT_Bool force_scaling = FALSE;
+ FT_Error error = T1_Parse_Glyph_And_Get_Char_String(
+ decoder, glyph_index, &glyph_data,
+ &force_scaling );
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -149,6 +191,23 @@
}
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********** *********/
+ /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/
+ /********** *********/
+ /********** The following code is in charge of computing *********/
+ /********** the maximum advance width of the font. It *********/
+ /********** quickly processes each glyph charstring to *********/
+ /********** extract the value from either a `sbw' or `seac' *********/
+ /********** operator. *********/
+ /********** *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
FT_LOCAL_DEF( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
FT_Pos* max_advance )
@@ -278,6 +337,8 @@
T1_DecoderRec decoder;
T1_Face face = (T1_Face)t1glyph->face;
FT_Bool hinting;
+ FT_Bool scaled;
+ FT_Bool force_scaling = FALSE;
T1_Font type1 = &face->type1;
PSAux_Service psaux = (PSAux_Service)face->psaux;
const T1_Decoder_Funcs decoder_funcs = psaux->t1_decoder_funcs;
@@ -325,7 +386,10 @@
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
( load_flags & FT_LOAD_NO_HINTING ) == 0 );
+ scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
+ glyph->hint = hinting;
+ glyph->scaled = scaled;
t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
error = decoder_funcs->init( &decoder,
@@ -355,13 +419,15 @@
/* now load the unscaled outline */
error = T1_Parse_Glyph_And_Get_Char_String( &decoder, glyph_index,
- &glyph_data );
+ &glyph_data,
+ &force_scaling );
if ( error )
goto Exit;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
glyph_data_loaded = 1;
#endif
+ hinting = glyph->hint;
font_matrix = decoder.font_matrix;
font_offset = decoder.font_offset;
@@ -451,7 +517,7 @@
}
#endif
- if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 )
+ if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling )
{
/* scale the outline and the metrics */
FT_Int n;
diff --git a/thirdparty/freetype/src/type1/t1gload.h b/thirdparty/freetype/src/type1/t1gload.h
index cc4d5e734f..72ef76f6ae 100644
--- a/thirdparty/freetype/src/type1/t1gload.h
+++ b/thirdparty/freetype/src/type1/t1gload.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1load.c b/thirdparty/freetype/src/type1/t1load.c
index f569d6bec3..9dfa637a69 100644
--- a/thirdparty/freetype/src/type1/t1load.c
+++ b/thirdparty/freetype/src/type1/t1load.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -366,14 +366,16 @@
}
- FT_LOCAL_DEF( FT_Error )
- T1_Set_MM_Blend( T1_Face face,
+ static FT_Error
+ t1_set_mm_blend( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
{
PS_Blend blend = face->blend;
FT_UInt n, m;
+ FT_Bool have_diff = 0;
+
if ( !blend )
return FT_THROW( Invalid_Argument );
@@ -405,9 +407,36 @@
result = FT_MulFix( result, factor );
}
- blend->weight_vector[n] = result;
+
+ if ( blend->weight_vector[n] != result )
+ {
+ blend->weight_vector[n] = result;
+ have_diff = 1;
+ }
}
+ /* return value -1 indicates `no change' */
+ return have_diff ? FT_Err_Ok : -1;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ T1_Set_MM_Blend( T1_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords )
+ {
+ FT_Error error;
+
+
+ error = t1_set_mm_blend( face, num_coords, coords );
+ if ( error )
+ return error;
+
+ if ( num_coords )
+ face->root.face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
+
return FT_Err_Ok;
}
@@ -452,6 +481,7 @@
FT_UInt num_coords,
FT_Long* coords )
{
+ FT_Error error;
PS_Blend blend = face->blend;
FT_UInt n, p;
FT_Fixed final_blends[T1_MAX_MM_DESIGNS];
@@ -518,7 +548,28 @@
final_blends[n] = the_blend;
}
- return T1_Set_MM_Blend( face, blend->num_axis, final_blends );
+ error = t1_set_mm_blend( face, blend->num_axis, final_blends );
+ if ( error )
+ return error;
+
+ if ( num_coords )
+ face->root.face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->root.face_flags &= ~FT_FACE_FLAG_VARIATION;
+
+ return FT_Err_Ok;
+ }
+
+
+ /* MM fonts don't have named instances, so only the design is reset */
+
+ FT_LOCAL_DEF( FT_Error )
+ T1_Reset_MM_Blend( T1_Face face,
+ FT_UInt instance_index )
+ {
+ FT_UNUSED( instance_index );
+
+ return T1_Set_MM_Blend( face, 0, NULL );
}
@@ -1266,7 +1317,7 @@
if ( ft_isdigit( *cur ) || *cur == '[' )
{
T1_Encoding encode = &face->type1.encoding;
- FT_Int count, n;
+ FT_Int count, array_size, n;
PS_Table char_table = &loader->encoding_table;
FT_Memory memory = parser->root.memory;
FT_Error error;
@@ -1283,13 +1334,12 @@
else
count = (FT_Int)T1_ToInt( parser );
- /* only composite fonts (which we don't support) */
- /* can have larger values */
+ array_size = count;
if ( count > 256 )
{
- FT_ERROR(( "parse_encoding: invalid encoding array size\n" ));
- parser->root.error = FT_THROW( Invalid_File_Format );
- return;
+ FT_TRACE2(( "parse_encoding:"
+ " only using first 256 encoding array entries\n" ));
+ array_size = 256;
}
T1_Skip_Spaces( parser );
@@ -1305,18 +1355,18 @@
}
/* we use a T1_Table to store our charnames */
- loader->num_chars = encode->num_chars = count;
- if ( FT_NEW_ARRAY( encode->char_index, count ) ||
- FT_NEW_ARRAY( encode->char_name, count ) ||
+ loader->num_chars = encode->num_chars = array_size;
+ if ( FT_NEW_ARRAY( encode->char_index, array_size ) ||
+ FT_NEW_ARRAY( encode->char_name, array_size ) ||
FT_SET_ERROR( psaux->ps_table_funcs->init(
- char_table, count, memory ) ) )
+ char_table, array_size, memory ) ) )
{
parser->root.error = error;
return;
}
/* We need to `zero' out encoding_table.elements */
- for ( n = 0; n < count; n++ )
+ for ( n = 0; n < array_size; n++ )
{
char* notdef = (char *)".notdef";
@@ -1409,11 +1459,14 @@
len = (FT_UInt)( parser->root.cursor - cur );
- parser->root.error = T1_Add_Table( char_table, charcode,
- cur, len + 1 );
- if ( parser->root.error )
- return;
- char_table->elements[charcode][len] = '\0';
+ if ( n < array_size )
+ {
+ parser->root.error = T1_Add_Table( char_table, charcode,
+ cur, len + 1 );
+ if ( parser->root.error )
+ return;
+ char_table->elements[charcode][len] = '\0';
+ }
n++;
}
@@ -2440,6 +2493,24 @@
type1->encoding.num_chars = loader.num_chars;
}
+ /* some sanitizing to avoid overflows later on; */
+ /* the upper limits are ad-hoc values */
+ if ( priv->blue_shift > 1000 || priv->blue_shift < 0 )
+ {
+ FT_TRACE2(( "T1_Open_Face:"
+ " setting unlikely BlueShift value %d to default (7)\n",
+ priv->blue_shift ));
+ priv->blue_shift = 7;
+ }
+
+ if ( priv->blue_fuzz > 1000 || priv->blue_fuzz < 0 )
+ {
+ FT_TRACE2(( "T1_Open_Face:"
+ " setting unlikely BlueFuzz value %d to default (1)\n",
+ priv->blue_fuzz ));
+ priv->blue_fuzz = 1;
+ }
+
Exit:
t1_done_loader( &loader );
return error;
diff --git a/thirdparty/freetype/src/type1/t1load.h b/thirdparty/freetype/src/type1/t1load.h
index 2d86984f0e..03be3f7f93 100644
--- a/thirdparty/freetype/src/type1/t1load.h
+++ b/thirdparty/freetype/src/type1/t1load.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 font loader (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -90,6 +90,10 @@ FT_BEGIN_HEADER
FT_Long* coords );
FT_LOCAL( FT_Error )
+ T1_Reset_MM_Blend( T1_Face face,
+ FT_UInt instance_index );
+
+ FT_LOCAL( FT_Error )
T1_Get_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
diff --git a/thirdparty/freetype/src/type1/t1objs.c b/thirdparty/freetype/src/type1/t1objs.c
index 5ac1292ae0..7333c4c958 100644
--- a/thirdparty/freetype/src/type1/t1objs.c
+++ b/thirdparty/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -21,6 +21,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_IDS_H
+#include FT_DRIVER_H
#include "t1gload.h"
#include "t1load.h"
@@ -379,7 +380,7 @@
/* simplistic and might get some things wrong. For a full-featured */
/* algorithm you might have a look at the whitepaper given at */
/* */
- /* http://blogs.msdn.com/text/archive/2007/04/23/wpf-font-selection-model.aspx */
+ /* https://blogs.msdn.com/text/archive/2007/04/23/wpf-font-selection-model.aspx */
/* get style name -- be careful, some broken fonts only */
/* have a `/FontName' dictionary entry! */
@@ -578,9 +579,42 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- T1_Driver_Init( FT_Module driver )
+ T1_Driver_Init( FT_Module module )
{
- FT_UNUSED( driver );
+ PS_Driver driver = (PS_Driver)module;
+
+ FT_UInt32 seed;
+
+
+ /* set default property values, cf. `ftt1drv.h' */
+#ifdef T1_CONFIG_OPTION_OLD_ENGINE
+ driver->hinting_engine = FT_HINTING_FREETYPE;
+#else
+ driver->hinting_engine = FT_HINTING_ADOBE;
+#endif
+
+ driver->no_stem_darkening = TRUE;
+
+ driver->darken_params[0] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X1;
+ driver->darken_params[1] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y1;
+ driver->darken_params[2] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X2;
+ driver->darken_params[3] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y2;
+ driver->darken_params[4] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X3;
+ driver->darken_params[5] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y3;
+ driver->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
+ driver->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
+
+ /* compute random seed from some memory addresses */
+ seed = (FT_UInt32)( (FT_Offset)(char*)&seed ^
+ (FT_Offset)(char*)&module ^
+ (FT_Offset)(char*)module->memory );
+ seed = seed ^ ( seed >> 10 ) ^ ( seed >> 20 );
+
+ driver->random_seed = (FT_Int32)seed;
+ if ( driver->random_seed < 0 )
+ driver->random_seed = -driver->random_seed;
+ else if ( driver->random_seed == 0 )
+ driver->random_seed = 123456789;
return FT_Err_Ok;
}
diff --git a/thirdparty/freetype/src/type1/t1objs.h b/thirdparty/freetype/src/type1/t1objs.h
index 39d26bf8b9..8298e036f4 100644
--- a/thirdparty/freetype/src/type1/t1objs.h
+++ b/thirdparty/freetype/src/type1/t1objs.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -120,12 +120,12 @@ FT_BEGIN_HEADER
FT_Bool hint;
FT_Bool scaled;
- FT_Int max_points;
- FT_Int max_contours;
-
FT_Fixed x_scale;
FT_Fixed y_scale;
+ FT_Int max_points;
+ FT_Int max_contours;
+
} T1_GlyphSlotRec;
diff --git a/thirdparty/freetype/src/type1/t1parse.c b/thirdparty/freetype/src/type1/t1parse.c
index 18dd26434c..8e201e5ef5 100644
--- a/thirdparty/freetype/src/type1/t1parse.c
+++ b/thirdparty/freetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (body). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1parse.h b/thirdparty/freetype/src/type1/t1parse.h
index 3396680d1a..4ac82ae913 100644
--- a/thirdparty/freetype/src/type1/t1parse.h
+++ b/thirdparty/freetype/src/type1/t1parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 parser (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/t1tokens.h b/thirdparty/freetype/src/type1/t1tokens.h
index ca0c55f903..43a65d88ea 100644
--- a/thirdparty/freetype/src/type1/t1tokens.h
+++ b/thirdparty/freetype/src/type1/t1tokens.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 tokenizer (specification). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type1/type1.c b/thirdparty/freetype/src/type1/type1.c
index 81795376ef..72eff59bfe 100644
--- a/thirdparty/freetype/src/type1/type1.c
+++ b/thirdparty/freetype/src/type1/type1.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 1 driver component (body only). */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/module.mk b/thirdparty/freetype/src/type42/module.mk
index 2f52806808..3d4732bb6f 100644
--- a/thirdparty/freetype/src/type42/module.mk
+++ b/thirdparty/freetype/src/type42/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2017 by
+# Copyright 2002-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type42/rules.mk b/thirdparty/freetype/src/type42/rules.mk
index d7e8965015..9325d3898f 100644
--- a/thirdparty/freetype/src/type42/rules.mk
+++ b/thirdparty/freetype/src/type42/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2002-2017 by
+# Copyright 2002-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/type42/t42drivr.c b/thirdparty/freetype/src/type42/t42drivr.c
index 366cfb3a1d..f579b2708c 100644
--- a/thirdparty/freetype/src/type42/t42drivr.c
+++ b/thirdparty/freetype/src/type42/t42drivr.c
@@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42drivr.h b/thirdparty/freetype/src/type42/t42drivr.h
index 1ac4a0a1a1..3667f3e066 100644
--- a/thirdparty/freetype/src/type42/t42drivr.h
+++ b/thirdparty/freetype/src/type42/t42drivr.h
@@ -4,7 +4,7 @@
/* */
/* High-level Type 42 driver interface (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42error.h b/thirdparty/freetype/src/type42/t42error.h
index fda92abf57..e3978a7607 100644
--- a/thirdparty/freetype/src/type42/t42error.h
+++ b/thirdparty/freetype/src/type42/t42error.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 error codes (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42objs.c b/thirdparty/freetype/src/type42/t42objs.c
index 1c4ebd768a..66e5c40382 100644
--- a/thirdparty/freetype/src/type42/t42objs.c
+++ b/thirdparty/freetype/src/type42/t42objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 objects manager (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42objs.h b/thirdparty/freetype/src/type42/t42objs.h
index eb4c5bf69f..3bad5135e0 100644
--- a/thirdparty/freetype/src/type42/t42objs.h
+++ b/thirdparty/freetype/src/type42/t42objs.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 objects manager (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42parse.c b/thirdparty/freetype/src/type42/t42parse.c
index e7c6770bd2..4813d1f3f9 100644
--- a/thirdparty/freetype/src/type42/t42parse.c
+++ b/thirdparty/freetype/src/type42/t42parse.c
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (body). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42parse.h b/thirdparty/freetype/src/type42/t42parse.h
index 7a68606f2e..f35d23de63 100644
--- a/thirdparty/freetype/src/type42/t42parse.h
+++ b/thirdparty/freetype/src/type42/t42parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (specification). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/t42types.h b/thirdparty/freetype/src/type42/t42types.h
index 2306ab6c77..d0aa2de570 100644
--- a/thirdparty/freetype/src/type42/t42types.h
+++ b/thirdparty/freetype/src/type42/t42types.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 font data types (specification only). */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/type42/type42.c b/thirdparty/freetype/src/type42/type42.c
index ae8ac26782..6a89cfbed1 100644
--- a/thirdparty/freetype/src/type42/type42.c
+++ b/thirdparty/freetype/src/type42/type42.c
@@ -4,7 +4,7 @@
/* */
/* FreeType Type 42 driver component. */
/* */
-/* Copyright 2002-2017 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/winfonts/fnterrs.h b/thirdparty/freetype/src/winfonts/fnterrs.h
index 4251021a70..3a86af5aac 100644
--- a/thirdparty/freetype/src/winfonts/fnterrs.h
+++ b/thirdparty/freetype/src/winfonts/fnterrs.h
@@ -4,7 +4,7 @@
/* */
/* Win FNT/FON error codes (specification only). */
/* */
-/* Copyright 2001-2017 by */
+/* Copyright 2001-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/thirdparty/freetype/src/winfonts/module.mk b/thirdparty/freetype/src/winfonts/module.mk
index ffc53a19f9..13f9077cfc 100644
--- a/thirdparty/freetype/src/winfonts/module.mk
+++ b/thirdparty/freetype/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/winfonts/rules.mk b/thirdparty/freetype/src/winfonts/rules.mk
index 73e825d9ae..d694d1a771 100644
--- a/thirdparty/freetype/src/winfonts/rules.mk
+++ b/thirdparty/freetype/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2017 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/thirdparty/freetype/src/winfonts/winfnt.c b/thirdparty/freetype/src/winfonts/winfnt.c
index 4c47962319..36bd3148d5 100644
--- a/thirdparty/freetype/src/winfonts/winfnt.c
+++ b/thirdparty/freetype/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2003 Huw D M Davies for Codeweavers */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
diff --git a/thirdparty/freetype/src/winfonts/winfnt.h b/thirdparty/freetype/src/winfonts/winfnt.h
index 884b645a2d..4885c9d745 100644
--- a/thirdparty/freetype/src/winfonts/winfnt.h
+++ b/thirdparty/freetype/src/winfonts/winfnt.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2017 by */
+/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
/* */
diff --git a/thirdparty/glad/KHR/khrplatform.h b/thirdparty/glad/KHR/khrplatform.h
index 1ad3554a76..975bbffed6 100644
--- a/thirdparty/glad/KHR/khrplatform.h
+++ b/thirdparty/glad/KHR/khrplatform.h
@@ -2,7 +2,7 @@
#define __khrplatform_h_
/*
-** Copyright (c) 2008-2009 The Khronos Group Inc.
+** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -26,18 +26,16 @@
/* Khronos platform-specific types and definitions.
*
- * $Revision: 32517 $ on $Date: 2016-03-11 02:41:19 -0800 (Fri, 11 Mar 2016) $
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
- * Please submit changes by sending them to the public Khronos Bugzilla
- * (http://khronos.org/bugzilla) by filing a bug against product
- * "Khronos (general)" component "Registry".
- *
- * A predefined template which fills in some of the bug fields can be
- * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
- * must create a Bugzilla login first.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c
index c2aaea2144..8f8b2189ec 100644
--- a/thirdparty/glad/glad.c
+++ b/thirdparty/glad/glad.c
@@ -1,6 +1,6 @@
/*
- OpenGL loader generated by glad 0.1.18a0 on Mon Mar 5 18:43:52 2018.
+ OpenGL loader generated by glad 0.1.20a0 on Fri May 4 21:44:11 2018.
Language/Generator: C/C++
Specification: gl
@@ -27,21 +27,40 @@
static void* get_proc(const char *namez);
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
static HMODULE libGL;
typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
+#ifdef _MSC_VER
+#ifdef __has_include
+ #if __has_include(<winapifamily.h>)
+ #define HAVE_WINAPIFAMILY 1
+ #endif
+#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
+ #define HAVE_WINAPIFAMILY 1
+#endif
+#endif
+
+#ifdef HAVE_WINAPIFAMILY
+ #include <winapifamily.h>
+ #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ #define IS_UWP 1
+ #endif
+#endif
+
static
int open_gl(void) {
+#ifndef IS_UWP
libGL = LoadLibraryW(L"opengl32.dll");
if(libGL != NULL) {
gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress(
libGL, "wglGetProcAddress");
return gladGetProcAddressPtr != NULL;
}
+#endif
return 0;
}
@@ -50,7 +69,7 @@ static
void close_gl(void) {
if(libGL != NULL) {
FreeLibrary((HMODULE) libGL);
- libGL = NULL;
+ libGL = NULL;
}
}
#else
@@ -113,7 +132,7 @@ void* get_proc(const char *namez) {
}
#endif
if(result == NULL) {
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
result = (void*)GetProcAddress((HMODULE) libGL, namez);
#else
result = dlsym(libGL, namez);
diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h
index 9de720fbc2..4eebad4f2f 100644
--- a/thirdparty/glad/glad/glad.h
+++ b/thirdparty/glad/glad/glad.h
@@ -1,6 +1,6 @@
/*
- OpenGL loader generated by glad 0.1.18a0 on Mon Mar 5 18:43:52 2018.
+ OpenGL loader generated by glad 0.1.20a0 on Fri May 4 21:44:11 2018.
Language/Generator: C/C++
Specification: gl
@@ -1581,7 +1581,7 @@ GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap);
GLAPI PFNGLISENABLEDPROC glad_glIsEnabled;
#define glIsEnabled glad_glIsEnabled
-typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far);
+typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange;
#define glDepthRange glad_glDepthRange
typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);