text:
Super Mario Maker 3DS Review: Make-a-Mario
A level creator, and 100 new Mario levels come to the 3DS in what could be the plumber's last 3DS platforming outing.
21st December, 2016By Ian Morris
Game Info // Super Mario Maker 3DS
Save Slots: 1
Subtitles: Partial
Available On: 3DS
Genre: Platform (2D)
Perhaps it's something to do with Nintendo's next console, the Switch, being a home console/handheld hybrid, but the big N seem to have developed a bit of a "thing" for bringing their often under appreciated Wii U games to 3DS as of late. With the incredible Yoshi's Woolly World set to see a 3DS remake in February, Nintendo have got the Wii U port ball rolling early with Super Mario Maker 3DS - a handheld version of its level creation tool that released in the middle of 2015, with a few extras bolted on to keep handheld players happy.
The level editor is intuitive, and perfectly suited to the 3DS.
Although we may have only just said it, it's actually doing Mario Maker a bit of a disservice to describe as being just a level creator, as there's a lot more to take in here. Along with the fully featured level editor, you've also got a collection of 100 brand new, Nintendo created levels to play through in a mode called Super Mario Challenge - not to mention the ability to download the best of the user created courses, and play them on the go.
But as it's the "maker" side of things that gets the title treatment, it's probably best if we start by taking a look at the level creator itself, as it's undoubtedly one impressive piece of kit. While the legendary designed Shigeru Miyamoto may have sketched out the very first Mario levels by hand on graph paper, before programming them into a computer, Super Mario Maker 3DS makes creating your very own levels that much easier, as all you really have to do is drag a few components around using the 3DS's touch screen.
With several handy toolbars providing access to all the Mario components you could ever hope for, from rotating flame barriers, to pipes, goombas, koopa troopers and everything in between, almost anyone will be able to build - and play - their very own Mario level in a matter of minutes. It really is that simple. Shaping land and platforms, adding enemies, hiding coin blocks, and even adding warp doors is as simple as choosing it from the menu, and dragging it into place on the Touch Screen. It's intuitive, and the very definition of pick up and play - and being able to switch to playing your newly created level at the touch of a button, without any loading times makes testing a lot easier.
It's also ever so slightly bonkers. While Mario games usually stick to a specific set of rules, with enemies that work in certain ways, and that can only be found in certain places, Super Mario Maker turns all those rules on their head. If you want a giant Koopa, you can! If you want to hide that giant Koopa inside a question mark block, knock yourself out. Want to pepper your underwater level with Goombas? Why not! They can't technically swim, but in Mario Maker they can! How about creating stacks of enemies of different types, that wonder through the levels? No problem! It's completely insane, but also really refreshing, providing a markedly different take on the traditional Mario experience.
You can give your level one of four themes at the touch of a button - Super Mario Bros, Super Mario 3, Super Mario World, or New Super Mario Bros.
Of course, there's more to making a Mario level than just adding a few goombas and a finish flag - but luckily, Super Mario Maker 3DS has a fantastic tutorial to talk you through the basics - and beyond! While the Wii U version was a little bit light on anything in the way of instructions, there's a genuinely fantastic series of mini-lessons here, that take you through everything from the basics of placing items, to how to ensure your level is actually fun to play. It even goes through the psychology of item placement, and how to add obstacles without frustrating players, giving you a fascinating insight into how the mind of a Nintendo level designer works. As you'd expect, even the tutorials are done with the usual Nintendo flare, though - you'll be guided through the basics by Mashiko, a helpful female assistant, and Yamamura, a sometimes grumpy pigeon who also happens to be a master Mario level designer. Obviously.
However, one of the best bits of the Wii U version was the ability to upload, and share your very own levels with the rest of the world - yet, weirdly, that's pretty much the only feature that's been removed for the 3DS version. There's no real need for them to have removed it, either, as you can still download created challenges - you just can't upload yours for the world to play. Instead, you'll have to rely on simply sharing levels with either folks you know locally via local wireless, or with strangers via StreetPass, which doesn't seem quite as cool as uploading a level for the world to see...
Creating levels is fun - it's just a shame you can't share them easily with your friends
That said, there's a lot more here for the discerning Mario player, rather than creator to get stuck into - a whole 100 new levels, in fact. The Super Mario Challenge mode does exactly what it says on the tin, providing 18 worlds of Mario goodness like you've never played before. Making full use of all the new, weird Mario Maker abilities - like cannons that fire coins (or enemies), or the aforementioned giant enemies - this is a genuinely unusual selection of levels that break all the Mario rules.
In and of themselves, the Super Mario Challenge levels aren't too bad - but it's certainly possible to make them a lot harder. Each level has two special medals you can earn, by completing a certain challenge - and these very quickly ramp the difficulty up. One level consists entirely of stacks of goombas with a piranha plant on top - you can earn one medal for defeating only the goombas, and getting to the end, and the other for defeating only piranha plants. Other challenges ask you to defeat a certain number of enemies with Racoon Mario's tail, reach a goal without using a warp pipe (forcing you to look for other, hidden routes through the level), or set you an incredibly hard speed run target that'll test your Mario skills to their limits
The other main "play", rather than "create" mode, is the 100 Mario Challenge, an online only mode that asks you to complete a randomly chosen sequence of user created levels, with only 100 lives to burn through. We say "only", as the levels the game gives you are often immensely hard, or, as you may expect for a random selection of levels, incredibly weird - sometimes, you'll have to sit for a while just trying to figure out what to do.
Why is a chain chomp driving the Bowser Jr mobile?
But there's also an incredible selection of Mario levels out there, which are a lot of fun to play. As with anything like this, if you give the community the keys to your game, they'll soon figure out ways to use the same set of building blocks that you'd never even have dreamt of - and that's certainly the case here. While one level may exploit how the Mushroom Kingdom's gravity works (seemingly, Mario falls faster than other objects, so one level sees you having to jump off a cliff, and race a falling block to the bottom, before leaping up onto the block as it falls, mid-flight, to get through a door suspended in mid-air), others work like incredible Rube Goldberg machines, and simply require you to sit back and watch as an incredible series of chain reactions happen, somehow getting Mario past a huge number of obstacles, completely unscathed, taking paths through the level you wouldn't even think are possible. It's totally insane - and totally brilliant.
However, Mario Maker 3DS does fall down in a few areas. The fact you can't upload your own creations is a bit annoying, while the inability to truly search levels grates too. For some reason, the only levels you can download here are a selection of "recommended" user created levels, rather than having access to the whole hog. While that has pluses and minuses, as it at least cuts out the crap, it would still be nice to be able to at least browse the whole caboodle.
Still, with a great level editor that's packed with innovative features, and a collection of 100 levels that'll make you view Mario in a completely different way, there's a lot to like about Mario Maker 3DS. If you haven't got enough Mario platforming in your life, get this, and you'll never feel that way again.
Mario Made
Super Mario Challenge really is challenging
Some incredible user created levels out there to try
Huge supply of Mario fun
Can't share levels online
Can't browse user created levels properly
May be a bit limited if you're not into level creation
Parents! Looking for more info? Check out our quick parent's guide to Super Mario Maker 3DS for all you need to know!
Get Super Mario Maker 3DS from
Unravel 2 Review
The woollen wonder returns, with more physics puzzles, and new co-op support
Genre(s): Platform (2D), Puzzle
Yoku's Island Express Review - Pinball Postal Service
Saving an island from destruction, one delivery at a time in this cutesy pinball adventure
Kirby: Star Allies Review - With A Little Help From My Friends
The Kirbster's Switch debut is a friendly little platformer
Sonic Mania Review - Retro Zone
The blue blur returns in a old school inspired platformer - so get a load of this
Hey! Pikmin Review: One small step
The little guys return in a 3DS adventure that's unlike any Pikmin game you've ever played
LocoRoco Remastered Review
Sony's tilty turny blob-themed PSP platformer makes a return
Platform(s): PS4


text:
Uniformed Youth Group Biography: Sir Francis Fletcher Vane (England, 1861-1934)
Sir Francis Vane was a fascinating character in Edwardian England and the post World War I era. He is today a little known individual who played a major role in shaping the Boy Scout movement. Vane was an interestig character, with wide ranging and seemingly contradictory passions and interests. He was an peer of the realm, an aristocrat with democratic as well as socialist and republican sympathies. He was a career soldier who spoke against war. He was a loyal imperialist who challenged jingoism and the demonising of the enemy. He was eventually fired from the army because of his efforts to prevent a cover up of a number of military murders in Dublin after the 1916 Easter Rising. Vane's life in many ways parallells that of Baden-Powell, but they were individuals of very different outlook. Vane played a major role in founding the British Boy Scouts, an assocaition with anti-militarism sympathies which presented a major challenge to Baden Powell's Boy Scout Association. Although Vane's British Boy Scouts were largely absorbed into Baden-Powell's mobement, Vane's influence played a mahor role in directing the Scouts into becoming a less militaristic and more internationalist movement. Vane later played a major role in founding the Italian Boy Scouts.
Francis was born in Dublin to an Irish mother and an English father. He grew up in Sidmouth, Devon, but we have no details about his childhood at this time.
Vane entered Oxford Military College in 1876. This is not a college we know much about. The British military academy is Standhurst. We do not know how the Oxford Military College related to Standhurst, but attendance was an alternative of entering the British army. We note that several prominent Victorians and Edwardians attended the Oxford Military Academy. The College no long exists, but I'm not sure when it was closed.
Vane began his army career in 1883, serving with the Worcester Militia and Scots Guards. He also served with the Submarine Mining Regiment. He was appointed Captain in the 26th Middlesex Cyclists in 1888. Vaner served in South Africa through most of second Boer War (1899-1902). He was appointed a magistrate in 1902, but was soon dismissed because he was considered to be too 'pro-Boer' in his judgements.
Working Boys Cadet Corps
Vane showed an interest in youth groups at an early stage of his life. As a resident at Toynbee Hall in East London, he organized a Working Boys Cadet Corps in 1886. East Londn was a working class area and there were few recreational oportunities for working class boys at the time. Such a organization was quite different than the middle-class oriented Boys Scouts later to ne founded by Baden Powel, another army officer. I'm not sure what kind of uniform, if any, the Working Boys Cadet Corps had.
Anti-war Movement
Vane in 1903 after his Boer War experiences wrote pamphlet attacking British war methods which was published by the South African Newspaper Company. He worked as a correspondent in South Africa for: Daily News, Manchester Guardian, Westminster, and Truth. Vane published a book expanding on his earlier pamphlet, Pax Britannica in South Africa. He ran as a Liberal Party candidate for Burton on Trent in the 1906 General Election. In the years leading up to World War I, Vane was active in antiwar and suffragette campaigns. He published another book in 1909, On Certain Fundamentals which was a review of his political and philosophical outlooks. It shows a man with an inquiring, but ften undisciplined mind. No doubt a good editor would have assisted him. Even friends agreed that his ideas ranged from throughly sound to extrondiarily strange.
British Boy Scouts
I am not sure to what extent Vane knew Baden Powell. Given their many similarities (military, Boer War, and youth group experiences) one would think that they would have known each other and exchanged exoeriences. Vane was appointed London Commissioner of Scouts in Baden Powell's Boy Scout Association. This resumably reflected in experience working with youth groups in East London. He was eventually fired for taking initiatives. I am not sure to what extent he discussed the issues involved with Baden Powell. Vane alone when many other Scout organizers were concerned with what they saw as the milutarization of the Scout movement. He became President of the rival British Boy Scouts (BBS), merging with the Boys Life Brigade to form the National Peace Scouts. The BBS presented a major challenge to the BSA. Vane introduced a Girls Scout Troop into the BBS, a departure from Baden Powell's BSA which decided to remain only for boys, but incouraging a separate organization for girls--the Girl Guides. He also pursued an active international agenda and in 1911 helped to found the first international Scout organization, the World Order of Scouting. Because of Vane's bankruptsy in 1912, however, the BBS as a major Scout group was ruined. While the BBS was no longer a threat to the BSA, Vane's effort to spread the movement abroad appears to have had an influence on Baden Powell who was to later persue this objective energentically.
Like many Britons, Vane fell in love with Italy and traveled widely there. He liked to winter in Italy and bough a home Bagni di Lucca in the Alps. He published a book, Walks and Peoples in 1908. He helped to found the Italian Boy Scouts, The Ragazzi Esploratori Italiani, in 1910 as part of his work with the BBS. Vane founded a Scout troop at the local school near hs winter home. It proved very popular and the movement spread, especially after gaining the approval and support of the Catholic Church. Vane worked with Italian educator Remo Molinari to found the Ragatzi Exploratori which were also called the Boy Scouts della Pace (Peace Boy Scouts. The official ceremony was held July 12, 1910 at Lucca in Tuscany. The press coverage and the subsequent presence of King Vittorio Emanuelle III at San Rossore on November 6, 1910 gave helped to publicise the Scout movement in Italy. As a result, new troops called Kagazzi Patrioti were founded in Lucca, Pisa and Florence. Soon the movement spread to other Italian cities.
World War I (1914-18)
Vane wrote The Other Illusions in 1914. The book was published by the National Labour Press, only 3 weeks before the World War I erupted. The title was suggested by Norman Angell in reference to his book The Illusions of War which addressed the economic aspects of war. Vane's addressed the romantic and philosophical justifications of war. Vane published on Principles of Military Art in 1916-17. He wrote a more interesting book on the the 1916 Irish revolt in Dublin, The Easter Rising, but the Army Censor prevented publication and there unfortunately are no intact manuscripts surviving. He also wrote War Stories, describing incidents from South Africa, World War I and the EasterUprising which was also suppressed by the Censor.
The Easter Rebellion (1916)
Vane served on the Western Front and was then posted to Ireland in 1916. He led the defense of the Portobello Barracks in Dublin when the Easter Uprising occurred. He was appalled by the savegery of some British soldiers. He tried to have Captain Bowen-Colhurst arrested for murder of Francis Sheehy Skeffington. Bowen-Colhurst ordered the summary execution of Skeffington and two others despite the fact that there were no charges and no proof of complicity in the Uprising. Vane was outraged when he heard that Bowen-Colthurst was allowed to carry out his duties as if nothing had happened. Army offuicials in Dublin refused to take action. Vane took leave and went to London and reported the incident directly to the War Office. Bowen-Colhurst was arrested, but the result was Vane himself was discahrged from the Army.
Post War Years
Vane chaired meetings for Labour and Liberal candidates during the 1918 General Election. He moved to Itlay in 1918 where he active support the Italian Scout movement. He left his beloved Italy in 1927 after Musolini's Fascists suppressed the Scout movement. Vane wrote Tox, Or Everyboy in 1924. It was for his wife who was dying. The book was privately published privately in Italy. His final book was the autobiographical Agin The Governments - Memories and Adventures of Sir Francis Fletcher Vane which he published in 1934. Sir Francis died in 1934. He was 73 years old. His death was little remembered by the Scouting movement in which he played such an important role.
Working Class Movement, "Sir Francis Patrick Fletcher Vane, Bt." Working Class Movement Library, undated.
Navigate the Historic Boys' Uniform Web Site:
[Return to the Main biography page]
[Activities] [Biographies] [Chronologies] [Countries] [Essays] [Garments] [Organizations] [Religion] [Other]
[Introduction] [Bibliographies] [Contributions] [FAQs] [Questions] [Unknown images]
[Boys' Uniform Home]
Navigate the Historic Boys' Uniform Web organizatiion pages:
[Boys' Brigade] [Camp Fire] [Hitler Youth] [National] [Pioneers] [Royal Rangers] [Scout]

redpajama_set_name: RedPajamaCommonCrawl


text:
How should we restructure 'first responder' emergency services in a world where they're now the second responders?
It's fairly widely acknowledged throughout the emergency community that due to the rise in citizen use of technology, emergency services are now rarely the first on the scene of a disaster.
Most emergencies are first publicly highlighted on Twitter, Facebook, Instagram or another social media platforms as people proximate to the situation take photos and share messages, often even before anyone bothers to call an emergency hotline.
Once information about an emergency is shared online it can attract individuals, to assist or gawk, and by the time a 'First Responder' reaches the scene, there may be teams working to rectify the situation, whether officially qualified or not.
For large emergency and disaster scenarios, online systems may also appear with surprising rapidity. Donation-taking sites, rehousing services, advice and support lines and even running video and text commentary can be in place within minutes of a significant disaster.
The effect of this is that emergency services are no longer the first responders to the majority of emergencies, and often arrive at a scene with less information about the situation than citizens have already collected and shared online.
Even where citizens are not the first onsite, they may still become a major channel for sharing information - correct or not - about the emergency, as was observed during the Boston Marathon bombing (refer to the trailer for a new documentary on this below).
So how should emergency services and governments respond to an environment when they are no longer the first responders?
While there's been some discussion of this across the emergency community, there's been precious few changes to the protocols or approaches of emergency services to take advantage of their new status in a positive way.
Other than discouraging citizens from getting involved (as they're not qualified and may take the wrong steps), and a few efforts to bring some citizen social media intelligence into emergency centres, there's been little done to provide new tools and systems for supporting voluntary emergency support activities by the general public.
Some of this, perhaps most of this, is related to slow change within these services. It's hard for lifelong emergency service specialists to acknowledge that their role is changing - some still struggle with some of the modern tools for managing emergencies, let along with groups of citizens pitching in to help.
Some is also undoubtably connected with the risks of having unskilled volunteers onsite at some of the worst disasters. Many people don't understand or appreciate the potential dangers they face, or the complications they can cause to emergency services should a well-intentioned effort to help become another person needing rescue and resources.
However this situation is not likely to go away. Citizens are now firmly established as the first people onscene in most emergencies, and it is impractical to expect that at least some of them won't try to help and illogical to expect that no-one will broadcast unfolding events via digital channels.
It is a good time for emergency services to consider how to direct all that volunteer energy in productive ways. What tasks can citizens do at the site of a situation that will help pave the way for the 'second responder' emergency services when they arrive?
These tasks are likely to change by emergency type, however it is possible to provide basic guidance via social channels and via apps as to what steps will help preserve lives and property rather than increase the danger and difficulty of given emergencies.
With the right approach and support tools, emergency services can enlist citizens as a support workforce, able to set a perimeter, collect location-specific data and even, where safe, help address and transport the injured to appropriate services, allowing emergency workers to concentrate on the more difficult wounds and tasks.
Tools such as a 'Tinder' app for medical professionals could help quickly locate appropriately qualified personnel nearby who can lend a hand, prior or after emergency services arrive. The same approach could be used for people with specific skills useful in emergencies - from former and off-duty firefighter to army reservists, specialists in communication or the use of specific tools.
There's likely a range of other approaches that can be used to help direct the energy of the general public into supporting emergency services in effective ways, and its time for emergency services to unbend, recognise that the environment has changed, and think outside the square as to how citizens can be more than dangerous nuisances at an emergency scene.
The real risk now is that emergency services cling to their past 'first responder' status and dismiss the skills and capabilities of the public. This will only increase the danger in future scenarios where well-meaning citizens, denied effective leadership and instruction by emergency professionals, take unnecessary risks when helping emergency victims and scale up the extent of these disasters.
Regardless of whether emergency services choose to recognise that they're no longer the first responders in most disasters, or keep their heads firmly in the sand, we're likely to continue to see citizens be the first responders, and once on-scene helping in the ways they think they can and should.
Whether these citizens are assets or liabilities in any specific emergency comes down to how the professional emergency services support and lead them, but they will come none-the-less.
Tags: citizen, communication, community, crowd source, emergency, engagement, gov2au


The following is a list of Course Concentrations, within which specific courses have been categorized by the Law School's Faculty. Please note that many courses appear under more than one Concentration.
The purpose of these Course Concentrations is to provide students with some additional guidance in making course selections. In particular, students may have a specific area (or areas) of legal interest or a desire to practice in a certain field of law. The Course Concentrations can help such students decide which courses may be best suited for their objectives.
It is important to emphasize that selecting and adhering to a Course Concentration is not required. Furthermore, these Concentrations are intended to supplement, rather than replace, traditional academic advising provided by the Law School's Faculty and/or Director of Academic Enhancement.


Rail relays ensure electrical isolation between sensor and controller.
The braking control is one of the safety-related systems of a train. Depending on the application, intelligent additional functions can be integrated into the braking control, such as load-dependent braking or emergency braking equipment. To this end, in the event of emergency braking, disc brakes are supported by additional braking systems.
Special relay modules from Phoenix Contact are used to control auxiliary braking systems. In order to activate the auxiliary brake, for example a magnet rail brake, several requirements must be met first: rotary transducers on the carriage axle continuously detect the travel speed and evaluate this.
From a defined speed, a signal is sent to the rail relay. The electromechanical relay switches through and forwards the 24 V DC signal to the central controller. Furthermore, the relay ensures electrical isolation between the field sensor and the controller.
The electrical interference signals, or transients, which are common in rail vehicles, are filtered out. As such, the central controller is protected from surge voltage and overcurrent and all safety-related functions of the system can run without errors.
The reliable switching of the rail relays is ensured, thanks to hard gold plated contacts. The plating prevents oxidic contamination layers forming on the contacts. However, this is just one of the features of a rail relay, as gold contacts are also used in other industrial applications where small loads and signals have to be switched.
When it comes to special relays, the PLC.../21RW module must initially conform to the EN 50155 railway standard. Electromechanical relays usually have to conform to EN 61810.
The rail relays are equipped with an extended temperature and input voltage range. This is one of the requirements of EN 50155, as the high demands placed on the ambient temperature play an important role in practical operation.
Control cabinets for the braking control are installed in the rail cars below passenger level in the underfloor vehicle body. The vehicle body is made of steel and is not heat-insulated. Depending on the time of year and location where the train is used, the temperatures inside the vehicle body can differ greatly from ambient temperatures encountered in industrial applications.
In extreme cases, an input voltage up to 125 percent of the nominal voltage can occur simultaneously as an increased ambient temperature of up to +70°C. Due to the high voltage, more current flows through the relay module, which results in increased self-heating. Faced with a high ambient temperature simultaneously, a normal relay module would quickly fail.
rail relays from Phoenix Contact are used in an extremely wide range of applications in rail vehicles, for example in the vacuum-operated toilet controllers. The relay, as the link between the field level and the central controller, provides electrical isolation.
The relays developed specially for the railway industry, with their narrow modular design of just 6.2 mm, can be plugged in flexibly and are therefore easy to maintain.


Robert R. Rogers, DMD, DABDSM: Dr. Rob Rogers is uniquely qualified to manage snoring and obstructive sleep apnea with oral appliances.
Does Pittsburgh Dental Sleep Medicine accept your insurance?
Learn how we can help with Snoring and Sleep Apnea.
See the Professionals of Pittsburgh Dental Sleep Medicine.


text:
Quique Dacosta plans premium paella restaurant in London
By Mark Wingett
27-Jan-2017 - Last updated on 20-Dec-2017 at 12:37 GMT
Related tags: Spain
Quique Dacosta, the Spanish chef with three Michelin stars, is to launch a new premium paella concept in London, backed by the team behind the Iberica chain of restaurants.
According to BigHospitality's sister publication MCA, Dacosta hopes to launch the first of a group of restaurants under the name InPaella in the capital by the end of this year/at the start of 2018, before looking to expand the concept to further major cities around the world.
The new venture is backed by former Carluccio's chairman and current Iberica director Stephen Gee; Iberica founder Marcos Fernandez and the restaurant chain's finance director Sarah Winter.
It is thought that Fernandez will help oversee the project. It is understood that the new venture is looking to initially raise £4m to aid the opening of six restaurants under the new concept over the next five years.
The new restaurant will feature 25 metres of stoves where people can sample traditional Spanish paella.
The project is supported by Paul Weldon Browne, who has worked with Zuma, Roka, La Petite Maison and The Arts Club, and is also a shareholder in the project.
Dacosta's eponymous restaurant in Spain cames 49th in the latest World's 50 Best Restaurants list. Dacosta started at El Poblet – a family-run seafood restaurant in Denia, near Alicante – when he was just 17, working his way up to head chef, before taking over the business entirely.
Related topics: Business, People, Restaurants, Dining trends
Quique Dacosta's London restaurant to open in 2019
Carluccio's confirms CVA plan with 34 restaurants under threat
Carluccio's expected to announce CVA
Quique Dacosta closes in on site for London paella restaurant


Each year millions of empty ink and toner cartridges are discarded after use with most ending up in landfills. To put this in perspective, if the cartridges are recycled, instead of throwing away ruthlessly, greater amount of plastic and metal could be saved annually. Thus, ink cartridge recycling has virtually become identical with successful sustainable development. Reuse is the highest form of recycling which is why re-manufacturing is the ideal way to give used inkjet and toner cartridges a new life- which saves the poor inkjet and toner cartridges from being dumped in a landfill where it takes more than 1,000 years for the cartridge to decompose.
• It is environmentally friendly since it reduces air and water pollution/emissions associated with land filling or the manufacturing of new cartridges.
• It preserves our natural resources such as natural oil, timber, water, and minerals by reducing the need for raw materials.
• Recycling decreases emission of greenhouse gases that has an impact on global climate change.
• It helps us protect our environment for future generations.
An additional good thing about the recycling of used ink cartridges is that it cuts on your printing expense. When you choose to recycle empty units instead of buying a new one, you are actually making a big saving on your purchase. You no longer feel ripped off every time you print. Moreover, recycling cartridges can also be good for fundraising activity for schools, churches and charity organizations.
« Are Expired Printer Ink Cartridges Still be Used?


Where is Crypta Balbi in Italy?
Crypta Balbi is situated in the region Lazio in Italy!
Here you will find the location of Crypta Balbi on a map.
All places in the world called Crypta Balbi.
Where is Crypta Balbi on the map?
Where is Crypta Balbi relative to other places?
Top 10 cities in Lazio and distance from Crypta Balbi.
Top 10 cities in Italy and distance from Crypta Balbi.


From Ecole Polytechnique Fédérale de Lausanne (EPFL), CH-1015 Lausanne, Switzerland; Harvard University, Cambridge, MA 02138; Politecnico di Milano, 20133 Milano, Italy; and Princeton University, Princeton, NJ 08544.
The article by Tuite and colleagues (1) proposed a spatially explicit scheme reproducing the sequence and the timing of regional cholera epidemics through waterborne and person-to-person transmission of cholera. Two additional modeling studies of the ongoing Haiti cholera outbreak and its controls were independently and almost simultaneously published (2, 3). In particular, a similar transmission model, based on a finer spatial detail of the affected communities and on alternative descriptions of hydrologic and human mobility drivers of pathogen dispersal (4, 5), has been likewise applied to the unfolding Haiti epidemic (3). Despite differences in the assumptions, the results regarding the effect of control strategies, such as vaccination and sanitation, are similar. However, the article by Bertuzzo and colleagues (3) pointed out that larger intervention efforts involve nontrivial effects, with sanitation exhibiting a threshold-like behavior in effectiveness.
Published: Ann Intern Med. 2011;155(6):403-404.


YARMOUTH — A gardening initiative launched six years ago at William H. Rowe School came full circle last week.
Seventh-graders from Harrison Middle School who first planted tulips in Rowe School's Rainbow Garden in 2012 returned to help first-graders replenish it Oct. 25.
The middle-schoolers also each brought along their favorite children's book to read to their first-grade partners and completed an origami project with the younger students.
The idea for the inter-school collaboration was sparked when Amy Sinclair, the parent of a seventh-grader involved in planting the original garden, visited Rowe School last year.
"I thought, 'we should totally replant the garden,'" she said.
Joan Adler, principal of Harrison Middle School, echoed that sentiment. She said she thought the collaboration was a "spectacular" idea and spoke to the benefits of giving students mentorship opportunities.
The middle school has a buddy program between fifth- and eighth-grade students, she said, designed by eighth-grade teachers years ago. Participants meet once a month to "go on adventures" and work together.
She said such instances build empathy and understanding in students.
Adler added she is grateful to Sinclair for creating the opportunity and the two schools will "see where it goes" in the years to come.
First-grade teacher Jean Lee, who supervised while her class made origami tulips with the seventh-grade guests Thursday, said she also thinks the collaboration is beneficial because of how little time students spend at Rowe School.
First-grader Tino James, left, and seventh-grade student Sam Bradford plant tulips together at the William H. Rowe School's Rainbow Garden Oct. 25 in Yarmouth. Behind them, parent volunteer Amy Sinclair helps two students.
Seventh-grade students from Harrison Middle School returned to William H. Rowe School Oct. 25 to help first-graders replant the school's Rainbow Garden. The seventh-graders planted the original garden in 2012.


text:
Self-Promotion: Pro and Con on the Individual Healthcare Mandate
I was featured in Monday's L.A. Times "pro and con" article on the individual healthcare mandate. Here's a key bit:
The point of the individual mandate is to balance the risk pool, but that's not really what insurance is supposed to do. With car insurance, the idea is not that you want good drivers to pay for accidents caused by bad drivers. Instead, you want there to be pools of people with similar risk: bad drivers and good drivers who pay different premiums.
I notice that a couple of commenters have taken issue with this argument, essentially saying "OF COURSE insurance is supposed to balance risk!" They're mistaken. But this is a point worth dwelling on, because it's easy to get confused.
Everyone knows that insurance does "balance risk" in a certain sense. It transfers wealth from those who have been fortunate (e.g., didn't get in a car accident, didn't have a house fire) to those less fortunate (e.g., did get in a car accident, did have a house fire). The premiums paid by everyone get paid out to a small group ex post. But ex ante, every policyholder could have experienced either outcome. To make this worthwhile for all buyers, they have to be pooled with other buyers who have similar risk. Otherwise, some buyers will find that it's just not worth it: their risk is too low to justify the high premiums.
This is very different from trying to "balance risk" in the sense of balancing low-risk policyholders with high-risk policyholders and charging them similar premiums. This approach creates a cross-subsidy from some policyholders to others ex ante. That is, even before we know which people will experience an unfortunate outcome, some policyholders are getting a much better deal than others. That's why some buyers drop out of the insurance pool -- because they're getting a lousy deal. Hence the demand for the individual mandate: it's needed to rope in the people who would rather opt out.
As a matter of terminology, the former should be called "risk pooling" and the latter "risk balancing"; using the same term for both just creates confusion. And as a matter of historical and economic fact, the insurance business arose primarily to do risk pooling. The idea that insurance should engage in risk-balancing is almost exclusive to healthcare, and it's assuredly the result of decades of government efforts to force insurance to accomplish policy goals that were no part of its origin.
Brandon Bertelsen said...
Switzerland has a system where everyone is forced to pay for mandatory insurance. (http://en.wikipedia.org/wiki/Healthcare_in_Switzerland) Balancing risk, risk pooling - whatever you want to call it - the net effect is to make healthcare less expensive for everyone as it only represents 10.8% of GDP in comparison to almost 16% for USA. (or may that litmus test of cost is a bit to broad)
jimbino said...
I would be helpful to point out that, whether in risk pooling or risk balancing, it is stupid for the average non-risk-averse person to participate. The rational risk-averse person would only willingly participate if he held private information of his higher-than average risk of loss.
While the payout for roulette is around 96%, the payout for flood insurance is around 60%, for health and car insurance around 50%, and for title insurance around 2%, making insurance one of the worst games of chance the average person could participate in.
Jimbino -- I don't think that's exactly right.
You're correct that non-risk-averse people won't participate -- but true risk lovers are actually pretty darn rare, so it's not clear how relevant this is. The overwhelming majority of people are risk averse.
Then you say, "The rational risk-averse person would only willingly participate if he held private information of his higher-than average risk of loss." This is not necessarily true. The essence of risk aversion is a willingness to accept a lower expected value (that is, pay a premium) in return for the avoidance of risk. So, for instance, suppose you have a population of identical (risk-averse) people facing an identical risk. It would be perfectly possible to construct an insurance policy that all of these people would accept, even if the insurance policy's price were higher than the expected loss.
You are correct, however, that some risk-averse people will drop out of the insurance pool if their risk-aversion is mild enough. And as the insurance premium rises relative to the true expected loss, more and more risk averse people will drop out.
And nobody takes into consideration the problem of Amerikan expatriates and even tourists, who would presumably have to carry useless insurance while they are traveling or residing in a foreign country, where not even Amerikan drugs can be bought or imported with Amerikan insurance proceeds.


Wilmer Valderrama, Gina Rodriguez, Eva Longoria and Roselyn Sanchez are raising awareness in Mexico.
The stars all gathered as part of a delegation on Saturday (March 9) to visit families and children seeking asylum in the United States in Tijuana, Mexico.
Kerry Washington, America Ferrera, Kendrick Sampson, Ryan Piers Williams, Angela Robinson and Paola Mendoza joined Jess Morales Rocketto, chair of Families Belong Together, Mexico Project director Soraya Vazquez and Ai-Jen Poo, co-chair of Families Belong Together and executive director of the National Domestic Workers Alliance in a delegation organized and hosted by Families Belong Together.
The delegation is part of the ongoing activism efforts of Harness, an organization co-founded by America, Ryan and Wilmer to engage artists in social change.
The day started at a local shelter, the Espacio Migrante family shelter, where artists interacted with over 20 children from Honduras, El Salvador and Guatemala, and received a detailed overview of current conditions from shelter leadership and residents. Families from shelters Roca and Camino de salvación also joined.
The delegation also participated in activities with children including distributing Coloring Without Borders coloring books and spoke with women who were participating in female empowerment workshops in honor of International Women's Day, helping to distribute supply packs provided by Baby2Baby. They also visited a Border Crossing to observe the asylum turn-in process.
The Families Belong Together coalition includes nearly 250 different groups comprising tens of thousands of Americans from all backgrounds who have joined together to fight family separation and promote dignity, unity, and compassion for all children and families.


text:
#include "ofxTrueTypeFontUC.h"
//--------------------------

#include "ft2build.h"
#include "freetype2/freetype/freetype.h"
#include "freetype2/freetype/ftglyph.h"
#include "freetype2/freetype/ftoutln.h"
#include "freetype2/freetype/fttrigon.h"

#ifdef TARGET_LINUX
#include <fontconfig/fontconfig.h>
#endif

#include <algorithm>

#include "ofUtils.h"
#include "ofGraphics.h"
#include "ofAppRunner.h"
#include "ofPoint.h"
#include "ofConstants.h"
#include "ofTexture.h"
#include "ofMesh.h"
#include "Poco/TextConverter.h"
#include "Poco/UTF8Encoding.h"

//--------------------------------------------------
typedef struct {
  int character;
  int height;
  int width;
  int setWidth;
  int topExtent;
  int leftExtent;
  float tW, tH;
  float x1, x2, y1, y2;
  float t1, t2, v1, v2;
} charPropsUC;

static bool printVectorInfo = false;
static int ttfGlobalDpi = 96;

//========================================================
class ofxTrueTypeFontUC::Impl {
public:
  Impl(){};
  ~Impl(){};

  bool bLoadedOk;
  bool bAntiAliased;
  float lineHeight;
  float letterSpacing;
  float spaceSize;
  int fontSize;
  bool bMakeContours;
  float simplifyAmt;
  int dpi;
  int border;
  string filename;
  bool binded;
  ofTextEncoding encoding;

  GLint blend_src, blend_dst;
  GLboolean blend_enabled;
  GLboolean texture_2d_enabled;
  ofMesh stringQuads;

  typedef struct FT_LibraryRec_ * FT_Library;
  typedef struct FT_FaceRec_ * FT_Face;
  FT_Library library;
  FT_Face face;
  bool librariesInitialized = false;

  bool loadFontFace(string fontname);

  static const unsigned int kLimitCharactersNum = 10000;
  static const unsigned int kTypeFaceUnloaded = 0;

  vector<unsigned int> loadedChars;
  vector<charPropsUC> cps;  // properties for each character
  vector <ofPath> charOutlines;
  vector <ofPath> charOutlinesNonVFlipped;
  vector<ofTexture> texAtlas;

  void drawChar(const unsigned int &charID, float x, float y);
  void drawCharAsShape(const unsigned int &charID, float x, float y);
  ofPath getCharacterAsPoints(const unsigned int &charID, bool vflip=ofIsVFlipped());

  unsigned int getCharID(const unsigned int &);
  bool loadChar(const unsigned int &);
  void bind(const unsigned int &);
  void unbind(const unsigned int &);

#if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS)
  void ofxUnloadAllFontTextures();
  void ofxReloadAllFontTextures();
#endif

  void unloadTextures();
  bool initLibraries();
  void finishLibraries();
};

//--------------------------------------------------------
void ofxTrueTypeFontUC::setGlobalDpi(int newDpi){
  ttfGlobalDpi = newDpi;
}

//--------------------------------------------------------
static ofPath makeContoursForCharacter(FT_Face &face);
static ofPath makeContoursForCharacter(FT_Face &face){
  int nContours = face->glyph->outline.n_contours;
  int startPos = 0;

  char * tags = face->glyph->outline.tags;
  FT_Vector * vec = face->glyph->outline.points;

  ofPath charOutlines;
  charOutlines.setUseShapeColor(false);

  for (int k = 0; k < nContours; k++) {
    if ( k > 0 ) {
      startPos = face->glyph->outline.contours[k-1]+1;
    }
    int endPos = face->glyph->outline.contours[k]+1;

    if (printVectorInfo) {
      ofLogNotice("ofxTrueTypeFontUC") << "--NEW CONTOUR";
    }

    //vector <ofPoint> testOutline;
    ofPoint lastPoint;

    for (int j = startPos; j < endPos; j++) {

      if ( FT_CURVE_TAG(tags[j]) == FT_CURVE_TAG_ON ) {
        lastPoint.set((float)vec[j].x, (float)-vec[j].y, 0);
        if (printVectorInfo) {
          ofLogNotice("ofxTrueTypeFontUC") << "flag[" << j << "] is set to 1 - regular point - " << lastPoint.x <<  lastPoint.y;
        }
        charOutlines.lineTo(lastPoint/64);

      }
      else {
        if (printVectorInfo) {
          ofLogNotice("ofxTrueTypeFontUC") << "flag[" << j << "] is set to 0 - control point";
        }

        if (FT_CURVE_TAG(tags[j]) == FT_CURVE_TAG_CUBIC) {
          if (printVectorInfo) {
            ofLogNotice("ofxTrueTypeFontUC") << "- bit 2 is set to 2 - CUBIC";
          }

          int prevPoint = j-1;
          if ( j == 0) {
            prevPoint = endPos-1;
          }

          int nextIndex = j+1;
          if ( nextIndex >= endPos) {
            nextIndex = startPos;
          }

          ofPoint nextPoint((float)vec[nextIndex].x, -(float)vec[nextIndex].y);

          //we need two control points to draw a cubic bezier
          bool lastPointCubic =  (FT_CURVE_TAG(tags[prevPoint]) != FT_CURVE_TAG_ON) && (FT_CURVE_TAG(tags[prevPoint]) == FT_CURVE_TAG_CUBIC);

          if (lastPointCubic) {
            ofPoint controlPoint1((float)vec[prevPoint].x, (float)-vec[prevPoint].y);
            ofPoint controlPoint2((float)vec[j].x, (float)-vec[j].y);
            ofPoint nextPoint((float) vec[nextIndex].x, -(float) vec[nextIndex].y);

            //cubic_bezier(testOutline, lastPoint.x, lastPoint.y, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, nextPoint.x, nextPoint.y, 8);
            charOutlines.bezierTo(controlPoint1.x/64, controlPoint1.y/64, controlPoint2.x/64, controlPoint2.y/64, nextPoint.x/64, nextPoint.y/64);
          }
        }
        else {
          ofPoint conicPoint((float)vec[j].x, -(float)vec[j].y);

          if (printVectorInfo) {
            ofLogNotice("ofxTrueTypeFontUC") << "- bit 2 is set to 0 - conic- ";
            ofLogNotice("ofxTrueTypeFontUC") << "--- conicPoint point is " << conicPoint.x << conicPoint.y;
          }

          //If the first point is connic and the last point is connic then we need to create a virutal point which acts as a wrap around
          if (j == startPos) {
            bool prevIsConnic = (FT_CURVE_TAG( tags[endPos-1]) != FT_CURVE_TAG_ON) && (FT_CURVE_TAG( tags[endPos-1]) != FT_CURVE_TAG_CUBIC);

            if (prevIsConnic) {
              ofPoint lastConnic((float)vec[endPos - 1].x, (float)-vec[endPos - 1].y);
              lastPoint = (conicPoint + lastConnic) / 2;

              if (printVectorInfo) {
                ofLogNotice("ofxTrueTypeFontUC") << "NEED TO MIX WITH LAST";
                ofLogNotice("ofxTrueTypeFontUC") << "last is " << lastPoint.x << " " << lastPoint.y;
              }
            }
          }

          int nextIndex = j+1;
          if (nextIndex >= endPos) {
            nextIndex = startPos;
          }

          ofPoint nextPoint((float)vec[nextIndex].x, -(float)vec[nextIndex].y);

          if (printVectorInfo) {
            ofLogNotice("ofxTrueTypeFontUC") << "--- last point is " << lastPoint.x << " " <<  lastPoint.y;
          }

          bool nextIsConnic = (FT_CURVE_TAG( tags[nextIndex] ) != FT_CURVE_TAG_ON) && (FT_CURVE_TAG( tags[nextIndex]) != FT_CURVE_TAG_CUBIC);

          //create a 'virtual on point' if we have two connic points
          if (nextIsConnic) {
            nextPoint = (conicPoint + nextPoint) / 2;
            if (printVectorInfo) {
              ofLogNotice("ofxTrueTypeFontUC") << "|_______ double connic!";
            }
          }
          if (printVectorInfo) {
            ofLogNotice("ofxTrueTypeFontUC") << "--- next point is " << nextPoint.x << " " << nextPoint.y;
          }

          //quad_bezier(testOutline, lastPoint.x, lastPoint.y, conicPoint.x, conicPoint.y, nextPoint.x, nextPoint.y, 8);
          charOutlines.quadBezierTo(lastPoint.x/64, lastPoint.y/64, conicPoint.x/64, conicPoint.y/64, nextPoint.x/64, nextPoint.y/64);

          if (nextIsConnic) {
            lastPoint = nextPoint;
          }
        }
      }

      //end for
    }
    charOutlines.close();
  }

  return charOutlines;
}

#if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS)
#include <set>
static set<ofxTrueTypeFontUC*> & all_fonts(){
  static set<ofxTrueTypeFontUC*> *all_fonts = new set<ofxTrueTypeFontUC*>;
  return *all_fonts;
}

void ofxUnloadAllFontTextures(){
  set<ofxTrueTypeFontUC*>::iterator it;
  for (it=all_fonts().begin(); it!=all_fonts().end(); ++it) {
    (*it)->unloadTextures();
  }
}

void ofxReloadAllFontTextures(){
  set<ofxTrueTypeFontUC*>::iterator it;
  for (it=all_fonts().begin(); it!=all_fonts().end(); ++it) {
    (*it)->reloadFont();
  }
}
#endif

#ifdef TARGET_OSX
static string osxFontPathByName( string fontname ){
  CFStringRef targetName = CFStringCreateWithCString(NULL, fontname.c_str(), kCFStringEncodingUTF8);
  CTFontDescriptorRef targetDescriptor = CTFontDescriptorCreateWithNameAndSize(targetName, 0.0);
  CFURLRef targetURL = (CFURLRef) CTFontDescriptorCopyAttribute(targetDescriptor, kCTFontURLAttribute);
  string fontPath = "";

  if (targetURL) {
    UInt8 buffer[PATH_MAX];
    CFURLGetFileSystemRepresentation(targetURL, true, buffer, PATH_MAX);
    fontPath = string((char *)buffer);
    CFRelease(targetURL);
  }

  CFRelease(targetName);
  CFRelease(targetDescriptor);

  return fontPath;
}
#endif

#ifdef TARGET_WIN32
#include <map>
// font font face -> file name name mapping
static map<string, string> fonts_table;
// read font linking information from registry, and store in std::map
static void initWindows(){
  LONG l_ret;

  const wchar_t *Fonts = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";

  HKEY key_ft;
  l_ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, Fonts, 0, KEY_QUERY_VALUE, &key_ft);
  if (l_ret != ERROR_SUCCESS) {
    ofLogError("ofxTrueTypeFontUC") << "initWindows(): couldn't find fonts registery key";
    return;
  }

  DWORD value_count;
  DWORD max_data_len;
  wchar_t value_name[2048];
  BYTE *value_data;

  // get font_file_name -> font_face mapping from the "Fonts" registry key

  l_ret = RegQueryInfoKeyW(key_ft, NULL, NULL, NULL, NULL, NULL, NULL, &value_count, NULL, &max_data_len, NULL, NULL);
  if (l_ret != ERROR_SUCCESS) {
    ofLogError("ofxTrueTypeFontUC") << "initWindows(): couldn't query registery for fonts";
    return;
  }

  // no font installed
  if (value_count == 0) {
    ofLogError("ofxTrueTypeFontUC") << "initWindows(): couldn't find any fonts in registery";
    return;
  }

  // max_data_len is in BYTE
  value_data = static_cast<BYTE *>(HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, max_data_len));
  if (value_data == NULL) return;

  char value_name_char[2048];
  char value_data_char[2048];
  /*char ppidl[2048];
   char fontsPath[2048];
   SHGetKnownFolderIDList(FOLDERID_Fonts, 0, NULL, &ppidl);
   SHGetPathFromIDList(ppidl,&fontsPath);*/
  string fontsDir = getenv ("windir");
  fontsDir += "\\Fonts\\";
  for (DWORD i = 0; i < value_count; ++i) {
    DWORD name_len = 2048;
    DWORD data_len = max_data_len;

    l_ret = RegEnumValueW(key_ft, i, value_name, &name_len, NULL, NULL, value_data, &data_len);
    if (l_ret != ERROR_SUCCESS) {
      ofLogError("ofxTrueTypeFontUC") << "initWindows(): couldn't read registry key for font type";
      continue;
    }

    wcstombs(value_name_char,value_name,2048);
    wcstombs(value_data_char,reinterpret_cast<wchar_t *>(value_data),2048);
    string curr_face = value_name_char;
    string font_file = value_data_char;
    curr_face = curr_face.substr(0, curr_face.find('(') - 1);
    fonts_table[curr_face] = fontsDir + font_file;
  }

  HeapFree(GetProcessHeap(), 0, value_data);

  l_ret = RegCloseKey(key_ft);
}

static string winFontPathByName( string fontname ){
  if (fonts_table.find(fontname)!=fonts_table.end()) {
    return fonts_table[fontname];
  }
  for (map<string,string>::iterator it = fonts_table.begin(); it!=fonts_table.end(); it++) {
    if (ofIsStringInString(ofToLower(it->first),ofToLower(fontname)))
      return it->second;
  }
  return "";
}
#endif

#ifdef TARGET_LINUX
static string linuxFontPathByName(string fontname){
  string filename;
  FcPattern * pattern = FcNameParse((const FcChar8*)fontname.c_str());
  FcBool ret = FcConfigSubstitute(0,pattern,FcMatchPattern);
  if (!ret) {
    ofLogError() << "linuxFontPathByName(): couldn't find font file or system font with name \"" << fontname << "\"";
    return "";
  }
  FcDefaultSubstitute(pattern);
  FcResult result;
  FcPattern * fontMatch=NULL;
  fontMatch = FcFontMatch(0,pattern,&result);

  if (!fontMatch) {
    ofLogError() << "linuxFontPathByName(): couldn't match font file or system font with name \"" << fontname << "\"";
    return "";
  }
  FcChar8 *file;
  if (FcPatternGetString (fontMatch, FC_FILE, 0, &file) == FcResultMatch) {
    filename = (const char*)file;
  }
  else {
    ofLogError() << "linuxFontPathByName(): couldn't find font match for \"" << fontname << "\"";
    return "";
  }
  return filename;
}
#endif

bool ofxTrueTypeFontUC::Impl::initLibraries(){
  if (!librariesInitialized) {
    FT_Error err;
    err = FT_Init_FreeType( &library );

    if (err) {
      ofLogError("ofxTrueTypeFontUC") << "loadFont(): couldn't initialize Freetype lib: FT_Error " << err;
      return false;
    }
#ifdef TARGET_LINUX
    FcBool result = FcInit();
    if (!result) {
      return false;
    }
#endif
#ifdef TARGET_WIN32
    initWindows();
#endif
    librariesInitialized = true;
  }
  return true;
}

void ofxTrueTypeFontUC::Impl::finishLibraries(){
  if (librariesInitialized) {
#ifdef TARGET_LINUX
    //FcFini();
#endif
    FT_Done_FreeType(library);
  }
}

//------------------------------------------------------------------
ofxTrueTypeFontUC::ofxTrueTypeFontUC(){
  mImpl = new Impl();
  mImpl->bLoadedOk = false;
  mImpl->bMakeContours = false;

#if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS)
  all_fonts().insert(this);
#endif
  mImpl->letterSpacing = 1;
  mImpl->spaceSize = 1;

  // 3 pixel border around the glyph
  // We show 2 pixels of this, so that blending looks good.
  // 1 pixels is hidden because we don't want to see the real edge of the texture

  mImpl->border = 3;

  mImpl->stringQuads.setMode(OF_PRIMITIVE_TRIANGLES);
  mImpl->binded = false;
}

//------------------------------------------------------------------
ofxTrueTypeFontUC::~ofxTrueTypeFontUC(){

  if (mImpl->bLoadedOk) {
    mImpl->unloadTextures();
  }

#if defined(TARGET_ANDROID) || defined(TARGET_OF_IOS)
  all_fonts().erase(this);
#endif

  if (mImpl != NULL)
    delete mImpl;
}

void ofxTrueTypeFontUC::Impl::unloadTextures(){
  if (!bLoadedOk) return;

  texAtlas.clear();
  charOutlines.clear();
  charOutlinesNonVFlipped.clear();
  loadedChars.clear();
  cps.clear();

  bLoadedOk = false;
}

void ofxTrueTypeFontUC::reloadFont(){
  loadFont(mImpl->filename, mImpl->fontSize, mImpl->bAntiAliased, mImpl->bMakeContours, mImpl->simplifyAmt, mImpl->dpi);
}

bool ofxTrueTypeFontUC::Impl::loadFontFace(string fontname){
  filename = ofToDataPath(fontname,true);
  ofFile fontFile(filename, ofFile::Reference);
  int fontID = 0;
  if (!fontFile.exists()) {
#ifdef TARGET_LINUX
    filename = linuxFontPathByName(fontname);
#elif defined(TARGET_OSX)
    if (fontname==OF_TTFUC_SANS) {
      fontname = "Helvetica Neue";
      fontID = 4;
    }
    else if (fontname==OF_TTFUC_SERIF) {
      fontname = "Times New Roman";
    }
    else if (fontname==OF_TTFUC_MONO) {
      fontname = "Menlo Regular";
    }
    filename = osxFontPathByName(fontname);
#elif defined(TARGET_WIN32)
    if (fontname==OF_TTFUC_SANS) {
      fontname = "Arial";
    }
    else if (fontname==OF_TTFUC_SERIF) {
      fontname = "Times New Roman";
    }
    else if (fontname==OF_TTFUC_MONO) {
      fontname = "Courier New";
    }
    filename = winFontPathByName(fontname);
#endif
    if (filename == "" ) {
      ofLogError("ofxTrueTypeFontUC") << "loadFontFace(): couldn't find font \"" << fontname << "\"";
      return false;
    }
    ofLogVerbose("ofxTrueTypeFontUC") << "loadFontFace(): \"" << fontname << "\" not a file in data loading system font from \"" << filename << "\"";
  }
  FT_Error err;
  err = FT_New_Face( library, filename.c_str(), fontID, &face );
  if (err) {
    // simple error table in lieu of full table (see fterrors.h)
    string errorString = "unknown freetype";
    if(err == 1) errorString = "INVALID FILENAME";
    ofLogError("ofxTrueTypeFontUC") << "loadFontFace(): couldn't create new face for \"" << fontname << "\": FT_Error " << err << " " << errorString;
    return false;
  }

  return true;
}

//-----------------------------------------------------------
bool ofxTrueTypeFontUC::loadFont(const string &_filename, int _fontSize, bool _bAntiAliased, bool _makeContours, float _simplifyAmt, int _dpi){
  mImpl->initLibraries();

  //------------------------------------------------
  if (mImpl->bLoadedOk == true) {
    // we've already been loaded, try to clean up :
    mImpl->unloadTextures();
  }
  //------------------------------------------------

  if (_dpi == 0) {
    _dpi = ttfGlobalDpi;
  }

  mImpl->bLoadedOk = false;
  mImpl->bAntiAliased = _bAntiAliased;
  mImpl->fontSize = _fontSize;
  mImpl->bMakeContours = _makeContours;
  mImpl->simplifyAmt = _simplifyAmt;
  mImpl->dpi = _dpi;

  mImpl->encoding = OF_ENCODING_UTF8;

  //--------------- load the library and typeface
  if (!mImpl->loadFontFace(_filename)) {
    return false;
  }

  FT_Set_Char_Size( mImpl->face, mImpl->fontSize << 6, mImpl->fontSize << 6, mImpl->dpi, mImpl->dpi);
  mImpl->lineHeight = mImpl->fontSize * 1.43f;

  //------------------------------------------------------
  //kerning would be great to support:
  //ofLogNotice("ofxTrueTypeFontUC") << "FT_HAS_KERNING ? " <<  FT_HAS_KERNING(face);
  //------------------------------------------------------

  if (mImpl->bMakeContours) {
    mImpl->charOutlines.clear();
  }

  // ------------- get default space size
  unsigned int charID = mImpl->getCharID('p');
  mImpl->loadChar(charID);

  // ------------- close the library and typeface
  mImpl->bLoadedOk = true;
  return true;
}

bool ofxTrueTypeFontUC::Impl::loadChar(const unsigned int &charID){
  //------------------------------------------ anti aliased or not:
  FT_Error err = FT_Load_Glyph( face, FT_Get_Char_Index( face, loadedChars[charID] ), FT_LOAD_DEFAULT );
  if (err) {
    ofLogError("ofxTrueTypeFontUC") << "loadChar(): FT_Load_Glyph failed for code point " << loadedChars[charID] << ": FT_Error " << err;
    return false;
  }

  if (bAntiAliased == true)
    FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);
  else
    FT_Render_Glyph(face->glyph, FT_RENDER_MODE_MONO);

  //------------------------------------------
  FT_Bitmap& bitmap= face->glyph->bitmap;

  // prepare the texture:
  /*int width  = ofNextPow2( bitmap.width + border*2 );
   int height = ofNextPow2( bitmap.rows  + border*2 );

   // ------------------------- this is fixing a bug with small type
   // ------------------------- appearantly, opengl has trouble with
   // ------------------------- width or height textures of 1, so we
   // ------------------------- we just set it to 2...
   if (width == 1) width = 2;
   if (height == 1) height = 2;*/

  if (bMakeContours) {
    if (printVectorInfo) {
      ofLogNotice("ofxTrueTypeFontUC") <<  "code point " << loadedChars[charID];
    }

    charOutlines[charID] = makeContoursForCharacter( face );

    charOutlinesNonVFlipped[charID] = charOutlines[charID];
    charOutlinesNonVFlipped[charID].translate(ofVec3f(0,cps[charID].height));
    charOutlinesNonVFlipped[charID].scale(1,-1);

    if (simplifyAmt>0)
      charOutlines[charID].simplify(simplifyAmt);
    charOutlines[charID].getTessellation();

    if (simplifyAmt>0)
      charOutlinesNonVFlipped[charID].simplify(simplifyAmt);
    charOutlinesNonVFlipped[charID].getTessellation();
  }

  // -------------------------
  // info about the character:
  cps[charID].character = loadedChars[charID];
  cps[charID].height = face->glyph->bitmap_top;
  cps[charID].width = face->glyph->bitmap.width;
  cps[charID].setWidth = face->glyph->advance.x >> 6;
  cps[charID].topExtent = face->glyph->bitmap.rows;
  cps[charID].leftExtent = face->glyph->bitmap_left;

  int width = cps[charID].width;
  int height = bitmap.rows;

  cps[charID].tW = width;
  cps[charID].tH = height;

  GLint fheight = cps[charID].height;
  GLint bwidth = cps[charID].width;
  GLint top = cps[charID].topExtent - cps[charID].height;
  GLint lextent = cps[charID].leftExtent;

  GLfloat corr, stretch;

  //this accounts for the fact that we are showing 2*visibleBorder extra pixels
  //so we make the size of each char that many pixels bigger
  stretch = 0;//(float)(visibleBorder * 2);

  corr = (float)(( (fontSize - fheight) + top) - fontSize);

  cps[charID].x1 = lextent + bwidth + stretch;
  cps[charID].y1 = fheight + corr + stretch;
  cps[charID].x2 = (float) lextent;
  cps[charID].y2 = -top + corr;

  // Allocate Memory For The Texture Data.
  ofPixels expanded_data;
  expanded_data.allocate(width, height, 2);
  //-------------------------------- clear data:
  expanded_data.set(0,255); // every luminance pixel = 255
  expanded_data.set(1,0);

  if (bAntiAliased == true) {
    ofPixels bitmapPixels;
    bitmapPixels.setFromExternalPixels(bitmap.buffer, bitmap.width, bitmap.rows, 1);
    expanded_data.setChannel(1, bitmapPixels);
  }
  else {
    //-----------------------------------
    // true type packs monochrome info in a
    // 1-bit format, hella funky
    // here we unpack it:
    unsigned char *src =  bitmap.buffer;
    for (int j=0; j <bitmap.rows;j++) {
      unsigned char b=0;
      unsigned char *bptr =  src;
      for (int k=0; k < bitmap.width ; k++) {
        expanded_data[2*(k+j*width)] = 255;

        if (k%8==0) {
          b = (*bptr++);
        }

        expanded_data[2*(k+j*width) + 1] = b&0x80 ? 255 : 0;
        b <<= 1;
      }
      src += bitmap.pitch;
    }
    //-----------------------------------
  }

  // pack in a texture, algorithm to calculate min w/h from
  // http://upcommons.upc.edu/pfc/bitstream/2099.1/7720/1/TesiMasterJonas.pdf
  //ofLogNotice("ofTrueTypeFont") << "loadFont(): areaSum: " << areaSum
  float alpha = logf((cps[charID].width+border*2) * (cps[charID].height+border*2)) * 1.44269;

  int w = width + 2 * border;
  int h = height + 2 * border;

  ofPixels atlasPixelsLuminanceAlpha;
  atlasPixelsLuminanceAlpha.allocate(w, h, 2);
  atlasPixelsLuminanceAlpha.set(0, 255);
  atlasPixelsLuminanceAlpha.set(1, 0);

  int x=0;
  int y=0;
  int maxRowHeight = cps[charID].tH + border * 2;
  ofPixels & charPixels = expanded_data;

  if (x+cps[charID].tW + border*2>w) {
    x = 0;
    y += maxRowHeight;
    maxRowHeight = cps[charID].tH + border * 2;
  }

  cps[charID].t2 = float(x + border) / float(w);
  cps[charID].v2 = float(y + border) / float(h);
  cps[charID].t1 = float(cps[charID].tW + x + border) / float(w);
  cps[charID].v1 = float(cps[charID].tH + y + border) / float(h);
  charPixels.pasteInto(atlasPixelsLuminanceAlpha,x+border,y+border);

  ofPixels atlasPixels;
  atlasPixels.allocate(atlasPixelsLuminanceAlpha.getWidth(),atlasPixelsLuminanceAlpha.getHeight(),4);
  atlasPixels.setChannel(0,atlasPixelsLuminanceAlpha.getChannel(0));
  atlasPixels.setChannel(1,atlasPixelsLuminanceAlpha.getChannel(0));
  atlasPixels.setChannel(2,atlasPixelsLuminanceAlpha.getChannel(0));
  atlasPixels.setChannel(3,atlasPixelsLuminanceAlpha.getChannel(1));
  texAtlas[charID].allocate(atlasPixels,false);

  if (bAntiAliased && fontSize>20) {
    texAtlas[charID].setTextureMinMagFilter(GL_LINEAR,GL_LINEAR);
  }
  else {
    texAtlas[charID].setTextureMinMagFilter(GL_NEAREST,GL_NEAREST);
  }
  texAtlas[charID].loadData(atlasPixels);

  return true;
}

ofTextEncoding ofxTrueTypeFontUC::getEncoding() const{
  return mImpl->encoding;
}

//-----------------------------------------------------------
bool ofxTrueTypeFontUC::isLoaded(){
  return mImpl->bLoadedOk;
}

//-----------------------------------------------------------
bool ofxTrueTypeFontUC::isAntiAliased(){
  return mImpl->bAntiAliased;
}

//-----------------------------------------------------------
int ofxTrueTypeFontUC::getSize(){
  return mImpl->fontSize;
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::setLineHeight(float _newLineHeight){
  mImpl->lineHeight = _newLineHeight;
}

//-----------------------------------------------------------
float ofxTrueTypeFontUC::getLineHeight(){
  return mImpl->lineHeight;
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::setLetterSpacing(float _newletterSpacing){
  mImpl->letterSpacing = _newletterSpacing;
}

//-----------------------------------------------------------
float ofxTrueTypeFontUC::getLetterSpacing(){
  return mImpl->letterSpacing;
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::setSpaceSize(float _newspaceSize){
  mImpl->spaceSize = _newspaceSize;
}

//-----------------------------------------------------------
float ofxTrueTypeFontUC::getSpaceSize(){
  return mImpl->spaceSize;
}

//------------------------------------------------------------------
unsigned int ofxTrueTypeFontUC::Impl::getCharID(const unsigned int &utf32_codepoint){
  if (loadedChars.size() >= kLimitCharactersNum) {
    ofLog(OF_LOG_ERROR,"ofxTrueTypeFontUC::getCharID - Error : too many typeface already loaded - call reloadFont to reset");
    return 0;
  }

  for (unsigned int i = 0; i < loadedChars.size(); ++i) {
    if (loadedChars[i] == utf32_codepoint) {
      return i;
    }
  }

  if (bMakeContours) {
    charOutlines.push_back(ofPath());
    charOutlinesNonVFlipped.push_back(ofPath());
  }

  loadedChars.push_back(utf32_codepoint);
  cps.push_back(charPropsUC());
  texAtlas.push_back(ofTexture());

  return loadedChars.size() - 1;
}

//------------------------------------------------------------------
ofPath ofxTrueTypeFontUC::Impl::getCharacterAsPoints(const unsigned int &charID, bool vflip){
  if (bMakeContours == false) {
    ofLogError("ofxTrueTypeFontUC") << "getCharacterAsPoints(): contours not created, call loadFont() with makeContours set to true";
    return ofPath();
  }

  if (vflip) {
    return charOutlines[charID];
  }
  else {
    return charOutlinesNonVFlipped[charID];
  }
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::Impl::drawChar(const unsigned int &charID, float x, float y) {
  GLfloat x1, y1, x2, y2;
  GLfloat t1, v1, t2, v2;
  t2 = cps[charID].t2;
  v2 = cps[charID].v2;
  t1 = cps[charID].t1;
  v1 = cps[charID].v1;

  x1 = cps[charID].x1+x;
  y1 = cps[charID].y1;
  x2 = cps[charID].x2+x;
  y2 = cps[charID].y2;

  int firstIndex = stringQuads.getVertices().size();

  if(!ofIsVFlipped()){
    y1 *= -1;
    y2 *= -1;
  }

  y1 += y;
  y2 += y;

  stringQuads.addVertex(ofVec3f(x1, y1));
  stringQuads.addVertex(ofVec3f(x2, y1));
  stringQuads.addVertex(ofVec3f(x2, y2));
  stringQuads.addVertex(ofVec3f(x1, y2));

  stringQuads.addTexCoord(ofVec2f(t1, v1));
  stringQuads.addTexCoord(ofVec2f(t2, v1));
  stringQuads.addTexCoord(ofVec2f(t2, v2));
  stringQuads.addTexCoord(ofVec2f(t1, v2));

  stringQuads.addIndex(firstIndex);
  stringQuads.addIndex(firstIndex + 1);
  stringQuads.addIndex(firstIndex + 2);
  stringQuads.addIndex(firstIndex + 2);
  stringQuads.addIndex(firstIndex + 3);
  stringQuads.addIndex(firstIndex);
}

//-----------------------------------------------------------
vector<ofPath> ofxTrueTypeFontUC::getStringAsPoints(const string &utf8_src, bool vflip){
  vector<ofPath> shapes;

  if (!mImpl->bLoadedOk) {
    ofLogError("ofxTrueTypeFontUC") << "getStringAsPoints(): font not allocated: line " << __LINE__ << " in " << __FILE__;
    return shapes;
  };

  GLint index = 0;
  GLfloat X = 0;
  GLfloat Y = 0;
  int newLineDirection = 1;

  if (!vflip) {
    // this would align multiline texts to the last line when vflip is disabled
    //int lines = ofStringTimesInString(c,"\n");
    //Y = lines*lineHeight;
    newLineDirection = -1;
  }

  basic_string<unsigned int> utf32_src = util::ofxTrueTypeFontUC::convUTF8ToUTF32(utf8_src);
  int len = (int)utf32_src.length();

  while (index < len) {
    unsigned int charID = mImpl->getCharID(utf32_src[index]);
    if (mImpl->cps[charID].character == mImpl->kTypeFaceUnloaded) {
      mImpl->loadChar(charID);
    }
    if (utf32_src[index] == (unsigned int)'\n') {
      Y += mImpl->lineHeight * newLineDirection;
      X = 0;
    }
    else if (utf32_src[index] == (unsigned int)' ') {
      int pID = mImpl->getCharID((unsigned int)'p');
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing * mImpl->spaceSize;
    }
    else {
      shapes.push_back(mImpl->getCharacterAsPoints(charID, vflip));
      shapes.back().translate(ofPoint(X, Y));
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing;
    }
    index++;
  }

  return shapes;
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::Impl::drawCharAsShape(const unsigned int &charID, float x, float y) {
  if (ofIsVFlipped()) {
    ofPath & charRef = charOutlines[charID];
    charRef.setFilled(ofGetStyle().bFill);
    charRef.draw(x,y);
  }
  else {
    ofPath & charRef = charOutlinesNonVFlipped[charID];
    charRef.setFilled(ofGetStyle().bFill);
    charRef.draw(x,y);
  }
}

//-----------------------------------------------------------
float ofxTrueTypeFontUC::stringWidth(const string &c) {
  ofRectangle rect = getStringBoundingBox(c, 0,0);
  return rect.width;
}

ofRectangle ofxTrueTypeFontUC::getStringBoundingBox(const string &utf8_src, float x, float y, Pivot pivot){

  ofRectangle myRect;

  if (!mImpl->bLoadedOk){
    ofLogError("ofxTrueTypeFontUC") << "getStringBoundingBox(): font not allocated";
    return myRect;
  }

  basic_string<unsigned int> utf32_src = util::ofxTrueTypeFontUC::convUTF8ToUTF32(utf8_src);
  int len = (int)utf32_src.length();

  GLint index = 0;
  GLfloat xoffset = 0;
  GLfloat yoffset = 0;
  float minx = -1;
  float miny = -1;
  float maxx = -1;
  float maxy = -1;

  if ( len < 1 || mImpl->cps.empty() ){
    myRect.x = 0;
    myRect.y = 0;
    myRect.width = 0;
    myRect.height = 0;
    myRect   = myRect + getOffset(myRect, pivot);
    return myRect;
  }

  bool bFirstCharacter = true;
  while (index < len) {
    unsigned int charID = mImpl->getCharID(utf32_src[index]);
    if (mImpl->cps[charID].character == mImpl->kTypeFaceUnloaded) {
      mImpl->loadChar(charID);
    }
    if (utf32_src[index] == (unsigned int)'\n') {
      yoffset += mImpl->lineHeight;
      xoffset = 0 ; //reset X Pos back to zero
    }
    else if (utf32_src[index] == (unsigned int)' ') {
      int pID = mImpl->getCharID((unsigned int)'p');
      xoffset += mImpl->cps[pID].setWidth * mImpl->letterSpacing * mImpl->spaceSize;
      // zach - this is a bug to fix -- for now, we don't currently deal with ' ' in calculating string bounding box
    }
    else {
      GLint height = mImpl->cps[charID].height;
      GLint bwidth = mImpl->cps[charID].width * mImpl->letterSpacing;
      GLint top = mImpl->cps[charID].topExtent - mImpl->cps[charID].height;
      GLint lextent = mImpl->cps[charID].leftExtent;
      float x1, y1, x2, y2, corr, stretch;
      stretch = 0;//(float)visibleBorder * 2;
      corr = (float)(((mImpl->fontSize - height) + top) - mImpl->fontSize);
      x1 = (x + xoffset + lextent + bwidth + stretch);
      y1 = (y + yoffset + height + corr + stretch);
      x2 = (x + xoffset + lextent);
      y2 = (y + yoffset + -top + corr);
      xoffset += mImpl->cps[charID].setWidth * mImpl->letterSpacing;
      if (bFirstCharacter == true) {
        minx = x2;
        miny = y2;
        maxx = x1;
        maxy = y1;
        bFirstCharacter = false;
      }
      else {
        if (x2 < minx) minx = x2;
        if (y2 < miny) miny = y2;
        if (x1 > maxx) maxx = x1;
        if (y1 > maxy) maxy = y1;
      }
    }
    index++;
  }

  myRect.x        = minx;
  myRect.y        = miny;
  myRect.width    = maxx-minx;
  myRect.height   = maxy-miny;
  myRect          = myRect + getOffset(myRect, pivot);

  return myRect;
}

//-----------------------------------------------------------
float ofxTrueTypeFontUC::stringHeight(const string &c){
  ofRectangle rect = getStringBoundingBox(c, 0,0);
  return rect.height;
}

//=====================================================================
void ofxTrueTypeFontUC::drawString(const string &utf8_src, float x, float y, Pivot pivot){
  if (!mImpl->bLoadedOk) {
    ofLog(OF_LOG_ERROR,"ofxTrueTypeFontUC::drawString - Error : font not allocated -- line %d in %s", __LINE__,__FILE__);
    return;
  };

  // Adjust alignment
  ofVec2f offset = getOffset(utf8_src, pivot);
  x += offset.x;
  y += offset.y;

  GLint index = 0;
  GLfloat X = x;
  GLfloat Y = y;
  int newLineDirection = 1;

  if (!ofIsVFlipped()) {
    // this would align multiline texts to the last line when vflip is disabled
    //int lines = ofStringTimesInString(c,"\n");
    //Y = lines*lineHeight;
    newLineDirection = -1;
  }

  basic_string<unsigned int> utf32_src = util::ofxTrueTypeFontUC::convUTF8ToUTF32(utf8_src);
  int len = (int)utf32_src.length();

  while (index < len) {
    unsigned int charID = mImpl->getCharID(utf32_src[index]);
    if (mImpl->cps[charID].character == mImpl->kTypeFaceUnloaded) {
      mImpl->loadChar(charID);
    }
    if (utf32_src[index] == (unsigned int)'\n') {
      Y += mImpl->lineHeight * newLineDirection;
      X = x ; //reset X Pos back to zero
    }
    else if (utf32_src[index] == (unsigned int)' ') {
      int pID = mImpl->getCharID((unsigned int)'p');
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing * mImpl->spaceSize;
    }
    else {
      mImpl->bind(charID);
      mImpl->drawChar(charID, X, Y);
      mImpl->unbind(charID);
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing;
    }

    index++;
  }
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::Impl::bind(const unsigned int &charID){
  // we need transparency to draw text, but we don't know
  // if that is set up in outside of this function
  // we "pushAttrib", turn on alpha and "popAttrib"
  // http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/pushattrib.html

  // **** note ****
  // I have read that pushAttrib() is slow, if used often,
  // maybe there is a faster way to do this?
  // ie, check if blending is enabled, etc...
  // glIsEnabled().... glGet()...
  // http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/get.html
  // **************
  // (a) record the current "alpha state, blend func, etc"

  blend_enabled = glIsEnabled(GL_BLEND);
  texture_2d_enabled = glIsEnabled(GL_TEXTURE_2D);
  glGetIntegerv( GL_BLEND_SRC, &blend_src );
  glGetIntegerv( GL_BLEND_DST, &blend_dst );

  // (b) enable our regular ALPHA blending!
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  texAtlas[charID].bind();
  stringQuads.clear();
}

//-----------------------------------------------------------
void ofxTrueTypeFontUC::Impl::unbind(const unsigned int &charID){
  stringQuads.drawFaces();
  texAtlas[charID].unbind();

  if ( !blend_enabled )
    glDisable(GL_BLEND);
  if ( !texture_2d_enabled )
    glDisable(GL_TEXTURE_2D);
  glBlendFunc( blend_src, blend_dst );
}

//=====================================================================
void ofxTrueTypeFontUC::drawStringAsShapes(const string &utf8_src, float x, float y, Pivot pivot){

  if (!mImpl->bLoadedOk) {
    ofLogError("ofxTrueTypeFontUC") << "drawStringAsShapes(): font not allocated: line " << __LINE__ << " in " << __FILE__;
    return;
  };

  //----------------------- error checking
  if (!mImpl->bMakeContours) {
    ofLogError("ofxTrueTypeFontUC") << "drawStringAsShapes(): contours not created for this font, call loadFont() with makeContours set to true";
    return;
  }

  // Adjust alignment
  ofVec2f offset = getOffset(utf8_src, pivot);
  x += offset.x;
  y += offset.y;

  GLint index = 0;
  GLfloat X = x;
  GLfloat Y = y;
  int newLineDirection = 1;

  if (!ofIsVFlipped()) {
    // this would align multiline texts to the last line when vflip is disabled
    //int lines = ofStringTimesInString(c,"\n");
    //Y = lines*lineHeight;
    newLineDirection = -1;
  }

  basic_string<unsigned int> utf32_src = util::ofxTrueTypeFontUC::convUTF8ToUTF32(utf8_src);
  int len = (int)utf32_src.length();

  while (index < len) {
    unsigned int charID = mImpl->getCharID(utf32_src[index]);
    if (mImpl->cps[charID].character == mImpl->kTypeFaceUnloaded) {
      mImpl->loadChar(charID);
    }

    if (utf32_src[index] == (unsigned int)'\n') {
      Y += mImpl->lineHeight * newLineDirection;
      X = x ; //reset X Pos back to zero
    }
    else if (utf32_src[index] == (unsigned int)' ') {
      int pID = mImpl->getCharID((unsigned int)'p');
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing * mImpl->spaceSize;
    }
    else {
      mImpl->drawCharAsShape(charID, X, Y);
      X += mImpl->cps[charID].setWidth * mImpl->letterSpacing;
    }

    index++;
  }
}

//-----------------------------------------------------------
int ofxTrueTypeFontUC::getNumCharacters() {
  return mImpl->loadedChars.size();
}

//-----------------------------------------------------------
ofVec2f ofxTrueTypeFontUC::getOffset(const string &s, Pivot pivot) {
  ofRectangle r = getStringBoundingBox(s, 0, 0);
  return getOffset(r, pivot);
}

ofVec2f ofxTrueTypeFontUC::getOffset(const ofRectangle &r, Pivot pivot) {
  if(pivot == NONE)return ofVec2f();
  switch (pivot) {
    case TOP_LEFT:
      return ofVec2f(0, floor(-r.y ) );
    case TOP_CENTER:
      return ofVec2f( floor(-r.x - r.width * 0.5f), floor(-r.y ) );
    case TOP_RIGHT:
      return ofVec2f( 2.0 * floor(-r.x - r.width * 0.5f), floor(-r.y ) );
    case MIDDLE_LEFT:
      return ofVec2f( 0, floor(-r.y - r.height * 0.5f) );
    case MIDDLE_CENTER:
      return ofVec2f( floor(-r.x - r.width * 0.5f), floor(-r.y - r.height * 0.5f) );
    case MIDDLE_RIGHT:
      return ofVec2f( 2.0 * floor(-r.x - r.width * 0.5f), floor(-r.y - r.height * 0.5f) );
    case BOTTOM_LEFT:
      return ofVec2f( 0, floor(-r.y - r.height) );
    case BOTTOM_CENTER:
      return ofVec2f( floor(-r.x - r.width * 0.5f), floor(-r.y - r.height) );
    case BOTTOM_RIGHT:
      return ofVec2f( 2.0 * floor(-r.x - r.width * 0.5f), floor(-r.y - r.height) );
    default:
      break;
  }
}

//void ofxTrueTypeFontUC::setSize(int size) {
//  mImpl->fontSize = size;
//  refreshFont();
//}
//
//void ofxTrueTypeFontUC::refreshFont() {
//  FT_Set_Char_Size( mImpl->face, mImpl->fontSize << 6, mImpl->fontSize << 6, mImpl->dpi, mImpl->dpi);
//  mImpl->lineHeight = mImpl->fontSize * 1.43f;
//
//  //------------------------------------------------------
//  //kerning would be great to support:
//  //ofLogNotice("ofxTrueTypeFontUC") << "FT_HAS_KERNING ? " <<  FT_HAS_KERNING(face);
//  //------------------------------------------------------
//
//  if (mImpl->bMakeContours) {
//    mImpl->charOutlines.clear();
//  }
//
//  // ------------- get default space size
//  unsigned int charID = mImpl->getCharID('p');
//  mImpl->loadChar(charID);
//
//  // ------------- close the library and typeface
//  mImpl->bLoadedOk = true;
//
//}

void ofxTrueTypeFontUC::unloadTextures() {
    mImpl->unloadTextures();
}

//===========================================================
namespace util {
  namespace ofxTrueTypeFontUC {

basic_string<unsigned int> convUTF8ToUTF32(const std::string &utf8_src){
  basic_string<unsigned int> dst;

  // convert UTF-8 on char or wchar_t to UCS-4 on wchar_t
  int size = utf8_src.size();
  int index = 0;
  while (index < size) {
    wchar_t c = (unsigned char)utf8_src[index];
    if (c < 0x80) {
      dst += (c);
    }
    else if (c < 0xe0) {
      if (index + 1 < size) {
        dst += (((c & 0x1f) << 6) | (utf8_src[index+1] & 0x3f));
        index++;
      }
    }
    else if (c < 0xf0) {
      if (index + 2 < size) {
        dst += (((c & 0x0f) << 12) | ((utf8_src[index+1] & 0x3f) << 6) |
                (utf8_src[index+2] & 0x3f));
        index += 2;
      }
    }
    else if (c < 0xf8) {
      if (index + 3 < size) {
        dst += (((c & 0x07) << 18) | ((utf8_src[index+1] & 0x3f) << 12) |
                ((utf8_src[index+2] & 0x3f) << 6) | (utf8_src[index+3] & 0x3f));
        index += 3;
      }
    }
    else if (c < 0xfc) {
      if (index + 4 < size) {
        dst += (((c & 0x03) << 24) | ((utf8_src[index+1] & 0x3f) << 18) |
                ((utf8_src[index+2] & 0x3f) << 12) | ((utf8_src[index+3] & 0x3f) << 6) |
                (utf8_src[index+4] & 0x3f));
        index += 4;
      }
    }
    else if (c < 0xfe) {
      if (index + 5 < size) {
        dst += (((c & 0x01) << 30) | ((utf8_src[index+1] & 0x3f) << 24) |
                ((utf8_src[index+2] & 0x3f) << 18) | ((utf8_src[index+3] & 0x3f) << 12) |
                ((utf8_src[index+4] & 0x3f) << 6) | (utf8_src[index+5] & 0x3f));
        index += 5;
      }
    }
    index++;
  }

  return dst;
}

  } // namespace ofxTrueTypeFontUC
} // namespace util

redpajama_set_name: RedPajamaGithub


text:
Xillio Facilitates Full Content Integration with IBM FileNet Connector
Hilversum, November 1, 2016 - Xillio enables organizations to make a jump start with integration projects, thanks to the introduction of the IBM FileNet connector. The IBM FileNet P8 connector is an out-of-the-box connector that can be utilized to easily integrate content and metadata from FileNet with other content sources. In addition, content from FileNet can easily be migrated to a different enterprise content management (ECM) system, or vice versa.
"We see that more and more large organizations choose to maintain their multiple document repositories," said Rikkert Engels, founder and CEO of Xillio. "In this situation, it is important that there is only one version of a document with relevant metadata. Also, searching and finding the right information at the right time in the process, is essential. Thanks to our connectors, including the IBM FileNet connector, it is possible to connect all content repositories with each other, and to create or combine metadata based on business rules."
This new connector is bi-directional and can be used to extract content and metadata from the FileNet Content Engine, or vice versa, to import data in FileNet. Xillio has, therefore, developed both an import and an export connector. The data can be used for migration and integration projects.
Export connector
The FileNet export connector creates a generic data model to store the content in the unified data model (UDM) database. It stores all data from FileNet, including metadata, versions, permissions, memberships and users and groups. From the UDM, data can be exchanged with another content source or be directly migrated to a different content management system (CMS).
Import connector
The import connector creates documents in the FileNet Content Engine based on data that has been stored in the UDM. All data will be imported, including custom properties of all content types, permissions, versions, and other FileNet information. It is also possible to add content derived from a local disk or another system, and it is possible to import different content types.
More information about the Xillio FileNet connector is on our support site.
More about our connectors.
← Back to all releases
Stay up to date?


Traveling to San Jose, CA to root on the SJSU Spartans at CEFCU Stadium? Hotels-Rates provides tons of information you need to select the best hotel, for the lowest price, convenient to CEFCU Stadium. We continuously gather data on hotels, attractions and points of interest in San Jose, CA and across the nation, so that you can choose the ideal hotel for you. Our comprehensive hotel database shows there are 43 hotels in San Jose less than 5 miles from CEFCU Stadium, with the lowest rate for those hotels being $89.42. We also found 2 hotels in San Jose within 1 mile of CEFCU Stadium, with the lowest rate for those hotels being $129. Hotels-Rates welcomes all college football fans to explore the numerous hotels and attractions in and around San Jose and CEFCU Stadium. Make sure you check in with us next time you are in San Jose for MW college football for updated rates and hotel availability. If you are looking for other things to do in San Jose, we think you might like the Bass Pro San Jose or the Moffett Field Museum.


Navy Child & Youth Programs support the military family by providing a safe and healthy environment, enriching experiences and care that strengthens your child's self-confidence and feelings of security. The Mid-Atlantic CYP offers a planned program of activities in each age group to promote intellectual, social, emotional and physical development of your child.
NSA Crane Yout Program offers summer camp. structured learning and fun field trips for children ages five to 12. Limited availability on a first-come, first-served basis. Registration packets located on the G2 and Sharepoint.


From the amazingly talented & passionate Country Luxe Wedding planners of Scenic Rim Bride that brought you the epic styled shoot at Summerland Camels featured front cover of Issue 7, we are proud to share with you Vero Amore - Italian for 'true love'. This very special shoot is the first of many as the launch of a brand new project called 'Scenic Scapes' by Scenic Rim Bride. The featured couple in this styled inspiration shoot are engaged couple, La'ace & Adam who had put their own Wedding plans on hold for La'ace to participate in Miss World Australia. As 2nd runner up 2018 (Congratulations!) these two are the very definition of true love and support, encouraging each other to be the very best person they can be, together.
This inspiring collaboration is set at the historic St Bernards Hotel, surrounded by acres of beautiful rainforest gardens and the open views of the Gold Coast Hinterland. La'ace wears a fabulous and flirty gown by Australian designer Begitta with hair styled by Ulyana Aster featuring a brand new hairpiece from Ulyana's latest collection.


When our eyes first open in the morning, what do we often do? Snooze our alarm? Check our email? Start getting ready right away?
All of these things snap us back into yesterday's image. Instead let's start the day with the future and live in the vision of what you desire. By getting yourself joyous when you first wake up and staying in that soft and dreamy state, you can shift what your reality will be like, even as soon as that day. This is a luxury that takes way more focus if it's done later in the day. The real magic of sleep is that when you wake up, you have the opportunity to choose what you want your life to be. You can literally re-decide who you are and radically shift your energy in the first few minutes of waking. You can embrace the best version of yourself and the universe has to comply with that new decision as you begin to confidently emanate this new you.
Do you ever notice how quickly your vibration can drop when you first notice where you are after you wake up? For those few moments everything is up in the air until we remember our life. In those hazy moments, you're 100% connected to the real you. This is a magic window where the concrete has yet to settle and you can sculpt your life the way you want it with a radical amount of ease than before. It's easy to jump right back into who we were and our circumstances of yesterday when it smacks us in the face, but that's why some solitude and tossing your phone out the window for the first half hour of your day will allow you to create your reality revolving around happiness versus creating more of the same old crap.
If you can become happy early in the day, the likelihood that you will sustain it throughout the day is huge once you get the hang of it. This has the greatest effect to effort ratio out of any point of your day. This is because as your day unfolds your thoughts will naturally stay on the track you start them on. By choosing happiness and doing anything to get yourself into a powerful high and elated feeling, the effect on your life over time will be large. It's easy to notice in your own life, if you have something that is thrilling, it's easy to hold on to that feeling throughout your day.
Start a powerful upward spiral and watch how the green lights and parking places line up in your direction.
Decide that everything is going to work out better than you thought it could! Forget where you are and see yourself where you want to be.
Dedicate the first half hour of your day towards focusing on you and feeling great. I highly recommend meditation. Listing thing to appreciate or anything that gets you in an appreciative mode is fantastic. Repeating happiness or joy in your mind like a mantra is a great way to get you into that mood. One of the best ways to focus in the morning is to say, "How would I feel if the most exciting thing I can imagine happening, were to happen?" Really spend time soaking in this excitement. Visualize your world just how you want it and act as if it's already true. If you keep this up, the incremental and daily effect is profound. Even if your life only gets one percent better every day, before you know it you will double and triple the quality of your life. Connect with yourself. If happiness is success and you start every day happy, you can quickly become the most successful and thrilled being you've met. Believe it.
Author of the upcoming book "Blissed Out". As a producer, songwriter and artist living in NYC, he uses music as a way to spread the message of positivity to the world. Zachariah has been empowering lives for over a decade via personal coaching sessions, radio interviews, and webinars. He emphasizes self development through happiness, focus and self love. His passion is sharing uplifting ideas to help people create a better reality.


text:
British Olympic Association (BOA) Athletes' Commission supports BRIT & the annual BRIT Challenge
We are sincerely grateful to Ben Hawes, former Chair of the British Olympic Association (BOA) Athletes' Commission, and all the Commission's Committee Members for their support to champion the annual BRIT Challenge and encourage their fellow British athletes to join our BRIT Ambassador family.
We are also sincerely grateful to Scott Field, Director of Communications at the BOA, for all his help and support to forge a special relationship with BOA and BOA Athletes' Commission.
"The British Olympic Association (BOA) Athletes' Commission is delighted to share its support of the British Inspiration Trust's inspiring annual BRIT Challenge initiative to improve young adult mental health and fitness.
We understand that living a more isolated lifestyle has had an impact on the lives of young adults and students throughout the UK; particularly feelings of loneliness, the ability to socialise, play or take part in sport, train together and maintain good mental and physical health. Our British athletes will understand the importance of sharing their lived experience and providing encouragement and support.
The BOA Athletes' Commission appreciate that many young adults and students are living with mental health challenges and that there has never been a more important time to deliver inspiration. We wholeheartedly encourage our fellow British athletes to support the annual BRIT Challenge by joining the BRIT Ambassador family, visiting universities and colleges of their choice, and encouraging student and staff participation. If visits are not possible, we hope that our fellow British athletes can support BRIT by providing inspiring video messages for young adults and reaching them through social media.
Almost 150 British athletes and British Sporting Icons have already united and joined the BRIT Ambassador family. This collectively powerful support will undoubtedly have a positive UK-wide impact on improving and supporting young adult mental health, raising positive awareness and helping to raise vital funds for local, regional and national charities."
Ben Hawes
Former Chair of the British Olympic Association (BOA) Athletes' Commission
We are thrilled that Paralympians, Olympians, sports personalities, adventures and explorers are joining our BRIT Ambassador family to encourage participation in the BRIT Challenge, stigmatise mental health and champion equality, diversity and inclusion.
Since the very beginning of the British Inspiration Trust's journey, our work to support and improve young adult mental health and fitness has been underpinned by the voices of our BRIT Ambassadors who have lived experience that is valued and respected.
 The BRIT Ambassador family is comprised of Olympians, Paralympians, Sports Personalities, Adventurers and Explorers who are uniting to support and improve young adult mental health throughout the UK.
There are 450 universities and colleges in the UK and our aspiration is to deliver inspiration to the young adults and students at every institution that participates in our annual BRIT Challenges.
Thank you to the 150 Olympians, Paralympians, Sports Personalities, Adventurers and Explorers who joined our BRIT Ambassador family this year to support young adult mental health and fitness throughout the UK and champion the annual BRIT Challenge.